Skip to content

Commit 1ba902d

Browse files
committedJul 8, 2021
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
1 parent bed8719 commit 1ba902d

File tree

5 files changed

+16
-21
lines changed

5 files changed

+16
-21
lines changed
 

‎.flake8

-4
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ exclude =
6666

6767
format = spack
6868

69-
# flake8-import-order settings
70-
application-import-names = llnl,spack
71-
import-order-style = pycharm
72-
7369
[flake8:local-plugins]
7470
report =
7571
spack = flake8_formatter:SpackFormatter

‎.github/workflows/unit_tests.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
python-version: 3.9
4040
- name: Install Python packages
4141
run: |
42-
pip install --upgrade pip six setuptools flake8 flake8-import-order isort mypy>=0.800 black types-six types-python-dateutil
42+
pip install --upgrade pip six setuptools flake8 isort>=4.3.5 mypy>=0.800 black types-six types-python-dateutil
4343
- name: Setup git configuration
4444
run: |
4545
# Need this for the git tests to succeed.
@@ -370,7 +370,7 @@ jobs:
370370
run: |
371371
pip install --upgrade pip six setuptools
372372
pip install --upgrade codecov coverage
373-
pip install --upgrade flake8 flake8-import-order isort pep8-naming mypy
373+
pip install --upgrade flake8 isort>=4.3.5 pep8-naming mypy>=0.800
374374
pip install --upgrade python-dateutil
375375
- name: Setup Homebrew packages
376376
run: |

‎.isort.cfg

-11
This file was deleted.

‎lib/spack/spack/cmd/style.py

-4
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,6 @@ def run_flake8(file_list, args):
219219
print_tool_header("flake8")
220220
flake8_cmd = which("flake8", required=True)
221221

222-
# Check if plugins are installed
223-
if "import-order" not in flake8_cmd("--version", output=str, error=str):
224-
tty.warn("style: flake8-import-order plugin is not installed, skipping")
225-
226222
output = ""
227223
# run in chunks of 100 at a time to avoid line length limit
228224
# filename parameter in config *does not work* for this reliably

‎pyproject.toml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[tool.isort]
2+
profile = "black"
3+
sections = [
4+
"FUTURE",
5+
"STDLIB",
6+
"THIRDPARTY",
7+
"ARCHSPEC", "LLNL", "FIRSTPARTY",
8+
"LOCALFOLDER",
9+
]
10+
known_first_party = "spack"
11+
known_archspec = "archspec"
12+
known_llnl = "llnl"
13+
src_paths = "lib"
14+
honor_noqa = true

0 commit comments

Comments
 (0)
Please sign in to comment.