summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2021-07-04 01:51:46 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2021-07-07 17:27:31 -0700
commitb5d2c30d26060d4a55c88c1a665b6e9d95ba1644 (patch)
tree55c1249ddb07cdaed62a4276bb8549ceebecfce8
parent7a9fe189e1df6aa50e6b89109f6e8464a1cd6fdf (diff)
downloadspack-b5d2c30d26060d4a55c88c1a665b6e9d95ba1644.tar.gz
spack-b5d2c30d26060d4a55c88c1a665b6e9d95ba1644.tar.bz2
spack-b5d2c30d26060d4a55c88c1a665b6e9d95ba1644.tar.xz
spack-b5d2c30d26060d4a55c88c1a665b6e9d95ba1644.zip
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
-rw-r--r--.flake84
-rw-r--r--.github/workflows/unit_tests.yaml4
-rw-r--r--.isort.cfg11
-rw-r--r--lib/spack/spack/cmd/style.py4
-rw-r--r--pyproject.toml14
5 files changed, 16 insertions, 21 deletions
diff --git a/.flake8 b/.flake8
index d916433cfe..a4c8aa2fbc 100644
--- a/.flake8
+++ b/.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
diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml
index 434e6d04b4..a4790fc25e 100644
--- a/.github/workflows/unit_tests.yaml
+++ b/.github/workflows/unit_tests.yaml
@@ -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: |
diff --git a/.isort.cfg b/.isort.cfg
deleted file mode 100644
index e787561d14..0000000000
--- a/.isort.cfg
+++ /dev/null
@@ -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
diff --git a/lib/spack/spack/cmd/style.py b/lib/spack/spack/cmd/style.py
index 1f15db7b8d..23fc3e37ae 100644
--- a/lib/spack/spack/cmd/style.py
+++ b/lib/spack/spack/cmd/style.py
@@ -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
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000000..fc8dd4e428
--- /dev/null
+++ b/pyproject.toml
@@ -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