Skip to content

Commit

Permalink
Require python 3.9 and support 3.13 (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored Nov 18, 2024
1 parent c3f1d49 commit f3fc277
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 28 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,18 @@ jobs:
id: generate_matrix
uses: coactions/dynamic-matrix@v4
with:
min_python: "3.8"
min_python: "3.9"
max_python: "3.13"
default_python: "3.10"
other_names: |
lint
pkg
py38:tox -e py38
py39:tox -e py39
py310:tox -e py310; tox -e py310-devel
py311:tox -e py311; tox -e py311-devel
py312:tox -e py312; tox -e py312-devel
py313:tox -e py313-devel
py312-macos:tox -e py312; tox -e py312-devel
py313:tox -e py312; tox -e py313-devel
py313-macos:tox -e py313; tox -e py313-devel
platforms: linux,macos
skip_explode: "1"

Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ repos:
- gitpython
- packaging
- py>=1.9.0
- tox>=4.23.2
- repo: https://github.com/pre-commit/mirrors-pylint
rev: v3.0.0a5
hooks:
Expand Down
Empty file added bindep.txt
Empty file.
14 changes: 0 additions & 14 deletions mypy.ini

This file was deleted.

15 changes: 13 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"

[project]
# https://peps.python.org/pep-0621/#readme
requires-python = ">=3.8"
requires-python = ">=3.9"
dynamic = ["version"]
name = "tox-extra"
description = "Performs extra checks before or after running"
Expand All @@ -26,11 +26,11 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Testing"
]
keywords = ["git", "tox", "tox-plugin"]
Expand Down Expand Up @@ -74,5 +74,16 @@ parallel = true
[tool.isort]
profile = "black"

[tool.mypy]
python_version = 3.9
color_output = true
error_summary = true
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_any_generics = true

[tool.pytest.ini_options]
addopts = "-ra --showlocals"

[tool.setuptools_scm]
local_scheme = "no-local-version"
19 changes: 11 additions & 8 deletions src/tox_extra/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from tox.plugin import impl
from tox.tox_env.api import ToxEnv
from tox.tox_env.errors import Fail
from tox.tox_env.python.api import Python

from tox_extra.bindep import check_bindep

Expand Down Expand Up @@ -58,17 +59,19 @@ def tox_add_option(parser: ArgumentParser) -> None:
# pylint: disable=unused-argument
def tox_on_install(tox_env: ToxEnv, arguments: Any, section: str, of_type: str) -> None:
"""Runs just before installing package."""
profiles = frozenset(
[
if os.environ.get("TOX_EXTRA_BINDEP", "1") != "0":
profiles = {
"test",
f"python{tox_env.py_dot_ver()}", # python3.12 like profile
f"py{tox_env.py_dot_ver().replace('.', '')}", # py312 like profile
tox_env.name, # exact tox env name, useful for stuff like 'docs' or 'lint'
*tox_env.name.split("-"),
]
)
if os.environ.get("TOX_EXTRA_BINDEP", "1") != "0":
check_bindep(path=pathlib.Path.cwd(), profiles=profiles)
}
if isinstance(tox_env, Python):
profiles.add(f"python{tox_env.py_dot_ver()}") # python3.12 like profile
profiles.add(
f"py{tox_env.py_dot_ver().replace('.', '')}"
) # py312 like profile # type: ignore

check_bindep(path=pathlib.Path.cwd(), profiles=frozenset(profiles))


@impl
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ usedevelop = false
skip_install = true
deps =
build >= 0.9.0
pip
twine >= 4.0.1
setenv =
commands =
Expand Down

0 comments on commit f3fc277

Please sign in to comment.