diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d3737dbcd..891ef8fd9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ repos: rev: v2.3.0 hooks: - id: codespell - additional_dependencies: ["tomli>=2.0.1"] + additional_dependencies: ["tomli>=2.1"] - repo: https://github.com/tox-dev/pyproject-fmt rev: "v2.5.0" hooks: @@ -32,7 +32,7 @@ repos: rev: 1.19.1 hooks: - id: blacken-docs - additional_dependencies: [black==24.8] + additional_dependencies: [black==24.10] - repo: https://github.com/pre-commit/pygrep-hooks rev: v1.10.0 hooks: diff --git a/pyproject.toml b/pyproject.toml index f200a6d2d..0ed140ed3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ build-backend = "hatchling.build" requires = [ "hatch-vcs>=0.4", - "hatchling>=1.25", + "hatchling>=1.26.3", ] [project] @@ -54,13 +54,13 @@ dependencies = [ "chardet>=5.2", "colorama>=0.4.6", "filelock>=3.16.1", - "packaging>=24.1", + "packaging>=24.2", "platformdirs>=4.3.6", "pluggy>=1.5", "pyproject-api>=1.8", - "tomli>=2.0.1; python_version<'3.11'", + "tomli>=2.1; python_version<'3.11'", "typing-extensions>=4.12.2; python_version<'3.11'", - "virtualenv>=20.26.6", + "virtualenv>=20.27.1", ] optional-dependencies.test = [ "devpi-process>=1.0.2", @@ -81,52 +81,53 @@ dev = [ { include-group = "type" }, ] test = [ - "build[virtualenv]>=1.2.2", + "build[virtualenv]>=1.2.2.post1", "covdefaults>=2.3", "detect-test-pollution>=1.2", "devpi-process>=1.0.2", "diff-cover>=9.2", - "distlib>=0.3.8", + "distlib>=0.3.9", "flaky>=3.8.1", "hatch-vcs>=0.4", - "hatchling>=1.25", - "psutil>=6", + "hatchling>=1.26.3", + "psutil>=6.1", "pytest>=8.3.3", "pytest-cov>=5", "pytest-mock>=3.14", "pytest-xdist>=3.6.1", "re-assert>=1.1", - "setuptools>=75.1", + "setuptools>=75.1; python_version<='3.8'", + "setuptools>=75.6; python_version>'3.8'", "time-machine>=2.15; implementation_name!='pypy'", - "wheel>=0.44", + "wheel>=0.45", ] type = [ - "mypy==1.11.2", + "mypy==1.13", "types-cachetools>=5.5.0.20240820", "types-chardet>=5.0.4.6", { include-group = "test" }, ] docs = [ "furo>=2024.8.6", - "sphinx>=8.0.2", + "sphinx>=8.1.3", "sphinx-argparse-cli>=1.18.2", - "sphinx-autodoc-typehints>=2.4.4", + "sphinx-autodoc-typehints>=2.5", "sphinx-copybutton>=0.5.2", "sphinx-inline-tabs>=2023.4.21", "sphinxcontrib-towncrier>=0.2.1a0", "towncrier>=24.8", ] fix = [ - "pre-commit-uv>=4.1.3", + "pre-commit-uv>=4.1.4", ] pkg-meta = [ "check-wheel-contents>=0.6", "twine>=5.1.1", - "uv>=0.4.17", + "uv>=0.5.3", ] release = [ "gitpython>=3.1.43", - "packaging>=24.1", + "packaging>=24.2", "towncrier>=24.8", ] diff --git a/src/tox/execute/api.py b/src/tox/execute/api.py index c6fe3c20f..5ab22609a 100644 --- a/src/tox/execute/api.py +++ b/src/tox/execute/api.py @@ -125,8 +125,15 @@ def call( try: # collector is what forwards the content from the file streams to the standard streams out, err = out_err[0].buffer, out_err[1].buffer - out_sync = SyncWrite(out.name, out if show else None) - err_sync = SyncWrite(err.name, err if show else None, Fore.RED if self._colored else None) + out_sync = SyncWrite( + out.name, + out if show else None, # type: ignore[arg-type] + ) + err_sync = SyncWrite( + err.name, + err if show else None, # type: ignore[arg-type] + Fore.RED if self._colored else None, + ) with out_sync, err_sync: instance = self.build_instance(request, self._option_class(env), out_sync, err_sync) with instance as status: diff --git a/src/tox/session/cmd/run/parallel.py b/src/tox/session/cmd/run/parallel.py index d83d72a24..71f898e90 100644 --- a/src/tox/session/cmd/run/parallel.py +++ b/src/tox/session/cmd/run/parallel.py @@ -62,7 +62,7 @@ def parallel_flags( help="run tox environments in parallel, the argument controls limit: all," " auto - cpu count, some positive number, zero is turn off", action="store", - type=parse_num_processes, # type: ignore[arg-type] # nargs confuses it + type=parse_num_processes, default=default_parallel, metavar="VAL", **({"nargs": "?"} if no_args else {}), # type: ignore[arg-type] # type checker can't unroll it diff --git a/tests/execute/local_subprocess/test_local_subprocess.py b/tests/execute/local_subprocess/test_local_subprocess.py index ef0d00d7b..2bfb542e8 100644 --- a/tests/execute/local_subprocess/test_local_subprocess.py +++ b/tests/execute/local_subprocess/test_local_subprocess.py @@ -40,8 +40,8 @@ def __init__(self) -> None: ) def read_out_err(self) -> tuple[str, str]: - out_got = self.out_err[0].buffer.getvalue().decode(self.out_err[0].encoding) # type: ignore[attr-defined] - err_got = self.out_err[1].buffer.getvalue().decode(self.out_err[1].encoding) # type: ignore[attr-defined] + out_got = self.out_err[0].buffer.getvalue().decode(self.out_err[0].encoding) + err_got = self.out_err[1].buffer.getvalue().decode(self.out_err[1].encoding) return out_got, err_got diff --git a/tests/tox_env/python/virtual_env/package/test_python_package_util.py b/tests/tox_env/python/virtual_env/package/test_python_package_util.py index 57c895711..efb5b1213 100644 --- a/tests/tox_env/python/virtual_env/package/test_python_package_util.py +++ b/tests/tox_env/python/virtual_env/package/test_python_package_util.py @@ -39,13 +39,14 @@ def test_load_dependency_many_extra(pkg_with_extras: PathDistribution) -> None: requires = pkg_with_extras.requires assert requires is not None result = dependencies_with_extras([Requirement(i) for i in requires], {"docs", "testing"}, "") + sphinx = [Requirement("sphinx>=3"), Requirement("sphinx-rtd-theme<1,>=0.4.3")] exp = [ Requirement("platformdirs>=2.1"), Requirement("colorama>=0.4.3"), - Requirement("sphinx>=3"), - Requirement("sphinx-rtd-theme<1,>=0.4.3"), + *(sphinx if sys.version_info[0:2] <= (3, 8) else []), Requirement(f'covdefaults>=1.2; python_version == "2.7" or python_version == "{py_ver}"'), Requirement(f'pytest>=5.4.1; python_version == "{py_ver}"'), + *(sphinx if sys.version_info[0:2] > (3, 8) else []), ] for left, right in zip_longest(result, exp): assert isinstance(right, Requirement) diff --git a/tox.toml b/tox.toml index 0926f565d..227381280 100644 --- a/tox.toml +++ b/tox.toml @@ -1,4 +1,4 @@ -requires = ["tox>=4.21"] +requires = ["tox>=4.23.2"] env_list = ["fix", "3.13", "3.12", "3.11", "3.10", "3.9", "3.8", "cov", "type", "docs", "pkg_meta"] skip_missing_interpreters = true