Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the CI after setuptools 75.6 change #3452

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
33 changes: 17 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
build-backend = "hatchling.build"
requires = [
"hatch-vcs>=0.4",
"hatchling>=1.25",
"hatchling>=1.26.3",
]

[project]
Expand Down Expand Up @@ -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",
Expand All @@ -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",
]

Expand Down
11 changes: 9 additions & 2 deletions src/tox/execute/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/tox/session/cmd/run/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/execute/local_subprocess/test_local_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tox.toml
Original file line number Diff line number Diff line change
@@ -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

Expand Down