diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 910ba1b62e1..bf2056d826d 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -# flake8: noqa: F401 +# flake8: noqa: F401, E402 """spack.package defines the public API for Spack packages, by re-exporting useful symbols from other modules. Packages should import this module, instead of importing from spack.* directly to ensure forward compatibility with future versions of Spack.""" diff --git a/pyproject.toml b/pyproject.toml index 66c384f6fac..04dfa47ebcf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,7 @@ [project] name="spack" description="The spack package manager" +requires-python=">=3.6" dependencies=[ "clingo", "setuptools", @@ -67,9 +68,42 @@ features = [ "ci", ] +[tool.ruff] +line-length = 99 +extend-include = ["bin/spack"] +extend-exclude = ["lib/spack/external", "*.pyi"] + +[tool.ruff.format] +skip-magic-trailing-comma = true + +[tool.ruff.lint] +extend-select = ["I"] +ignore = ["E731", "E203"] + +[tool.ruff.lint.isort] +split-on-trailing-comma = false +section-order = [ + "future", + "standard-library", + "third-party", + "archspec", + "llnl", + "spack", + "first-party", + "local-folder", +] + +[tool.ruff.lint.isort.sections] +spack = ["spack"] +archspec = ["archspec"] +llnl = ["llnl"] + +[tool.ruff.lint.per-file-ignores] +"var/spack/repos/*/package.py" = ["F403", "F405", "F811", "F821"] +"*-ci-package.py" = ["F403", "F405", "F821"] + [tool.black] line-length = 99 -target-version = ['py36', 'py37', 'py38', 'py39', 'py310'] include = '(lib/spack|var/spack/repos)/.*\.pyi?$|bin/spack$' extend-exclude = 'lib/spack/external' skip_magic_trailing_comma = true