- Update to 4.23.2

- Support external tox.pytest usage via "test" extra in #3422
- Changes from 4.23.1
  - Docs: adjusting EOL Python version testing remarks in #3417
  - Fix example docs in #3421
- Changes from 4.23.0
  - replace tool.pyproject and tool.tox.pyproject with tool.tox in config… in #3411
  - Add NETRC to the default_pass_env list in #3410
- Changes from 4.22.0
  - Fix the fix environment definition in #3407
  - Expose type checking dependencies into an extra in #3404
  - Add dependency-groups support (PEP-735) in #3409
- Changes from 4.21.2
  - Update sdist rules to include tox.toml (#3389) in #3390
- Changes from 4.21.1
  - Fix TOML configuration errors in #3388
- Changes from 4.21.0
  - Update Loader docs in #3352
  - True TOML config support in #3353
- Changes from 4.20.0
  - Separate list dependencies to a separate installer class in #3347
- Changes from 4.19.0
  - Add pypy-major.minor environment name support in #3346
- Changes from 4.18.1
  - Fixup the spec string for sys.executable in #3327
  - Fix issue link in changelog in #3332
  - Properly document the tox_env_teardown hook in #3333
  - Add 3.13 to CI and bump deps in #3339
- Changes from 4.18.0
  - Fix #3278 - Boost temporary directories cleanup in tests in #3323
  - Fix absolute base python paths conflicting in #3325
  - Fix #3318 - Suppress spinner in parallel runs in CI in #3321
- Changes from 4.17.1
  - Fix user guide system overview so nodes don't overlap. in #3307
  - Table with list of default env vars per OS in #3291
  - Add GraalPy and test both GraalPy and Jython env identifiers in #3312
  - Add on platform constat to core in #3315
- Changes from 4.17.0
  - Fix user guide system overview so nodes don't overlap. in #3307
  - Table with list of default env vars per OS in #3291
  - Add GraalPy and test both GraalPy and Jython env identifiers in #3312
  - Add on platform constat to core in #3315
- Changes from 4.16.0
  - Fix two small documentation issues in #3297
  - Fix tests after new setuptools in #3299
  - Add windir to the default list of pass_env variables on Windows in #3303
- Changes from 4.15.1
  - fix skip with package = wheel in #3269
  - Fixed typo in user guide.  in #3277
  - Fix broad build privileges @ GHA release workflow in #3281
  - Allow ConfigSet.add_config to receive parameterized generics for of_type. in #3288
  - Fix section substitution with setenv in #3289
- Changes from 4.15.0
  - Remove duplicated and misleading configuration section in #3251
  - Fix dropped leading characters c from constraints' packages in #3250
  - Fix type-checking in #3260
  - Update installation.rst in #3257
  - Allow appending to deps with the command line in #3259
  - Support multiple override appends in #3261
  - Add bang to invert exit code in #3271
  - fix(parser): Fix --discover parsed incorrectly from env in #3274

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-tox?expand=0&rev=127
This commit is contained in:
Matej Cepl 2024-11-08 15:02:46 +00:00 committed by Git OBS Bridge
commit 13c8c75f90
11 changed files with 1701 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

View File

@ -0,0 +1,55 @@
From 48abffc7beea8884717bcb631f921a1b7f58bb6d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mcepl@suse.com>
Date: Mon, 25 Mar 2024 20:15:19 +0100
Subject: [PATCH 1/2] Make use of devpi_process optional
Also skip tests using the enable_pip_pypi_access_fixture, as these tests require
the devpi server and can break without it
---
src/tox/pytest.py | 6 +++++-
tests/test_provision.py | 5 ++++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/tox/pytest.py b/src/tox/pytest.py
index d734defd..f9e5ae10 100644
--- a/src/tox/pytest.py
+++ b/src/tox/pytest.py
@@ -17,7 +17,10 @@ from typing import TYPE_CHECKING, Any, Callable, Iterator, Protocol, Sequence, c
import pytest
from _pytest.fixtures import SubRequest # noqa: PLC2701
-from devpi_process import IndexServer
+try:
+ from devpi_process import IndexServer
+except ImportError:
+ IndexServer = None
from virtualenv.info import fs_supports_symlink
import tox.run
@@ -507,6 +510,7 @@ def enable_pip_pypi_access_fixture(
"""Set a fake pip index url, tests that want to use a pypi server should create and overwrite this."""
_, previous_url = disable_pip_pypi_access
enable_pypi_server(monkeypatch, previous_url)
+ pytest.skip()
return previous_url
diff --git a/tests/test_provision.py b/tests/test_provision.py
index 41eb630e..88cefb76 100644
--- a/tests/test_provision.py
+++ b/tests/test_provision.py
@@ -16,7 +16,10 @@ from filelock import FileLock
from packaging.requirements import Requirement
if TYPE_CHECKING:
- from devpi_process import Index, IndexServer
+ try:
+ from devpi_process import Index, IndexServer
+ except ImportError:
+ Index, IndexServer = None, None
from tox.pytest import MonkeyPatch, TempPathFactory, ToxProjectCreator
--
2.44.0

View File

@ -0,0 +1,39 @@
From 3ccb15d7bea97db132ed4cdea4d9ef25d18311a4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mcepl@suse.com>
Date: Mon, 25 Mar 2024 20:11:16 +0100
Subject: [PATCH 2/2] skip test which require network access
---
pyproject.toml | 3 +++
.../python/virtual_env/package/test_package_cmd_builder.py | 1 +
2 files changed, 4 insertions(+)
diff --git a/pyproject.toml b/pyproject.toml
index 5e9b104a..b81c63ad 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -147,6 +147,9 @@ count = true
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "--tb=auto -ra --showlocals --no-success-flaky-report"
+markers = [
+ "network: tests requiring network connection",
+]
[tool.coverage]
html.show_contexts = true
diff --git a/tests/tox_env/python/virtual_env/package/test_package_cmd_builder.py b/tests/tox_env/python/virtual_env/package/test_package_cmd_builder.py
index d29fe257..fb49a984 100644
--- a/tests/tox_env/python/virtual_env/package/test_package_cmd_builder.py
+++ b/tests/tox_env/python/virtual_env/package/test_package_cmd_builder.py
@@ -87,6 +87,7 @@ def test_install_pkg_via(tox_project: ToxProjectCreator, mode: str, pkg_with_ext
@pytest.mark.usefixtures("enable_pip_pypi_access")
+@pytest.mark.network
def test_build_wheel_external(tox_project: ToxProjectCreator, demo_pkg_inline: Path) -> None:
ini = """
[testenv]
--
2.44.0

10
_constraints Normal file
View File

@ -0,0 +1,10 @@
<constraints>
<hardware>
<physicalmemory>
<size unit="G">10</size>
</physicalmemory>
<disk>
<size unit="G">24</size>
</disk>
</hardware>
</constraints>

36
mark-network-tests.patch Normal file
View File

@ -0,0 +1,36 @@
From 3ccb15d7bea97db132ed4cdea4d9ef25d18311a4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mcepl@suse.com>
Date: Mon, 25 Mar 2024 20:11:16 +0100
Subject: [PATCH 2/2] skip test which require network access
---
pyproject.toml | 3 +++
.../python/virtual_env/package/test_package_cmd_builder.py | 1 +
2 files changed, 4 insertions(+)
Index: tox-4.23.2/pyproject.toml
===================================================================
--- tox-4.23.2.orig/pyproject.toml
+++ tox-4.23.2/pyproject.toml
@@ -146,6 +146,9 @@ testpaths = [
"tests",
]
addopts = "--tb=auto -ra --showlocals --no-success-flaky-report"
+markers = [
+ "network: tests requiring network connection",
+]
# Keep temporary directories only for failed or errored tests.
tmp_path_retention_policy = "failed"
Index: tox-4.23.2/tests/tox_env/python/virtual_env/package/test_package_cmd_builder.py
===================================================================
--- tox-4.23.2.orig/tests/tox_env/python/virtual_env/package/test_package_cmd_builder.py
+++ tox-4.23.2/tests/tox_env/python/virtual_env/package/test_package_cmd_builder.py
@@ -86,6 +86,7 @@ def test_install_pkg_via(tox_project: To
@pytest.mark.usefixtures("enable_pip_pypi_access")
+@pytest.mark.network
def test_build_wheel_external(tox_project: ToxProjectCreator, demo_pkg_inline: Path) -> None:
ini = """
[testenv]

View File

@ -0,0 +1,55 @@
From 48abffc7beea8884717bcb631f921a1b7f58bb6d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mcepl@suse.com>
Date: Mon, 25 Mar 2024 20:15:19 +0100
Subject: [PATCH 1/2] Make use of devpi_process optional
Also skip tests using the enable_pip_pypi_access_fixture, as these tests require
the devpi server and can break without it
---
src/tox/pytest.py | 6 +++++-
tests/test_provision.py | 5 ++++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/tox/pytest.py b/src/tox/pytest.py
index d734defd..f9e5ae10 100644
--- a/src/tox/pytest.py
+++ b/src/tox/pytest.py
@@ -17,7 +17,10 @@ from typing import TYPE_CHECKING, Any, Callable, Iterator, Protocol, Sequence, c
import pytest
from _pytest.fixtures import SubRequest # noqa: PLC2701
-from devpi_process import IndexServer
+try:
+ from devpi_process import IndexServer
+except ImportError:
+ IndexServer = None
from virtualenv.info import fs_supports_symlink
import tox.run
@@ -507,6 +510,7 @@ def enable_pip_pypi_access_fixture(
"""Set a fake pip index url, tests that want to use a pypi server should create and overwrite this."""
_, previous_url = disable_pip_pypi_access
enable_pypi_server(monkeypatch, previous_url)
+ pytest.skip()
return previous_url
diff --git a/tests/test_provision.py b/tests/test_provision.py
index 41eb630e..88cefb76 100644
--- a/tests/test_provision.py
+++ b/tests/test_provision.py
@@ -16,7 +16,10 @@ from filelock import FileLock
from packaging.requirements import Requirement
if TYPE_CHECKING:
- from devpi_process import Index, IndexServer
+ try:
+ from devpi_process import Index, IndexServer
+ except ImportError:
+ Index, IndexServer = None, None
from tox.pytest import MonkeyPatch, TempPathFactory, ToxProjectCreator
--
2.44.0

1296
python-tox.changes Normal file

File diff suppressed because it is too large Load Diff

180
python-tox.spec Normal file
View File

@ -0,0 +1,180 @@
#
# spec file for package python-tox
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?sle15_python_module_pythons}
%if %{defined sle15_python_module_pythons}
%bcond_without devpi_process
%else
%bcond_with devpi_process
%endif
Name: python-tox
Version: 4.23.2
Release: 0
Summary: Virtualenv-based automation of test activities
License: MIT
URL: https://github.com/tox-dev/tox
Source: https://files.pythonhosted.org/packages/source/t/tox/tox-%{version}.tar.gz
# PATCH-FIX-OPENSUSE optional_devpi_process.patch mcepl@suse.com
# Make use devpi_process optional
Patch0: optional_devpi_process.patch
# PATCH-FEATURE-UPSTREAM mark-network-tests.patch mcepl@suse.com
# to skip test which require network access
Patch1: mark-network-tests.patch
BuildRequires: %{python_module base >= 3.8}
BuildRequires: %{python_module build >= 0.10.0}
BuildRequires: %{python_module cachetools >= 5.3.2}
BuildRequires: %{python_module chardet >= 5.2}
BuildRequires: %{python_module colorama >= 0.4.6}
BuildRequires: %{python_module filelock >= 3.13.1}
BuildRequires: %{python_module hatch >= 0.3}
BuildRequires: %{python_module hatch_vcs >= 0.4}
BuildRequires: %{python_module hatchling >= 1.21}
BuildRequires: %{python_module packaging >= 23.2}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module platformdirs >= 4.1}
BuildRequires: %{python_module pluggy >= 1.3}
BuildRequires: %{python_module poetry-core}
BuildRequires: %{python_module pyproject-api >= 1.6.1}
BuildRequires: %{python_module pytoml >= 0.1}
BuildRequires: %{python_module re-assert}
BuildRequires: %{python_module setuptools >= 41.0.1}
BuildRequires: %{python_module setuptools_scm >= 2.0.0}
BuildRequires: %{python_module time-machine >= 2.13}
BuildRequires: %{python_module tomli >= 2.0.1}
BuildRequires: %{python_module virtualenv >= 20.24.3}
BuildRequires: %{python_module wheel >= 0.42}
%if %{with devpi_process}
BuildRequires: %{python_module devpi-process > 1}
%endif
BuildRequires: %{python_module importlib-metadata >= 6.8}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: unzip
Requires: python-cachetools >= 5.3.2
Requires: python-chardet >= 5.2
Requires: python-colorama >= 0.4.6
Requires: python-filelock >= 3.13.1
Requires: python-packaging >= 23.2
Requires: python-platformdirs >= 4.1
Requires: python-pluggy >= 1.3
Requires: python-pyproject-api >= 1.6.1
Requires: python-virtualenv >= 20.24.3
Requires: (python-importlib-metadata >= 0.12 if python-base < 3.8)
Requires: (python-tomli >= 2.0.1 if python-base < 3.11)
Requires(post): update-alternatives
Requires(postun):update-alternatives
# last detox version is 0.19
Obsoletes: python-detox <= 0.19
Provides: python-detox > 0.19
BuildArch: noarch
# SECTION setup.cfg [options.extras_requires] testing=
# (except for pytest-cov and -randomly)
BuildRequires: %{python_module flaky >= 3.7.0}
BuildRequires: %{python_module freezegun >= 0.3.11}
BuildRequires: %{python_module numpy >= 1.25}
BuildRequires: %{python_module psutil >= 5.9.5}
BuildRequires: %{python_module pytest >= 7.4.4}
BuildRequires: %{python_module pytest-cov >= 4.1}
BuildRequires: %{python_module pytest-mock >= 3.12}
BuildRequires: %{python_module pytest-xdist >= 3.3.1}
# /SECTION
%if "%{python_flavor}" == "python3" || "%{?python_provides}" == "python3"
Provides: tox = %{version}
%endif
%python_subpackages
%description
Tox as is a generic virtualenv management and test command line tool you can
use for:
* checking your package installs correctly with different
Python versions and interpreters
* running your tests in each of the
environments, configuring your test tool of choice
* acting as a frontend to Continuous Integration
servers, greatly reducing boilerplate and merging
CI and shell-based testing.
%prep
%setup -q -n tox-%{version}
%if %{without devpi_process}
%patch -P 0 -p1
%endif
%patch -P 1 -p1
%build
export LANG=en_US.UTF8
%pyproject_wheel
%install
export LANG=en_US.UTF8
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/tox
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
# Ignores for gh#tox-dev/tox#1293 -- these tests want to install specific wheels (including pytest) into tox envs
# Upstream suggests to provide them manually to avoid downloading, but with indirect dependencies the number of
# wheels is too large. Plus, defining PIP_NO_INDEX PIP_FIND_LINKS as suggested will be deprecated in a future
# pip and it does not propagate to the test calling pip themselves without patching.
# enscons are not packaged
donttest+=" or test_provision_missing or test_provision_interrupt_child or test_provision_from_pyvenv"
donttest+=" or test_provision_cli_args_ignore or test_provision_non_canonical_dep"
donttest+=" or test_test_usedevelop"
donttest+=" or test_different_config_cwd"
donttest+=" or test_toxuone_env"
donttest+=" or test_isolated_build_backend_missing_hook"
donttest+=" or test_parallel_live or (test_parallel and not test_parallel_)"
# gh#tox-dev/tox#3011
donttest+=" or test_replace_env_var_circular_flip_flop"
#
donttest+=" or test_call_as_exe or test_skip_pkg_install"
donttest+=" or test_python_generate_hash_seed"
# this test doesn't work on aarch64
donttest+=" or test_bad_env_var"
# this test doesn't work on Leap
donttest+=" or test_package_cmd_builder"
# this test doesn't work on Tumbleweed
donttest+=" or test_package_pyproject or test_package_only"
# gh#tox-dev/tox#3399
donttest+=" or test_skip_develop_mode"
%{python_expand # tests expect an active virtualenv with a clean python name as sys.executable
virtualenv-%{$python_bin_suffix} --system-site-packages testenv-%{$python_bin_suffix}
source testenv-%{$python_bin_suffix}/bin/activate
pip install --no-deps ./build/tox*.whl
python -B -m pytest -v -m "not network" -k "not (${donttest:4})" -n auto
deactivate
}
%post
%python_install_alternative tox
%postun
%python_uninstall_alternative tox
%files %{python_files}
%license LICENSE
%doc README.md
%python_alternative %{_bindir}/tox
%{python_sitelib}/tox-%{version}*-info
%{python_sitelib}/tox
%changelog

3
tox-4.14.2.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0defb44f6dafd911b61788325741cc6b2e12ea71f987ac025ad4d649f1f1a104
size 178515

3
tox-4.23.2.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:86075e00e555df6e82e74cfc333917f91ecb47ffbc868dcafbd2672e332f4a2c
size 189998