Skip to content

Commit 9c6f835

Browse files
authored
Add 3.13 to CI and bump deps (#3339)
1 parent 9138e15 commit 9c6f835

File tree

7 files changed

+52
-47
lines changed

7 files changed

+52
-47
lines changed

.github/workflows/check.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
py:
23+
- "3.13"
2324
- "3.12"
2425
- "3.11"
2526
- "3.10"
@@ -43,6 +44,7 @@ jobs:
4344
uses: actions/setup-python@v5
4445
with:
4546
python-version: ${{ matrix.py }}
47+
allow-prereleases: true
4648
- name: Pick environment to run
4749
run: |
4850
import os; import platform; import sys; from pathlib import Path
@@ -52,7 +54,7 @@ jobs:
5254
file_handler.write(env)
5355
shell: python
5456
- name: Setup test suite
55-
run: tox r -vv --notest
57+
run: tox r -vv --notest --skip-missing-interpreters false
5658
- name: Run test suite
5759
run: tox r --skip-pkg-install
5860
env:
@@ -87,7 +89,7 @@ jobs:
8789
python-version: "3.12"
8890
- name: Install self-tox
8991
run: python -m pip install .
92+
- name: Setup check suite
93+
run: tox r -vv --notest --skip-missing-interpreters false -e ${{ matrix.tox_env }}
9094
- name: Run check for ${{ matrix.tox_env }}
91-
run: tox r -e ${{ matrix.tox_env }}
92-
env:
93-
UPGRADE_ADVISORY: "yes"
95+
run: tox r --skip-pkg-install -e ${{ matrix.tox_env }}

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ jobs:
1515
with:
1616
python-version: "3.12"
1717
- name: Install build
18-
run: python -m pip install build
18+
run: python -m pip install build[uv]
1919
- uses: actions/checkout@v4
2020
with:
2121
fetch-depth: 0
2222
- name: Build package
23-
run: pyproject-build
23+
run: pyproject-build --installer uv
2424
- name: Store the distribution packages
2525
uses: actions/upload-artifact@v4
2626
with:

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ 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.1"
18+
rev: "1.3.2"
1919
hooks:
2020
- id: tox-ini-fmt
2121
args: ["-p", "fix"]
@@ -24,7 +24,7 @@ repos:
2424
hooks:
2525
- id: pyproject-fmt
2626
- repo: https://github.com/astral-sh/ruff-pre-commit
27-
rev: "v0.6.3"
27+
rev: "v0.6.4"
2828
hooks:
2929
- id: ruff-format
3030
- id: ruff

pyproject.toml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ dynamic = [
5050
"version",
5151
]
5252
dependencies = [
53-
"cachetools>=5.4",
53+
"cachetools>=5.5",
5454
"chardet>=5.2",
5555
"colorama>=0.4.6",
5656
"filelock>=3.15.4",
@@ -62,17 +62,17 @@ dependencies = [
6262
"virtualenv>=20.26.3",
6363
]
6464
optional-dependencies.docs = [
65-
"furo>=2024.7.18",
66-
"sphinx>=7.4.7",
67-
"sphinx-argparse-cli>=1.16",
68-
"sphinx-autodoc-typehints>=2.2.3",
65+
"furo>=2024.8.6",
66+
"sphinx>=8.0.2",
67+
"sphinx-argparse-cli>=1.17",
68+
"sphinx-autodoc-typehints>=2.4",
6969
"sphinx-copybutton>=0.5.2",
7070
"sphinx-inline-tabs>=2023.4.21",
7171
"sphinxcontrib-towncrier>=0.2.1a0",
72-
"towncrier>=23.11",
72+
"towncrier>=24.8",
7373
]
7474
optional-dependencies.testing = [
75-
"build[virtualenv]>=1.2.1",
75+
"build[virtualenv]>=1.2.2",
7676
"covdefaults>=2.3",
7777
"detect-test-pollution>=1.2",
7878
"devpi-process>=1",
@@ -87,9 +87,9 @@ optional-dependencies.testing = [
8787
"pytest-mock>=3.14",
8888
"pytest-xdist>=3.6.1",
8989
"re-assert>=1.1",
90-
"setuptools>=70.3",
91-
"time-machine>=2.14.2; implementation_name!='pypy'",
92-
"wheel>=0.43",
90+
"setuptools>=74.1.2",
91+
"time-machine>=2.15; implementation_name!='pypy'",
92+
"wheel>=0.44",
9393
]
9494
urls.Documentation = "https://tox.wiki"
9595
urls.Homepage = "http://tox.readthedocs.org"
@@ -141,10 +141,10 @@ lint.ignore = [
141141
]
142142
lint.per-file-ignores."tests/**/*.py" = [
143143
"D", # don't care about documentation in tests
144-
"FBT", # don"t care about booleans as positional arguments in tests
144+
"FBT", # don't care about booleans as positional arguments in tests
145145
"INP001", # no implicit namespace
146146
"PLR2004", # Magic value used in comparison, consider replacing with a constant variable
147-
"S101", # asserts allowed in tests...
147+
"S101", # asserts allowed in tests
148148
"S603", # `subprocess` call: check for execution of untrusted input
149149
]
150150
lint.isort = { known-first-party = [

src/tox/config/loader/convert.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import typing
44
from abc import ABC, abstractmethod
55
from collections import OrderedDict
6+
from inspect import isclass
67
from pathlib import Path
78
from typing import Any, Callable, Dict, Generic, Iterator, List, Literal, Optional, Set, TypeVar, Union, cast
89

@@ -18,7 +19,7 @@
1819
class Convert(ABC, Generic[T]):
1920
"""A class that converts a raw type to a given tox (python) type."""
2021

21-
def to(self, raw: T, of_type: type[V], factory: Factory[V]) -> V: # noqa: PLR0911
22+
def to(self, raw: T, of_type: type[V], factory: Factory[V]) -> V: # noqa: PLR0911, C901
2223
"""
2324
Convert given raw type to python type.
2425
@@ -30,26 +31,26 @@ def to(self, raw: T, of_type: type[V], factory: Factory[V]) -> V: # noqa: PLR09
3031
from_module = getattr(of_type, "__module__", None)
3132
if from_module in {"typing", "typing_extensions"}:
3233
return self._to_typing(raw, of_type, factory)
33-
if issubclass(of_type, Path):
34-
return self.to_path(raw) # type: ignore[return-value]
35-
if issubclass(of_type, bool):
36-
return self.to_bool(raw) # type: ignore[return-value]
37-
if issubclass(of_type, Command):
38-
return self.to_command(raw) # type: ignore[return-value]
39-
if issubclass(of_type, EnvList):
40-
return self.to_env_list(raw) # type: ignore[return-value]
41-
if issubclass(of_type, str):
42-
return self.to_str(raw) # type: ignore[return-value]
43-
# python does not allow use of parametrized generics with isinstance,
44-
# so we need to check for them.
34+
if isclass(of_type):
35+
if issubclass(of_type, Path):
36+
return self.to_path(raw) # type: ignore[return-value]
37+
if issubclass(of_type, bool):
38+
return self.to_bool(raw) # type: ignore[return-value]
39+
if issubclass(of_type, Command):
40+
return self.to_command(raw) # type: ignore[return-value]
41+
if issubclass(of_type, EnvList):
42+
return self.to_env_list(raw) # type: ignore[return-value]
43+
if issubclass(of_type, str):
44+
return self.to_str(raw) # type: ignore[return-value]
45+
# python does not allow use of parametrized generics with isinstance, so we need to check for them.
4546
if hasattr(typing, "GenericAlias") and isinstance(of_type, typing.GenericAlias):
4647
return list(self.to_list(raw, of_type=of_type)) # type: ignore[return-value]
4748
if isinstance(raw, of_type): # already target type no need to transform it
4849
# do it this late to allow normalization - e.g. string strip
49-
return raw
50+
return raw # type: ignore[no-any-return]
5051
if factory:
5152
return factory(raw)
52-
return of_type(raw) # type: ignore[call-arg]
53+
return of_type(raw) # type: ignore[no-any-return]
5354

5455
def _to_typing(self, raw: T, of_type: type[V], factory: Factory[V]) -> V: # noqa: C901
5556
origin = getattr(of_type, "__origin__", of_type.__class__)

src/tox/config/loader/str_convert.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import shlex
66
import sys
7+
from inspect import isclass
78
from itertools import chain
89
from pathlib import Path
910
from typing import TYPE_CHECKING, Any, Iterator
@@ -28,7 +29,7 @@ def to_path(value: str) -> Path:
2829

2930
@staticmethod
3031
def to_list(value: str, of_type: type[Any]) -> Iterator[str]:
31-
splitter = "\n" if issubclass(of_type, Command) or "\n" in value else ","
32+
splitter = "\n" if (isclass(of_type) and issubclass(of_type, Command)) or "\n" in value else ","
3233
splitter = splitter.replace("\r", "")
3334
for token in value.split(splitter):
3435
value = token.strip()

tox.ini

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ requires =
33
tox>=4.2
44
env_list =
55
fix
6-
py312
7-
py311
8-
py310
9-
py39
10-
py38
116
cov
127
type
138
docs
9+
3.13
10+
3.12
11+
3.11
12+
3.10
13+
3.9
14+
3.8
1415
pkg_meta
1516
skip_missing_interpreters = true
1617

@@ -40,7 +41,7 @@ commands =
4041
description = format the code base to adhere to our styles, and complain about what we cannot do automatically
4142
skip_install = true
4243
deps =
43-
pre-commit>=3.8
44+
pre-commit-uv>=4.1
4445
pass_env =
4546
{[testenv]passenv}
4647
PROGRAMDATA
@@ -51,8 +52,8 @@ commands =
5152
[testenv:type]
5253
description = run type check on code base
5354
deps =
54-
mypy==1.11
55-
types-cachetools>=5.4.0.20240717
55+
mypy==1.11.2
56+
types-cachetools>=5.5.0.20240820
5657
types-chardet>=5.0.4.6
5758
commands =
5859
mypy src/tox
@@ -71,11 +72,11 @@ commands =
7172
description = check that the long description is valid
7273
skip_install = true
7374
deps =
74-
build[virtualenv]>=1.2.1
75+
build[uv]>=1.2.2
7576
check-wheel-contents>=0.6
7677
twine>=5.1.1
7778
commands =
78-
python -m build -o {envtmpdir} -s -w .
79+
python -m build --installer uv -o {envtmpdir} -s -w .
7980
twine check {envtmpdir}{/}*
8081
check-wheel-contents --no-config {envtmpdir}
8182

@@ -85,7 +86,7 @@ skip_install = true
8586
deps =
8687
gitpython>=3.1.43
8788
packaging>=24.1
88-
towncrier>=23.11
89+
towncrier>=24.8
8990
commands =
9091
python {toxinidir}/tasks/release.py --version {posargs}
9192

0 commit comments

Comments
 (0)