Compare commits

...
Sign in to create a new pull request.

4 commits

Author SHA1 Message Date
Fedora Release Engineering
3addeaf57b Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild 2026-07-16 22:18:54 +00:00
Python Maint
295e9bbff1 Rebuilt for Python 3.15 2026-06-03 23:37:27 +02:00
Miro Hrončok
d827461ac7 Update to 4.53.1
- Requires packaging >= 26 and virtualenv >= 21.1
- Adds manual page
- Adds optional shell completion (tox+completion package), installed by default
- Fixes: rhbz#2440111
2026-05-05 18:09:40 +02:00
Miro Hrončok
b45d746d3e Adjust for virtualenv 21 API changes 2026-03-06 17:01:58 +01:00
3 changed files with 45 additions and 47 deletions

View file

@ -1,4 +1,4 @@
From 42a461b71597e85e7902571348786aa4ab848cf8 Mon Sep 17 00:00:00 2001
From 49a830fa59f9cbc58920b5052f47089cff2685e7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= <thrnciar@redhat.com>
Date: Fri, 28 Mar 2025 09:44:24 +0100
Subject: [PATCH] Fix tests
@ -9,28 +9,28 @@ Content-Transfer-Encoding: 8bit
Co-Authored-By: Lumir Balhar <lbalhar@redhat.com>
Co-Authored-By: Miro Hrončok <miro@hroncok.cz>
---
pyproject.toml | 4 +---
pyproject.toml | 3 ---
src/tox/pytest.py | 14 ++------------
tests/test_provision.py | 11 ++++-------
.../package/test_python_package_util.py | 10 ++++++++--
4 files changed, 15 insertions(+), 30 deletions(-)
4 files changed, 14 insertions(+), 24 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index 6920d19..53326bc 100644
index c9ca99c..3a74d6f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -222,9 +217,6 @@ report.omit = [
"tests/type_check/*",
]
@@ -239,9 +239,6 @@ ini_options.timeout = 30
[tool.coverage]
run.parallel = true
-run.plugins = [
- "covdefaults",
-]
[tool.towncrier]
name = "tox"
paths.source = [
"src",
".tox*/*/lib/python*/site-packages",
diff --git a/src/tox/pytest.py b/src/tox/pytest.py
index 31b3e6f..c358313 100644
index 36aa2f6..7693523 100644
--- a/src/tox/pytest.py
+++ b/src/tox/pytest.py
@@ -17,7 +17,6 @@ from typing import TYPE_CHECKING, Any, Protocol, cast
@ -52,7 +52,7 @@ index 31b3e6f..c358313 100644
try:
tox_run(args)
except SystemExit as exception:
@@ -479,15 +478,6 @@ def enable_pypi_server(monkeypatch: pytest.MonkeyPatch, url: str | None) -> None
@@ -480,15 +479,6 @@ def enable_pypi_server(monkeypatch: pytest.MonkeyPatch, url: str | None) -> None
monkeypatch.setenv("PIP_TIMEOUT", str(2))
@ -69,10 +69,10 @@ index 31b3e6f..c358313 100644
def _invalid_index_fake_port() -> int:
with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as socket_handler:
diff --git a/tests/test_provision.py b/tests/test_provision.py
index d1b6b2d..022e340 100644
index 74c27b9..12c99be 100644
--- a/tests/test_provision.py
+++ b/tests/test_provision.py
@@ -126,15 +126,13 @@ def _use_pypi_index(pypi_index: Index, monkeypatch: MonkeyPatch) -> None:
@@ -127,15 +127,13 @@ def _use_pypi_index(pypi_index: Index, monkeypatch: MonkeyPatch) -> None:
@pytest.fixture
@ -92,7 +92,7 @@ index d1b6b2d..022e340 100644
def test_provision_requires_nok(tox_project: ToxProjectCreator) -> None:
@@ -183,7 +181,6 @@ def test_provision_requires_ok(tox_project: ToxProjectCreator, tmp_path: Path) -
@@ -213,7 +211,6 @@ def test_provision_requires_ok(tox_project: ToxProjectCreator, tmp_path: Path) -
@pytest.mark.integration
@ -101,10 +101,10 @@ index d1b6b2d..022e340 100644
ini = "[tox]\nrequires=demo-pkg-inline\n[testenv]\npackage=skip\n[testenv:.tox]\nplatform=wrong_platform"
proj = tox_project({"tox.ini": ini})
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 3802147..7f64d90 100644
index 4c834ce..74b04f5 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
@@ -15,6 +15,12 @@ if TYPE_CHECKING:
@@ -16,6 +16,12 @@ if TYPE_CHECKING:
from importlib.metadata import Distribution, PathDistribution
@ -117,7 +117,7 @@ index 3802147..7f64d90 100644
@pytest.fixture(scope="session")
def pkg_with_extras(pkg_with_extras_project: Path) -> PathDistribution:
@@ -43,10 +49,10 @@ def test_load_dependency_many_extra(pkg_with_extras: PathDistribution) -> None:
@@ -44,10 +50,10 @@ def test_load_dependency_many_extra(pkg_with_extras: PathDistribution) -> None:
exp = [
Requirement("platformdirs>=4.3.8"),
Requirement("colorama>=0.4.6"),
@ -131,5 +131,5 @@ index 3802147..7f64d90 100644
for left, right in zip_longest(result, exp):
assert isinstance(right, Requirement)
--
2.51.1
2.54.0

View file

@ -20,7 +20,7 @@
%undefine _py3_shebang_s
Name: python-tox
Version: 4.35.0
Version: 4.53.1
Release: %autorelease
Summary: Virtualenv-based automation of test activities
@ -43,6 +43,7 @@ BuildRequires: pyproject-rpm-macros >= 1.16
%if %{with tests}
BuildRequires: /usr/bin/gcc
BuildRequires: /usr/bin/git
BuildRequires: /usr/bin/man
BuildRequires: /usr/bin/pip
BuildRequires: /usr/bin/pytest
BuildRequires: /usr/bin/python
@ -87,6 +88,9 @@ Recommends: python3.9
# Instead of adding new Pythons here, add `Supplements: tox` to them, see:
# https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org/thread/NVVUXSVSPFQOWIGBE2JNI67HEO7R63ZQ/
# Enable completions by default
Recommends: (tox+completion if (bash-completion or fish or zsh))
%py_provides python3-tox
%description -n tox %_description
@ -100,8 +104,7 @@ Recommends: python3.9
# First, carefully adjust the pins of build and runtime dependencies,
# then remove all the >= specifiers from tests deps, whatever they are,
# finally, remove undesired test dependencies.
sed -ri -e 's/"(packaging|filelock|platformdirs|pyproject-api|cachetools|hatch-vcs)>=.*/"\1",/g' \
-e 's/"(virtualenv)>=.*/"\1>=20.29",/g' \
sed -ri -e 's/"(filelock|platformdirs|pyproject-api|cachetools|hatch-vcs)>=.*/"\1",/g' \
-e 's/"(hatchling)>=.*/"\1>=1.13",/g' \
-e 's/"(pluggy)>=.*/"\1>=1.5",/g' \
-e '/^test = \[/,/^\]/ { s/>=[^;"]+// }' \
@ -110,7 +113,7 @@ sed -ri -e 's/"(packaging|filelock|platformdirs|pyproject-api|cachetools|hatch-v
%generate_buildrequires
export SETUPTOOLS_SCM_PRETEND_VERSION="%{version}"
%pyproject_buildrequires -r %{?with_tests:-g test}
%pyproject_buildrequires -r %{?with_tests:-g test} -x completion
%build
@ -122,18 +125,21 @@ export SETUPTOOLS_SCM_PRETEND_VERSION="%{version}"
%pyproject_install
%pyproject_save_files tox
for shell in bash fish zsh; do
register-python-argcomplete --shell $shell tox > tox.$shell
done
# The bash-completion package has tox already, we use the .bash suffix,
# see https://github.com/scop/bash-completion/issues/1628#issuecomment-4380971779
install -Dpm 0644 tox.bash %{buildroot}%{bash_completions_dir}/tox.bash
install -Dpm 0644 tox.fish %{buildroot}%{fish_completions_dir}/tox.fish
install -Dpm 0644 tox.zsh %{buildroot}%{zsh_completions_dir}/_tox
%if %{with tests}
%check
# A macro that returns a version of the installed Python package, as an RPM v-string, defaults to v"0"
%define pyversion() v"%(%{python3} -c 'import importlib.metadata as im; print(im.version("%{1}"))' 2>/dev/null || echo 0)"
# Upstream requires virtualenv >= 20.31 for tests, and no longer sets VIRTUALENV_WHEEL.
# To support environments with older virtualenv, we set it manually:
%if %{pyversion virtualenv} < v"20.31"
export VIRTUALENV_WHEEL=bundle
%endif
# Skipped tests use internal virtualenv functionality to
# download wheels which does not work with "bundled" version of wheel in
# the Fedora's virtualenv patch.
@ -141,11 +147,6 @@ k="${k-}${k+ and }not test_virtualenv_flipped_settings"
k="${k-}${k+ and }not test_virtualenv_env_ignored_if_set"
k="${k-}${k+ and }not test_virtualenv_env_used_if_not_set"
# https://github.com/tox-dev/tox/issues/3290
%if v"0%{?python3_version}" >= v"3.13"
k="${k-}${k+ and }not test_str_convert_ok_py39"
%endif
# https://github.com/tox-dev/tox/commit/698f1dd663
# The tests fail with setuptools < 70.1
%if %{pyversion setuptools} < v"70.1"
@ -153,17 +154,6 @@ k="${k-}${k+ and }not test_result_json_sequential"
k="${k-}${k+ and }not test_setuptools_package"
k="${k-}${k+ and }not test_skip_develop_mode"
k="${k-}${k+ and }not test_tox_install_pkg_sdist"
%else
# this test fails with virtualenv < 20.31 with bundled wheel
test -z $VIRTUALENV_WHEEL || k="${k-}${k+ and }not test_result_json_sequential"
%endif
# Skip tests only working with packaging 26+
# Adjusted upstream in https://github.com/tox-dev/tox/pull/3673
%if %{pyversion packaging} < v"26"
k="${k-}${k+ and }not (test_req_file and name-extra-protocol)"
k="${k-}${k+ and }not (test_req_file and whitespace and around)"
k="${k-}${k+ and }not test_dependency_groups_bad_requirement"
%endif
# The following tests either need internet connection or installed tox
@ -175,7 +165,9 @@ k="${k-}${k+ and }not test_call_as_module"
k="${k-}${k+ and }not test_call_as_exe"
k="${k-}${k+ and }not test_run_installpkg_targz"
k="${k-}${k+ and }not test_pyproject_installpkg_pep517_envs"
test -z $VIRTUALENV_WHEEL && k="${k-}${k+ and }not test_result_json_sequential"
k="${k-}${k+ and }not test_pylock_install_integration"
k="${k-}${k+ and }not test_interrupt_post_commands"
k="${k-}${k+ and }not test_second_interrupt_stops_post_commands"
%endif
%pytest -v -n auto -k "${k-}" --run-integration
@ -184,6 +176,12 @@ test -z $VIRTUALENV_WHEEL && k="${k-}${k+ and }not test_result_json_sequential"
%files -n tox -f %{pyproject_files}
%{_bindir}/tox
%{_mandir}/man1/tox.1*
%pyproject_extras_subpkg -n tox completion
%{bash_completions_dir}/tox.bash
%{fish_completions_dir}/tox.fish
%{zsh_completions_dir}/_tox
%changelog

View file

@ -1 +1 @@
SHA512 (tox-4.35.0.tar.gz) = 13134511a53b1ba794f6821886655e2421ef0d668238d65779dc10a13bab23e5711f11aefdb99c7723c78f3558032df5cb78c5fe2c90e66b067f9ce325a60225
SHA512 (tox-4.53.1.tar.gz) = b11df73e47c5c63124b9e7e11c44a8c3c39b40d177b411bcbd4218a9875fd658a32712083102ef2a1cae6e75939cd32f7caa00551de753f30f58f7f52ab4e5dd