Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#280)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.4.3 → v0.4.4](astral-sh/ruff-pre-commit@v0.4.3...v0.4.4)
- [github.com/tox-dev/pyproject-fmt: 1.8.0 → 2.0.4](tox-dev/pyproject-fmt@1.8.0...2.0.4)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] committed May 13, 2024
1 parent b318012 commit dbf360f
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ repos:
additional_dependencies: [ "tomli>=2.0.1" ]
args: [ "--in-place", "--config", "./pyproject.toml" ]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.4.3"
rev: "v0.4.4"
hooks:
- id: ruff-format
- id: ruff
args: [ "--fix", "--unsafe-fixes", "--exit-non-zero-on-fix" ]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "1.8.0"
rev: "2.0.4"
hooks:
- id: pyproject-fmt
additional_dependencies: ["tox>=4.14.2"]
Expand Down
105 changes: 85 additions & 20 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,33 +67,61 @@ urls.Tracker = "https://github.com/platformdirs/platformdirs/issues"

[tool.hatch]
build.hooks.vcs.version-file = "src/platformdirs/version.py"
build.targets.sdist.include = ["/src", "/tests", "/tox.ini"]
build.targets.sdist.include = [
"/src",
"/tests",
"/tox.ini",
]
version.source = "vcs"

[tool.hatch.envs.default]
description = "Development environment"
features = ["test", "docs", "type"]
scripts = { show = ["python -m pip list --format=columns", 'python -c "import sys; print(sys.executable)"'] }
features = [
"test",
"docs",
"type",
]
scripts = { show = [
"python -m pip list --format=columns",
'python -c "import sys; print(sys.executable)"',
] }

[tool.hatch.envs.test]
template = "test"
# dev-mode = false # cannot enable this until https://github.com/pypa/hatch/issues/1237
description = "Run the test suite"
matrix = [{ python = ["3.12", "3.11", "3.10", "3.9", "3.8", "pypy3.9"] }]
features = ["test"]
matrix = [
{ python = [
"3.12",
"3.11",
"3.10",
"3.9",
"3.8",
"pypy3.9",
] },
]
features = [
"test",
]
env-vars = { COVERAGE_FILE = "report/.coverage.{matrix:python}", COVERAGE_PROCESS_START = "pyproject.toml", _COVERAGE_SRC = "src/platformdirs" }
[tool.hatch.envs.test.scripts]
run = ["""
run = [
"""
pytest --junitxml report/junit.{matrix:python}.xml --cov src/platformdirs --cov tests \
--cov-config=pyproject.toml --no-cov-on-fail --cov-report term-missing:skip-covered --cov-context=test \
--cov-report html:report/html{matrix:python} --cov-report xml:report/coverage{matrix:python}.xml \
tests
"""]
""",
]

[tool.hatch.envs.coverage]
template = "coverage"
description = "combine coverage files and generate diff"
dependencies = ["covdefaults>=2.3", "coverage[toml]>=7.3.2", "diff-cover>=8.0.1"]
dependencies = [
"covdefaults>=2.3",
"coverage[toml]>=7.3.2",
"diff-cover>=8.0.1",
]
env-vars = { COVERAGE_FILE = "report/.coverage" }
[tool.hatch.envs.coverage.scripts]
run = [
Expand All @@ -109,23 +137,35 @@ template = "type"
description = "Run the type checker"
python = "3.12"
dev-mode = false
features = ["type", "test"]
scripts = { run = ["mypy --strict src", "mypy --strict tests"] }
features = [
"type",
"test",
]
scripts = { run = [
"mypy --strict src",
"mypy --strict tests",
] }

[tool.hatch.envs.fix]
template = "fix"
description = "Run the pre-commit tool to lint and autofix issues"
python = "3.12"
detached = true
dependencies = ["pre-commit>=3.6"]
scripts = { "run" = ["pre-commit run --all-files --show-diff-on-failure"] }
dependencies = [
"pre-commit>=3.6",
]
scripts = { "run" = [
"pre-commit run --all-files --show-diff-on-failure",
] }

[tool.hatch.envs.docs]
template = "docs"
description = "Build documentation using Sphinx"
python = "3.12"
dev-mode = false
features = ["docs"]
features = [
"docs",
]
[tool.hatch.envs.docs.scripts]
build = [
"""python -c "import glob; import subprocess; subprocess.call(['proselint'] + glob.glob('docs/*.rst'))" """,
Expand All @@ -138,14 +178,29 @@ build = [
template = "readme"
description = "check that the long description is valid"
python = "3.12"
dependencies = ["build[virtualenv]>=1.0.3", "twine>=4.0.2", "check-wheel-contents>=0.6.0"]
scripts = { "run" = ["python -m build -o dist", "twine check dist/*.whl dist/*.tar.gz", "check-wheel-contents dist"] }
dependencies = [
"build[virtualenv]>=1.0.3",
"twine>=4.0.2",
"check-wheel-contents>=0.6.0",
]
scripts = { "run" = [
"python -m build -o dist",
"twine check dist/*.whl dist/*.tar.gz",
"check-wheel-contents dist",
] }

[tool.ruff]
select = ["ALL"]
select = [
"ALL",
]
line-length = 120
target-version = "py38"
isort = { known-first-party = ["platformdirs", "tests"], required-imports = ["from __future__ import annotations"] }
isort = { known-first-party = [
"platformdirs",
"tests",
], required-imports = [
"from __future__ import annotations",
] }
ignore = [
"ANN101", # Missing type annotation for `self` in method
"D301", # Use `r"""` if any backslashes in a docstring
Expand Down Expand Up @@ -186,13 +241,23 @@ wrap-summaries = 120
html.show_contexts = true
html.skip_covered = false
run.relative_files = true
paths.source = ["src", "**/site-packages"]
paths.source = [
"src",
"**/site-packages",
]
report.fail_under = 76
run.parallel = true
run.plugins = ["covdefaults"]
run.plugins = [
"covdefaults",
]

[tool.mypy]
python_version = "3.11"
show_error_codes = true
strict = true
overrides = [{ module = ["appdirs.*", "jnius.*"], ignore_missing_imports = true }]
overrides = [
{ module = [
"appdirs.*",
"jnius.*",
], ignore_missing_imports = true },
]

0 comments on commit dbf360f

Please sign in to comment.