pyproject.toml: format (#50339)

This commit is contained in:
Harmen Stoppels 2025-05-07 16:40:41 +02:00 committed by GitHub
parent 12a7e8d73a
commit 4f2a1806f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,11 +1,8 @@
[project] [project]
name="spack" name = "spack"
description="The spack package manager" description = "The spack package manager"
requires-python=">=3.6" requires-python = ">=3.6"
dependencies=[ dependencies = ["clingo", "setuptools"]
"clingo",
"setuptools",
]
dynamic = ["version"] dynamic = ["version"]
[project.scripts] [project.scripts]
@ -21,16 +18,13 @@ dev = [
"pytest-xdist", "pytest-xdist",
"setuptools", "setuptools",
"click", "click",
'black', "black",
"mypy", "mypy",
"isort", "isort",
"flake8", "flake8",
"vermin", "vermin",
] ]
ci = [ ci = ["pytest-cov", "codecov[toml]"]
"pytest-cov",
"codecov[toml]",
]
[build-system] [build-system]
requires = ["hatchling"] requires = ["hatchling"]
@ -53,9 +47,7 @@ include = [
] ]
[tool.hatch.envs.default] [tool.hatch.envs.default]
features = [ features = ["dev"]
"dev",
]
[tool.hatch.envs.default.scripts] [tool.hatch.envs.default.scripts]
spack = "./bin/spack" spack = "./bin/spack"
@ -63,10 +55,7 @@ style = "./bin/spack style"
test = "./bin/spack unit-test" test = "./bin/spack unit-test"
[tool.hatch.envs.ci] [tool.hatch.envs.ci]
features = [ features = ["dev", "ci"]
"dev",
"ci",
]
[tool.ruff] [tool.ruff]
line-length = 99 line-length = 99
@ -83,14 +72,14 @@ ignore = ["E731", "E203"]
[tool.ruff.lint.isort] [tool.ruff.lint.isort]
split-on-trailing-comma = false split-on-trailing-comma = false
section-order = [ section-order = [
"future", "future",
"standard-library", "standard-library",
"third-party", "third-party",
"archspec", "archspec",
"llnl", "llnl",
"spack", "spack",
"first-party", "first-party",
"local-folder", "local-folder",
] ]
[tool.ruff.lint.isort.sections] [tool.ruff.lint.isort.sections]
@ -104,8 +93,8 @@ llnl = ["llnl"]
[tool.black] [tool.black]
line-length = 99 line-length = 99
include = '(lib/spack|var/spack/repos|var/spack/test_repos)/.*\.pyi?$|bin/spack$' include = "(lib/spack|var/spack/repos|var/spack/test_repos)/.*\\.pyi?$|bin/spack$"
extend-exclude = 'lib/spack/external' extend-exclude = "lib/spack/external"
skip_magic_trailing_comma = true skip_magic_trailing_comma = true
[tool.isort] [tool.isort]
@ -115,7 +104,9 @@ sections = [
"FUTURE", "FUTURE",
"STDLIB", "STDLIB",
"THIRDPARTY", "THIRDPARTY",
"ARCHSPEC", "LLNL", "FIRSTPARTY", "ARCHSPEC",
"LLNL",
"FIRSTPARTY",
"LOCALFOLDER", "LOCALFOLDER",
] ]
known_first_party = "spack" known_first_party = "spack"
@ -129,13 +120,9 @@ honor_noqa = true
files = [ files = [
"lib/spack/llnl/**/*.py", "lib/spack/llnl/**/*.py",
"lib/spack/spack/**/*.py", "lib/spack/spack/**/*.py",
"var/spack/repos/spack_repo/builtin/packages/*/package.py" "var/spack/repos/spack_repo/builtin/packages/*/package.py",
]
mypy_path = [
"lib/spack",
"lib/spack/external",
"var/spack/repos",
] ]
mypy_path = ["lib/spack", "lib/spack/external", "var/spack/repos"]
allow_redefinition = true allow_redefinition = true
# This and a generated import file allows supporting packages # This and a generated import file allows supporting packages
@ -146,68 +133,68 @@ namespace_packages = true
ignore_errors = true ignore_errors = true
ignore_missing_imports = true ignore_missing_imports = true
[[tool.mypy.overrides]] [[tool.mypy.overrides]]
module = 'spack.*' module = "spack.*"
ignore_errors = false ignore_errors = false
ignore_missing_imports = false ignore_missing_imports = false
[[tool.mypy.overrides]] [[tool.mypy.overrides]]
module = 'spack_repo.*' module = "spack_repo.*"
ignore_errors = false ignore_errors = false
ignore_missing_imports = false ignore_missing_imports = false
# we can't do this here, not a module scope option, in spack style instead # we can't do this here, not a module scope option, in spack style instead
# disable_error_code = 'no-redef' # disable_error_code = 'no-redef'
[[tool.mypy.overrides]] [[tool.mypy.overrides]]
module = 'llnl.*' module = "llnl.*"
ignore_errors = false ignore_errors = false
ignore_missing_imports = false ignore_missing_imports = false
[[tool.mypy.overrides]] [[tool.mypy.overrides]]
module = 'spack.test.packages' module = "spack.test.packages"
ignore_errors = true ignore_errors = true
# ignore errors in fake import path for packages # ignore errors in fake import path for packages
[[tool.mypy.overrides]] [[tool.mypy.overrides]]
module = 'spack.pkg.*' module = "spack.pkg.*"
ignore_errors = true ignore_errors = true
ignore_missing_imports = true ignore_missing_imports = true
# Spack imports a number of external packages, and they *may* require Python 3.8 or # Spack imports a number of external packages, and they *may* require Python 3.8 or
# higher in recent versions. This can cause mypy to fail because we check for 3.7 # higher in recent versions. This can cause mypy to fail because we check for 3.7
# compatibility. We could restrict mypy to run for the oldest supported version (3.7), # compatibility. We could restrict mypy to run for the oldest supported version (3.7),
# but that means most developers won't be able to run mypy, which means it'll fail # but that means most developers won't be able to run mypy, which means it'll fail
# more in CI. Instead, we exclude these imported packages from mypy checking. # more in CI. Instead, we exclude these imported packages from mypy checking.
[[tool.mypy.overrides]] [[tool.mypy.overrides]]
module = [ module = [
'IPython', "IPython",
'altgraph', "altgraph",
'attr', "attr",
'boto3', "boto3",
'botocore', "botocore",
'distro', "distro",
'importlib.metadata', "importlib.metadata",
'jinja2', "jinja2",
'jsonschema', "jsonschema",
'macholib', "macholib",
'markupsafe', "markupsafe",
'numpy', "numpy",
'pkg_resources', "pkg_resources",
'pyristent', "pyristent",
'pytest', "pytest",
'ruamel.yaml', "ruamel.yaml",
'six', "six",
] ]
follow_imports = 'skip' follow_imports = "skip"
follow_imports_for_stubs = true follow_imports_for_stubs = true
[tool.pyright] [tool.pyright]
useLibraryCodeForTypes = true useLibraryCodeForTypes = true
reportMissingImports = true reportMissingImports = true
reportWildcardImportFromLibrary = false reportWildcardImportFromLibrary = false
include = ['lib/spack', 'var/spack/repos', 'var/spack/test_repos'] include = ["lib/spack", "var/spack/repos", "var/spack/test_repos"]
ignore = ['lib/spack/external'] ignore = ["lib/spack/external"]
extraPaths = ['lib/spack', 'lib/spack/external'] extraPaths = ["lib/spack", "lib/spack/external"]
[tool.coverage.run] [tool.coverage.run]
@ -217,39 +204,39 @@ branch = true
source = ["bin", "lib"] source = ["bin", "lib"]
data_file = "./tests-coverage/.coverage" data_file = "./tests-coverage/.coverage"
omit = [ omit = [
'lib/spack/spack/test/*', "lib/spack/spack/test/*",
'lib/spack/docs/*', "lib/spack/docs/*",
'lib/spack/external/*', "lib/spack/external/*",
'share/spack/qa/*', "share/spack/qa/*",
] ]
[tool.coverage.report] [tool.coverage.report]
# Regexes for lines to exclude from consideration # Regexes for lines to exclude from consideration
exclude_lines = [ exclude_lines = [
# Have to re-enable the standard pragma # Have to re-enable the standard pragma
'pragma: no cover', "pragma: no cover",
# Don't complain about missing debug-only code: # Don't complain about missing debug-only code:
'def __repr__', "def __repr__",
'if self\.debug', "if self\\.debug",
# Don't complain if tests don't hit defensive assertion code: # Don't complain if tests don't hit defensive assertion code:
'raise AssertionError', "raise AssertionError",
'raise NotImplementedError', "raise NotImplementedError",
# Don't complain if non-runnable code isn't run: # Don't complain if non-runnable code isn't run:
'if 0:', "if 0:",
'if False:', "if False:",
'if __name__ == .__main__.:', "if __name__ == .__main__.:",
] ]
ignore_errors = true ignore_errors = true
[tool.coverage.paths] [tool.coverage.paths]
source = [ source = [
".", ".",
"/Users/runner/work/spack/spack", "/Users/runner/work/spack/spack",
"/System/Volumes/Data/home/runner/work/spack/spack", "/System/Volumes/Data/home/runner/work/spack/spack",
"D:\\a\\spack\\spack", "D:\\a\\spack\\spack",
] ]
[tool.coverage.html] [tool.coverage.html]
@ -264,8 +251,7 @@ protected-files = ["__init__.py", "README.rst", "vendor.txt"]
patches-dir = "lib/spack/external/patches" patches-dir = "lib/spack/external/patches"
[tool.vendoring.transformations] [tool.vendoring.transformations]
substitute = [ substitute = []
]
drop = [ drop = [
# contains unnecessary scripts # contains unnecessary scripts
"bin/", "bin/",
@ -278,12 +264,12 @@ drop = [
"pkg_resources/extern/", "pkg_resources/extern/",
# trim vendored pygments styles and lexers # trim vendored pygments styles and lexers
"pygments/styles/[!_]*.py", "pygments/styles/[!_]*.py",
'^pygments/lexers/(?!python|__init__|_mapping).*\.py$', "^pygments/lexers/(?!python|__init__|_mapping).*\\.py$",
# trim rich's markdown support # trim rich's markdown support
"rich/markdown.py", "rich/markdown.py",
# ruamel.yaml installs unneded files # ruamel.yaml installs unneded files
"ruamel.*.pth", "ruamel.*.pth",
"pvectorc.*.so" "pvectorc.*.so",
] ]
[tool.vendoring.typing-stubs] [tool.vendoring.typing-stubs]