style: Move isort configuration to pyproject.toml
- [x] Remove flake8-import-order checks, as we only need isort for this - [x] Clean up configuration and requirements
This commit is contained in:
parent
7a9fe189e1
commit
b5d2c30d26
5 changed files with 16 additions and 21 deletions
4
.flake8
4
.flake8
|
@ -66,10 +66,6 @@ exclude =
|
|||
|
||||
format = spack
|
||||
|
||||
# flake8-import-order settings
|
||||
application-import-names = llnl,spack
|
||||
import-order-style = pycharm
|
||||
|
||||
[flake8:local-plugins]
|
||||
report =
|
||||
spack = flake8_formatter:SpackFormatter
|
||||
|
|
4
.github/workflows/unit_tests.yaml
vendored
4
.github/workflows/unit_tests.yaml
vendored
|
@ -39,7 +39,7 @@ jobs:
|
|||
python-version: 3.9
|
||||
- name: Install Python packages
|
||||
run: |
|
||||
pip install --upgrade pip six setuptools flake8 flake8-import-order isort mypy>=0.800 black types-six types-python-dateutil
|
||||
pip install --upgrade pip six setuptools flake8 isort>=4.3.5 mypy>=0.800 black types-six types-python-dateutil
|
||||
- name: Setup git configuration
|
||||
run: |
|
||||
# Need this for the git tests to succeed.
|
||||
|
@ -370,7 +370,7 @@ jobs:
|
|||
run: |
|
||||
pip install --upgrade pip six setuptools
|
||||
pip install --upgrade codecov coverage
|
||||
pip install --upgrade flake8 flake8-import-order isort pep8-naming mypy
|
||||
pip install --upgrade flake8 isort>=4.3.5 pep8-naming mypy>=0.800
|
||||
pip install --upgrade python-dateutil
|
||||
- name: Setup Homebrew packages
|
||||
run: |
|
||||
|
|
11
.isort.cfg
11
.isort.cfg
|
@ -1,11 +0,0 @@
|
|||
[settings]
|
||||
profile=black
|
||||
sections=FUTURE,STDLIB,THIRDPARTY,ARCHSPEC,LLNL,FIRSTPARTY,LOCALFOLDER
|
||||
src_paths=lib
|
||||
force_sort_within_sections=True
|
||||
line_length=79
|
||||
known_first_party=spack
|
||||
known_archspec=archspec
|
||||
known_llnl=llnl
|
||||
honor_noqa=True
|
||||
use_parentheses=True
|
|
@ -219,10 +219,6 @@ def run_flake8(file_list, args):
|
|||
print_tool_header("flake8")
|
||||
flake8_cmd = which("flake8", required=True)
|
||||
|
||||
# Check if plugins are installed
|
||||
if "import-order" not in flake8_cmd("--version", output=str, error=str):
|
||||
tty.warn("style: flake8-import-order plugin is not installed, skipping")
|
||||
|
||||
output = ""
|
||||
# run in chunks of 100 at a time to avoid line length limit
|
||||
# filename parameter in config *does not work* for this reliably
|
||||
|
|
14
pyproject.toml
Normal file
14
pyproject.toml
Normal file
|
@ -0,0 +1,14 @@
|
|||
[tool.isort]
|
||||
profile = "black"
|
||||
sections = [
|
||||
"FUTURE",
|
||||
"STDLIB",
|
||||
"THIRDPARTY",
|
||||
"ARCHSPEC", "LLNL", "FIRSTPARTY",
|
||||
"LOCALFOLDER",
|
||||
]
|
||||
known_first_party = "spack"
|
||||
known_archspec = "archspec"
|
||||
known_llnl = "llnl"
|
||||
src_paths = "lib"
|
||||
honor_noqa = true
|
Loading…
Reference in a new issue