Skip to content

Commit

Permalink
Extend linter/formatter rules
Browse files Browse the repository at this point in the history
Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
  • Loading branch information
gaborbernat committed Feb 22, 2024
1 parent 252ed89 commit 75767c3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
with:
python-version: "3.12"
- name: Install tox
run: python -m pip install tox
run: python -m pip install tox-uv
- uses: actions/checkout@v4
with:
fetch-depth: 0
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repos:
rev: "1.7.0"
hooks:
- id: pyproject-fmt
additional_dependencies: ["tox>=4.12.1"]
additional_dependencies: ["tox>=4.13"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.2.1"
hooks:
Expand Down
23 changes: 13 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
build-backend = "hatchling.build"
requires = [
"hatch-vcs>=0.4",
"hatchling>=1.18",
"hatchling>=1.21.1",
]

[project]
Expand Down Expand Up @@ -41,19 +41,19 @@ dependencies = [
"Sphinx>=7.1.2",
]
optional-dependencies.docs = [
"furo>=2023.9.10",
"furo>=2024.1.29",
]
optional-dependencies.numpy = [
"nptyping>=2.5",
]
optional-dependencies.testing = [
"covdefaults>=2.3",
"coverage>=7.3.2",
"diff-cover>=8.0.1",
"pytest>=7.4.3",
"coverage>=7.4.2",
"diff-cover>=8.0.3",
"pytest>=8.0.1",
"pytest-cov>=4.1",
"sphobjinv>=2.3.1",
"typing-extensions>=4.8",
"typing-extensions>=4.9",
]
urls.Changelog = "https://github.com/tox-dev/sphinx-autodoc-typehints/blob/main/CHANGELOG.md"
urls.Homepage = "https://github.com/tox-dev/sphinx-autodoc-typehints"
Expand All @@ -69,7 +69,7 @@ line-length = 120

[tool.ruff]
line-length = 120
target-version = "py37"
target-version = "py38"
lint.select = ["ALL"]
lint.isort = { known-first-party = [
"sphinx_autodoc_typehints",
Expand Down Expand Up @@ -118,9 +118,12 @@ html.show_contexts = true
html.skip_covered = false
paths.source = [
"src",
".tox*/*/lib/python*/site-packages",
".tox*/pypy*/site-packages",
".tox*\\*\\Lib\\site-packages",
".tox/*/lib/python*/site-packages",
".tox/pypy*/site-packages",
".tox\\*\\Lib\\site-packages",
".tox/*/.venv/lib/python*/site-packages",
".tox/pypy*/.venv/site-packages",
".tox\\*\\.venv\\Lib\\site-packages",
"*/src",
"*\\src",
]
Expand Down
15 changes: 7 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ env_list =
py310
py39
py38
py37
type
coverage
readme
Expand Down Expand Up @@ -39,7 +38,7 @@ commands =
description = format the code base to adhere to our styles, and complain about what we cannot do automatically
skip_install = true
deps =
pre-commit>=3.5
pre-commit>=3.6.2
commands =
pre-commit run --all-files --show-diff-on-failure

Expand All @@ -51,8 +50,8 @@ extras =
[testenv:type]
description = run type check on code base
deps =
mypy==1.7.1
types-docutils>=0.20.0.3
mypy==1.8
types-docutils>=0.20.0.20240201
set_env =
{tty:MYPY_FORCE_COLOR = 1}
commands =
Expand All @@ -64,8 +63,8 @@ description = combine coverage files and generate diff (against DIFF_AGAINST def
skip_install = true
deps =
covdefaults>=2.3
coverage>=7.3.2
diff-cover>=8.0.1
coverage>=7.4.2
diff-cover>=8.0.3
extras =
parallel_show_output = true
pass_env =
Expand All @@ -84,14 +83,13 @@ depends =
py310
py39
py38
py37

[testenv:readme]
description = check that the long description is valid (need for PyPI)
skip_install = true
deps =
build[virtualenv]>=1.0.3
twine>=4.0.2
twine>=5
extras =
commands =
pyproject-build -o {envtmpdir} --wheel --sdist .
Expand All @@ -103,3 +101,4 @@ package = editable
commands =
python -m pip list --format=columns
python -c 'import sys; print(sys.executable)'
uv_seed = true

0 comments on commit 75767c3

Please sign in to comment.