Skip to content

Commit bca6b6f

Browse files
committed
Require python 3.9 and support 3.13
1 parent c3f1d49 commit bca6b6f

File tree

7 files changed

+29
-28
lines changed

7 files changed

+29
-28
lines changed

Diff for: .github/workflows/tox.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,18 @@ jobs:
3535
id: generate_matrix
3636
uses: coactions/dynamic-matrix@v4
3737
with:
38-
min_python: "3.8"
38+
min_python: "3.9"
3939
max_python: "3.13"
4040
default_python: "3.10"
4141
other_names: |
4242
lint
4343
pkg
44-
py38:tox -e py38
4544
py39:tox -e py39
4645
py310:tox -e py310; tox -e py310-devel
4746
py311:tox -e py311; tox -e py311-devel
4847
py312:tox -e py312; tox -e py312-devel
49-
py313:tox -e py313-devel
50-
py312-macos:tox -e py312; tox -e py312-devel
48+
py313:tox -e py312; tox -e py313-devel
49+
py313-macos:tox -e py313; tox -e py313-devel
5150
platforms: linux,macos
5251
skip_explode: "1"
5352

Diff for: .pre-commit-config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ repos:
5353
- gitpython
5454
- packaging
5555
- py>=1.9.0
56+
- tox>=4.23.2
5657
- repo: https://github.com/pre-commit/mirrors-pylint
5758
rev: v3.0.0a5
5859
hooks:

Diff for: bindep.txt

Whitespace-only changes.

Diff for: mypy.ini

-14
This file was deleted.

Diff for: pyproject.toml

+13-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
77

88
[project]
99
# https://peps.python.org/pep-0621/#readme
10-
requires-python = ">=3.8"
10+
requires-python = ">=3.9"
1111
dynamic = ["version"]
1212
name = "tox-extra"
1313
description = "Performs extra checks before or after running"
@@ -26,11 +26,11 @@ classifiers = [
2626
"License :: OSI Approved :: MIT License",
2727
"Programming Language :: Python",
2828
"Programming Language :: Python :: 3",
29-
"Programming Language :: Python :: 3.8",
3029
"Programming Language :: Python :: 3.9",
3130
"Programming Language :: Python :: 3.10",
3231
"Programming Language :: Python :: 3.11",
3332
"Programming Language :: Python :: 3.12",
33+
"Programming Language :: Python :: 3.13",
3434
"Topic :: Software Development :: Testing"
3535
]
3636
keywords = ["git", "tox", "tox-plugin"]
@@ -74,5 +74,16 @@ parallel = true
7474
[tool.isort]
7575
profile = "black"
7676

77+
[tool.mypy]
78+
python_version = 3.9
79+
color_output = true
80+
error_summary = true
81+
disallow_untyped_calls = true
82+
disallow_untyped_defs = true
83+
disallow_any_generics = true
84+
85+
[tool.pytest.ini_options]
86+
addopts = "-ra --showlocals"
87+
7788
[tool.setuptools_scm]
7889
local_scheme = "no-local-version"

Diff for: src/tox_extra/hooks.py

+11-8
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from tox.plugin import impl
1414
from tox.tox_env.api import ToxEnv
1515
from tox.tox_env.errors import Fail
16+
from tox.tox_env.python.api import Python
1617

1718
from tox_extra.bindep import check_bindep
1819

@@ -58,17 +59,19 @@ def tox_add_option(parser: ArgumentParser) -> None:
5859
# pylint: disable=unused-argument
5960
def tox_on_install(tox_env: ToxEnv, arguments: Any, section: str, of_type: str) -> None:
6061
"""Runs just before installing package."""
61-
profiles = frozenset(
62-
[
62+
if os.environ.get("TOX_EXTRA_BINDEP", "1") != "0":
63+
profiles = {
6364
"test",
64-
f"python{tox_env.py_dot_ver()}", # python3.12 like profile
65-
f"py{tox_env.py_dot_ver().replace('.', '')}", # py312 like profile
6665
tox_env.name, # exact tox env name, useful for stuff like 'docs' or 'lint'
6766
*tox_env.name.split("-"),
68-
]
69-
)
70-
if os.environ.get("TOX_EXTRA_BINDEP", "1") != "0":
71-
check_bindep(path=pathlib.Path.cwd(), profiles=profiles)
67+
}
68+
if isinstance(tox_env, Python):
69+
profiles.add(f"python{tox_env.py_dot_ver()}") # python3.12 like profile
70+
profiles.add(
71+
f"py{tox_env.py_dot_ver().replace('.', '')}"
72+
) # py312 like profile # type: ignore
73+
74+
check_bindep(path=pathlib.Path.cwd(), profiles=frozenset(profiles))
7275

7376

7477
@impl

Diff for: tox.ini

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ usedevelop = false
5151
skip_install = true
5252
deps =
5353
build >= 0.9.0
54+
pip
5455
twine >= 4.0.1
5556
setenv =
5657
commands =

0 commit comments

Comments
 (0)