Use flake8-import-order to enforce PEP-8 compliance (#23947)
This commit is contained in:
parent
744cedc7e9
commit
2284007db9
3 changed files with 15 additions and 11 deletions
4
.flake8
4
.flake8
|
@ -66,6 +66,10 @@ exclude =
|
||||||
|
|
||||||
format = spack
|
format = spack
|
||||||
|
|
||||||
|
# flake8-import-order settings
|
||||||
|
application-import-names = llnl,spack
|
||||||
|
import-order-style = pycharm
|
||||||
|
|
||||||
[flake8:local-plugins]
|
[flake8:local-plugins]
|
||||||
report =
|
report =
|
||||||
spack = flake8_formatter:SpackFormatter
|
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
|
python-version: 3.9
|
||||||
- name: Install Python packages
|
- name: Install Python packages
|
||||||
run: |
|
run: |
|
||||||
pip install --upgrade pip six setuptools flake8 mypy>=0.800 black types-six types-python-dateutil
|
pip install --upgrade pip six setuptools flake8 flake8-import-order mypy>=0.800 black types-six types-python-dateutil
|
||||||
- name: Setup git configuration
|
- name: Setup git configuration
|
||||||
run: |
|
run: |
|
||||||
# Need this for the git tests to succeed.
|
# Need this for the git tests to succeed.
|
||||||
|
@ -370,7 +370,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
pip install --upgrade pip six setuptools
|
pip install --upgrade pip six setuptools
|
||||||
pip install --upgrade codecov coverage
|
pip install --upgrade codecov coverage
|
||||||
pip install --upgrade flake8 pep8-naming mypy
|
pip install --upgrade flake8 flake8-import-order pep8-naming mypy
|
||||||
pip install --upgrade python-dateutil
|
pip install --upgrade python-dateutil
|
||||||
- name: Setup Homebrew packages
|
- name: Setup Homebrew packages
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
The spack package class structure is based strongly on Homebrew
|
The spack package class structure is based strongly on Homebrew
|
||||||
(http://brew.sh/), mainly because Homebrew makes it very easy to create
|
(http://brew.sh/), mainly because Homebrew makes it very easy to create
|
||||||
packages.
|
packages.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
import collections
|
import collections
|
||||||
import contextlib
|
import contextlib
|
||||||
|
@ -25,13 +25,14 @@
|
||||||
import textwrap
|
import textwrap
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
import six
|
|
||||||
import types
|
import types
|
||||||
from typing import Optional, List, Dict, Any, Callable # novm
|
from typing import Any, Callable, Dict, List, Optional # novm
|
||||||
|
|
||||||
|
import six
|
||||||
|
from ordereddict_backport import OrderedDict
|
||||||
|
|
||||||
import llnl.util.filesystem as fsys
|
import llnl.util.filesystem as fsys
|
||||||
import llnl.util.tty as tty
|
import llnl.util.tty as tty
|
||||||
|
|
||||||
import spack.compilers
|
import spack.compilers
|
||||||
import spack.config
|
import spack.config
|
||||||
import spack.dependency
|
import spack.dependency
|
||||||
|
@ -51,14 +52,13 @@
|
||||||
import spack.util.web
|
import spack.util.web
|
||||||
from llnl.util.lang import memoized
|
from llnl.util.lang import memoized
|
||||||
from llnl.util.link_tree import LinkTree
|
from llnl.util.link_tree import LinkTree
|
||||||
from ordereddict_backport import OrderedDict
|
|
||||||
from spack.filesystem_view import YamlFilesystemView
|
from spack.filesystem_view import YamlFilesystemView
|
||||||
from spack.installer import PackageInstaller, InstallError
|
|
||||||
from spack.install_test import TestFailure, TestSuite
|
from spack.install_test import TestFailure, TestSuite
|
||||||
from spack.util.executable import which, ProcessError
|
from spack.installer import InstallError, PackageInstaller
|
||||||
from spack.util.prefix import Prefix
|
from spack.stage import ResourceStage, Stage, StageComposite, stage_prefix
|
||||||
from spack.stage import stage_prefix, Stage, ResourceStage, StageComposite
|
from spack.util.executable import ProcessError, which
|
||||||
from spack.util.package_hash import package_hash
|
from spack.util.package_hash import package_hash
|
||||||
|
from spack.util.prefix import Prefix
|
||||||
from spack.version import Version
|
from spack.version import Version
|
||||||
|
|
||||||
"""Allowed URL schemes for spack packages."""
|
"""Allowed URL schemes for spack packages."""
|
||||||
|
|
Loading…
Reference in a new issue