Skip to content

Commit 302f383

Browse files
[pre-commit.ci] pre-commit autoupdate (#150)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 9371946 commit 302f383

File tree

5 files changed

+79
-89
lines changed

5 files changed

+79
-89
lines changed

.github/workflows/check.yml

Lines changed: 33 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -19,75 +19,64 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22+
os:
23+
- windows-latest
24+
- macos-latest
25+
- ubuntu-latest
2226
py:
23-
- "3.13.0-beta.2"
27+
- "3.13"
2428
- "3.12"
2529
- "3.11"
2630
- "3.10"
2731
- "3.9"
2832
- "3.8"
29-
os:
30-
- ubuntu-latest
31-
- windows-latest
32-
- macos-latest
3333
steps:
34-
- name: Setup python for tox
34+
- name: Install the latest version of uv
35+
uses: astral-sh/setup-uv@v2
36+
with:
37+
enable-cache: true
38+
github-token: ${{ secrets.GITHUB_TOKEN }}
39+
- name: setup python for tox
3540
uses: actions/setup-python@v5
3641
with:
3742
python-version: "3.12"
43+
- name: install tox
44+
run: uv pip install --system --python "3.12" tox-uv
3845
- uses: actions/checkout@v4
39-
with:
40-
fetch-depth: 0
41-
- name: Install tox-uv
42-
run: python -m pip install tox-uv
43-
- name: Setup python for test ${{ matrix.py }}
46+
- name: setup python for test ${{ matrix.py }}
4447
uses: actions/setup-python@v5
4548
with:
4649
python-version: ${{ matrix.py }}
47-
- name: Pick environment to run
48-
run: |
49-
import os; import platform; import sys; from pathlib import Path
50-
env = f'TOXENV=py{"" if platform.python_implementation() == "CPython" else "py"}3{sys.version_info.minor}'
51-
print(f"Picked: {env} for {sys.version} based of {sys.executable}")
52-
with Path(os.environ["GITHUB_ENV"]).open("ta") as file_handler:
53-
file_handler.write(env)
54-
shell: python
55-
- name: Setup test suite
56-
run: tox -vv --notest
57-
- name: Run test suite
58-
run: tox --skip-pkg-install
59-
env:
60-
PYTEST_ADDOPTS: "-vv --durations=20"
61-
CI_RUN: "yes"
62-
DIFF_AGAINST: HEAD
50+
allow-prereleases: true
51+
- name: setup test suite
52+
run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.py }}
53+
- name: run test suite
54+
run: tox run --skip-pkg-install -e ${{ matrix.py }}
6355

6456
check:
65-
name: tox env ${{ matrix.tox_env }} on ${{ matrix.os }}
66-
runs-on: ${{ matrix.os }}
57+
name: tox env ${{ matrix.tox_env }}
58+
runs-on: ubuntu-latest
6759
strategy:
6860
fail-fast: false
6961
matrix:
7062
tox_env:
7163
- type
7264
- dev
73-
- docs
74-
- pkg_meta
75-
os:
76-
- ubuntu-latest
77-
- windows-latest
78-
exclude:
79-
- { os: windows-latest, tox_env: pkg_meta }
65+
- readme
8066
steps:
8167
- uses: actions/checkout@v4
68+
- name: Install the latest version of uv
69+
uses: astral-sh/setup-uv@v2
8270
with:
83-
fetch-depth: 0
84-
- name: Setup Python 3.12
71+
enable-cache: true
72+
github-token: ${{ secrets.GITHUB_TOKEN }}
73+
- name: setup Python
8574
uses: actions/setup-python@v5
8675
with:
8776
python-version: "3.12"
88-
- name: Install tox-uv
89-
run: python -m pip install tox-uv
90-
- name: Run check for ${{ matrix.tox_env }}
91-
run: tox -e ${{ matrix.tox_env }}
92-
env:
93-
UPGRADE_ADVISORY: "yes"
77+
- name: install tox
78+
run: uv pip install --system --python "3.12" tox-uv
79+
- name: setup test suite
80+
run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.tox_env }}
81+
- name: run test suite
82+
run: tox run --skip-pkg-install -e ${{ matrix.tox_env }}

.github/workflows/release.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,17 @@ jobs:
1616
uses: actions/setup-python@v5
1717
with:
1818
python-version: "3.12"
19-
- name: Install build
20-
run: python -m pip install build
19+
- name: Install the latest version of uv
20+
uses: astral-sh/setup-uv@v2
21+
with:
22+
enable-cache: true
23+
github-token: ${{ secrets.GITHUB_TOKEN }}
2124
- uses: actions/checkout@v4
2225
with:
2326
fetch-depth: 0
2427
- name: Build package
25-
run: pyproject-build -s -w . -o dist
28+
run: uv build --python "3.12" --sdist --wheel --out-dir dist .
2629
- name: Publish to PyPI
2730
uses: pypa/[email protected]
31+
with:
32+
attestations: true

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ repos:
1515
- id: codespell
1616
additional_dependencies: ["tomli>=2.0.1"]
1717
- repo: https://github.com/tox-dev/tox-ini-fmt
18-
rev: "1.3.2"
18+
rev: "1.4.0"
1919
hooks:
2020
- id: tox-ini-fmt
2121
args: ["-p", "fix"]
2222
- repo: https://github.com/tox-dev/pyproject-fmt
2323
rev: "2.2.3"
2424
hooks:
2525
- id: pyproject-fmt
26-
additional_dependencies: ["tox>=4.15.1"]
26+
additional_dependencies: ["tox>=4.18.1"]
2727
- repo: https://github.com/astral-sh/ruff-pre-commit
28-
rev: "v0.6.4"
28+
rev: "v0.6.5"
2929
hooks:
3030
- id: ruff-format
3131
- id: ruff

pyproject.toml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
build-backend = "hatchling.build"
33
requires = [
44
"hatch-vcs>=0.4",
5-
"hatchling>=1.24.2",
5+
"hatchling>=1.25",
66
]
77

88
[project]
@@ -51,15 +51,15 @@ dependencies = [
5151
"tomli>=2.0.1; python_version<'3.11'",
5252
]
5353
optional-dependencies.docs = [
54-
"furo>=2024.5.6",
55-
"sphinx-autodoc-typehints>=2.2.1",
54+
"furo>=2024.8.6",
55+
"sphinx-autodoc-typehints>=2.4.1",
5656
]
5757
optional-dependencies.testing = [
5858
"covdefaults>=2.3",
59-
"pytest>=8.2.2",
59+
"pytest>=8.3.3",
6060
"pytest-cov>=5",
6161
"pytest-mock>=3.14",
62-
"setuptools>=70.1",
62+
"setuptools>=75.1",
6363
]
6464
urls.Changelog = "https://github.com/tox-dev/pyproject-api/releases"
6565
urls.Homepage = "https://pyproject-api.readthedocs.io"
@@ -87,6 +87,7 @@ lint.ignore = [
8787
"CPY", # No copyright statements
8888
"D203", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible
8989
"D212", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible
90+
"DOC", # no restructuredtext support
9091
"INP001", # no implicit namespaces here
9192
"ISC001", # Conflict with formatter
9293
"S104", # Possible binding to all interface
@@ -103,13 +104,13 @@ lint.per-file-ignores."src/pyproject_api/_backend.pyi" = [
103104
] # https://github.com/astral-sh/ruff/issues/10077
104105
lint.per-file-ignores."tests/**/*.py" = [
105106
"D", # don't care about documentation in tests
106-
"FBT", # don"t care about booleans as positional arguments in tests
107+
"FBT", # don't care about booleans as positional arguments in tests
107108
"INP001", # no implicit namespace
108109
"PLC2701", # private imports
109110
"PLR0913", # too many positional arguments
110111
"PLR0917", # too many positional arguments
111112
"PLR2004", # Magic value used in comparison, consider replacing with a constant variable
112-
"S101", # asserts allowed in tests...
113+
"S101", # asserts allowed in tests
113114
"S603", # `subprocess` call: check for execution of untrusted input
114115
]
115116
lint.isort = { known-first-party = [
@@ -146,7 +147,7 @@ run.plugins = [
146147
]
147148

148149
[tool.mypy]
149-
python_version = "3.11"
150+
python_version = "3.12"
150151
show_error_codes = true
151152
strict = true
152153
overrides = [

tox.ini

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,50 @@
11
[tox]
22
requires =
3-
tox>=4.2
3+
tox>=4.18.1
4+
tox-uv>=1.11.3
45
env_list =
56
fix
6-
py313
7-
py312
8-
py311
9-
py310
10-
py39
11-
py38
12-
py37
7+
3.13
8+
3.12
9+
3.11
10+
3.10
11+
3.9
12+
3.8
1313
type
1414
docs
15-
pkg_meta
15+
readme
1616
skip_missing_interpreters = true
1717

1818
[testenv]
19-
description = run the tests with pytest under {envname}
19+
description = run the tests with pytest under {env_name}
2020
package = wheel
2121
wheel_build_env = .pkg
2222
extras =
2323
testing
2424
pass_env =
2525
PYTEST_*
26-
SSL_CERT_FILE
2726
set_env =
28-
COVERAGE_FILE = {env:COVERAGE_FILE:{toxworkdir}{/}.coverage.{envname}}
27+
COVERAGE_FILE = {env:COVERAGE_FILE:{work_dir}{/}.coverage.{env_name}}
2928
commands =
3029
pytest {tty:--color=yes} {posargs: --no-cov-on-fail --cov-context=test \
31-
--cov={envsitepackagesdir}{/}pyproject_api --cov={toxinidir}{/}tests --cov-config={toxinidir}{/}pyproject.toml \
32-
--cov-report=term-missing:skip-covered --cov-report=html:{envtmpdir}{/}htmlcov \
33-
--cov-report=xml:{toxworkdir}{/}coverage.{envname}.xml --junitxml={toxworkdir}{/}junit.{envname}.xml \
30+
--cov={env_site_packages_dir}{/}pyproject_api --cov={tox_root}{/}tests --cov-config={tox_root}{/}pyproject.toml \
31+
--cov-report=term-missing:skip-covered --cov-report=html:{env_tmp_dir}{/}htmlcov \
32+
--cov-report=xml:{work_dir}{/}coverage.{env_name}.xml --junitxml={work_dir}{/}junit.{env_name}.xml \
3433
tests}
3534
labels = test
3635

3736
[testenv:fix]
3837
description = run formatter and linters
3938
skip_install = true
4039
deps =
41-
pre-commit>=3.7.1
42-
pass_env =
43-
{[testenv]passenv}
44-
PROGRAMDATA
40+
pre-commit-uv>=4.1.1
4541
commands =
4642
pre-commit run --all-files --show-diff-on-failure {tty:--color=always} {posargs}
4743

4844
[testenv:type]
4945
description = run type check on code base
5046
deps =
51-
mypy==1.10
47+
mypy==1.11.2
5248
set_env =
5349
{tty:MYPY_FORCE_COLOR = 1}
5450
commands =
@@ -60,20 +56,20 @@ description = build documentation
6056
extras =
6157
docs
6258
commands =
63-
sphinx-build -d "{envtmpdir}{/}doctree" docs "{toxworkdir}{/}docs_out" --color -b html {posargs} -W
64-
python -c 'print(r"documentation available under file://{toxworkdir}{/}docs_out{/}index.html")'
59+
sphinx-build -d "{env_tmp_dir}{/}doc_tree" docs "{work_dir}{/}docs_out" --color -b html {posargs} -W
60+
python -c 'print(r"documentation available under file://{work_dir}{/}docs_out{/}index.html")'
6561

66-
[testenv:pkg_meta]
62+
[testenv:readme]
6763
description = check that the long description is valid
6864
skip_install = true
6965
deps =
70-
build[virtualenv]>=1.2.1
7166
check-wheel-contents>=0.6
72-
twine>=5.1
67+
twine>=5.1.1
68+
uv>=0.4.10
7369
commands =
74-
python -m build -o {envtmpdir} -s -w .
75-
twine check --strict {envtmpdir}{/}*
76-
check-wheel-contents --no-config {envtmpdir}
70+
uv build --sdist --wheel --out-dir {env_tmp_dir} .
71+
twine check {env_tmp_dir}{/}*
72+
check-wheel-contents --no-config {env_tmp_dir}
7773

7874
[testenv:dev]
7975
description = dev environment with all deps at {envdir}
@@ -82,6 +78,5 @@ extras =
8278
docs
8379
testing
8480
commands =
85-
python -m pip list --format=columns
86-
python -c "print(r'{envpython}')"
87-
uv_seed = true
81+
uv pip tree
82+
python -c "print(r'{env_python}')"

0 commit comments

Comments
 (0)