Compare commits
32 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb2fd83e5a | ||
|
|
de396d650b | ||
|
|
bfcb4db415 | ||
|
|
91ed59fa8e | ||
|
|
b9bd279702 | ||
|
|
f8840a782c | ||
|
|
4685d09abf | ||
|
|
6e8b540f1f | ||
|
|
661fadce9e | ||
|
|
a8537e2385 | ||
|
|
ddf7ecd3d8 | ||
|
|
a0c7d6d2fb | ||
|
|
1a0b1cd795 | ||
|
|
49e309bd91 | ||
|
|
36ce30e49c | ||
|
|
728b50e059 | ||
|
|
873d91a173 | ||
|
|
62ab817d28 | ||
|
|
fa857a3318 | ||
|
|
afb013056b | ||
|
|
2d52eab0d1 | ||
|
|
6b3221eebd | ||
|
|
17cf20500b | ||
|
|
104f6b73e2 | ||
|
|
453dfdb9aa | ||
|
|
eeb73bfe13 | ||
|
|
0464e297ad | ||
|
|
07d47763fe | ||
|
|
0c1e618f44 | ||
|
|
374d223f0a | ||
|
|
f7758c7fda | ||
|
|
f85007ad88 |
8 changed files with 226 additions and 165 deletions
1
.fmf/version
Normal file
1
.fmf/version
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
1
|
||||||
131
fix-tests.patch
131
fix-tests.patch
|
|
@ -1,19 +1,33 @@
|
||||||
From 1ade3df7eaefad792a2a519c0f3cc3a8f28a5829 Mon Sep 17 00:00:00 2001
|
From 42a461b71597e85e7902571348786aa4ab848cf8 Mon Sep 17 00:00:00 2001
|
||||||
From: Lumir Balhar <lbalhar@redhat.com>
|
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= <thrnciar@redhat.com>
|
||||||
Date: Tue, 10 Jan 2023 08:34:25 +0100
|
Date: Fri, 28 Mar 2025 09:44:24 +0100
|
||||||
Subject: [PATCH] fix tests
|
Subject: [PATCH] Fix tests
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Co-Authored-By: Lumir Balhar <lbalhar@redhat.com>
|
||||||
|
Co-Authored-By: Miro Hrončok <miro@hroncok.cz>
|
||||||
---
|
---
|
||||||
pyproject.toml | 8 --------
|
pyproject.toml | 4 +---
|
||||||
src/tox/pytest.py | 16 +++-------------
|
src/tox/pytest.py | 14 ++------------
|
||||||
tests/test_provision.py | 18 ++----------------
|
tests/test_provision.py | 11 ++++-------
|
||||||
3 files changed, 5 insertions(+), 37 deletions(-)
|
.../package/test_python_package_util.py | 10 ++++++++--
|
||||||
|
4 files changed, 15 insertions(+), 30 deletions(-)
|
||||||
|
|
||||||
diff --git a/pyproject.toml b/pyproject.toml
|
diff --git a/pyproject.toml b/pyproject.toml
|
||||||
index 74219b1..6cd2da8 100644
|
index 6920d19..53326bc 100644
|
||||||
--- a/pyproject.toml
|
--- a/pyproject.toml
|
||||||
+++ b/pyproject.toml
|
+++ b/pyproject.toml
|
||||||
@@ -167,9 +167,6 @@ report.omit = [
|
@@ -201,6 +195,7 @@ filterwarnings = [
|
||||||
|
"error",
|
||||||
|
"ignore:unclosed database in <sqlite3.Connection object at:ResourceWarning",
|
||||||
|
"ignore:unclosed file <_io.TextIOWrapper:ResourceWarning",
|
||||||
|
+ "ignore:subprocess \\d+ is still running:ResourceWarning",
|
||||||
|
]
|
||||||
|
tmp_path_retention_policy = "failed"
|
||||||
|
|
||||||
|
@@ -222,9 +217,6 @@ report.omit = [
|
||||||
"tests/type_check/*",
|
"tests/type_check/*",
|
||||||
]
|
]
|
||||||
run.parallel = true
|
run.parallel = true
|
||||||
|
|
@ -23,29 +37,11 @@ index 74219b1..6cd2da8 100644
|
||||||
|
|
||||||
[tool.towncrier]
|
[tool.towncrier]
|
||||||
name = "tox"
|
name = "tox"
|
||||||
@@ -229,17 +226,12 @@ release = [
|
|
||||||
]
|
|
||||||
test = [
|
|
||||||
"build[virtualenv]>=1.2.2",
|
|
||||||
- "covdefaults>=2.3",
|
|
||||||
- "detect-test-pollution>=1.2",
|
|
||||||
- "devpi-process>=1.0.2",
|
|
||||||
- "diff-cover>=9.2",
|
|
||||||
"distlib>=0.3.8",
|
|
||||||
"flaky>=3.8.1",
|
|
||||||
"hatch-vcs>=0.4",
|
|
||||||
"hatchling>=1.25",
|
|
||||||
"psutil>=6",
|
|
||||||
"pytest>=8.3.3",
|
|
||||||
- "pytest-cov>=5",
|
|
||||||
"pytest-mock>=3.14",
|
|
||||||
"pytest-xdist>=3.6.1",
|
|
||||||
"re-assert>=1.1",
|
|
||||||
diff --git a/src/tox/pytest.py b/src/tox/pytest.py
|
diff --git a/src/tox/pytest.py b/src/tox/pytest.py
|
||||||
index ca42a5b..183e2f4 100644
|
index 31b3e6f..c358313 100644
|
||||||
--- a/src/tox/pytest.py
|
--- a/src/tox/pytest.py
|
||||||
+++ b/src/tox/pytest.py
|
+++ b/src/tox/pytest.py
|
||||||
@@ -17,7 +17,6 @@ from typing import TYPE_CHECKING, Any, Callable, Iterator, Protocol, Sequence, c
|
@@ -17,7 +17,6 @@ from typing import TYPE_CHECKING, Any, Protocol, cast
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from _pytest.fixtures import SubRequest # noqa: PLC2701
|
from _pytest.fixtures import SubRequest # noqa: PLC2701
|
||||||
|
|
@ -53,20 +49,18 @@ index ca42a5b..183e2f4 100644
|
||||||
from virtualenv.info import fs_supports_symlink
|
from virtualenv.info import fs_supports_symlink
|
||||||
|
|
||||||
import tox.run
|
import tox.run
|
||||||
@@ -280,9 +279,9 @@ class ToxProject:
|
@@ -285,8 +284,8 @@ class ToxProject:
|
||||||
m.setattr(sys, "argv", [sys.executable, "-m", "tox", *list(args)])
|
m.setattr(sys, "argv", [sys.executable, "-m", "tox", *list(args)])
|
||||||
m.setenv("VIRTUALENV_SYMLINK_APP_DATA", "1")
|
m.setenv("VIRTUALENV_SYMLINK_APP_DATA", "1")
|
||||||
m.setenv("VIRTUALENV_SYMLINKS", "1")
|
m.setenv("VIRTUALENV_SYMLINKS", "1")
|
||||||
- m.setenv("VIRTUALENV_PIP", "embed")
|
- m.setenv("VIRTUALENV_PIP", "embed")
|
||||||
- m.setenv("VIRTUALENV_WHEEL", "embed")
|
|
||||||
- m.setenv("VIRTUALENV_SETUPTOOLS", "embed")
|
- m.setenv("VIRTUALENV_SETUPTOOLS", "embed")
|
||||||
+ m.setenv("VIRTUALENV_PIP", "bundle")
|
+ m.setenv("VIRTUALENV_PIP", "bundle")
|
||||||
+ m.setenv("VIRTUALENV_WHEEL", "bundle")
|
|
||||||
+ m.setenv("VIRTUALENV_SETUPTOOLS", "bundle")
|
+ m.setenv("VIRTUALENV_SETUPTOOLS", "bundle")
|
||||||
try:
|
try:
|
||||||
tox_run(args)
|
tox_run(args)
|
||||||
except SystemExit as exception:
|
except SystemExit as exception:
|
||||||
@@ -475,15 +474,6 @@ def enable_pypi_server(monkeypatch: pytest.MonkeyPatch, url: str | None) -> None
|
@@ -479,15 +478,6 @@ def enable_pypi_server(monkeypatch: pytest.MonkeyPatch, url: str | None) -> None
|
||||||
monkeypatch.setenv("PIP_TIMEOUT", str(2))
|
monkeypatch.setenv("PIP_TIMEOUT", str(2))
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -83,35 +77,30 @@ index ca42a5b..183e2f4 100644
|
||||||
def _invalid_index_fake_port() -> int:
|
def _invalid_index_fake_port() -> int:
|
||||||
with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as socket_handler:
|
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
|
diff --git a/tests/test_provision.py b/tests/test_provision.py
|
||||||
index 5b2b652..7657c2e 100644
|
index d1b6b2d..022e340 100644
|
||||||
--- a/tests/test_provision.py
|
--- a/tests/test_provision.py
|
||||||
+++ b/tests/test_provision.py
|
+++ b/tests/test_provision.py
|
||||||
@@ -98,22 +98,9 @@ def tox_wheels(tox_wheel: Path, tmp_path_factory: TempPathFactory) -> list[Path]
|
@@ -126,15 +126,13 @@ def _use_pypi_index(pypi_index: Index, monkeypatch: MonkeyPatch) -> None:
|
||||||
return result
|
|
||||||
|
|
||||||
|
|
||||||
-@pytest.fixture(scope="session")
|
|
||||||
-def pypi_index_self(pypi_server: IndexServer, tox_wheels: list[Path], demo_pkg_inline_wheel: Path) -> Index:
|
|
||||||
- with elapsed("start devpi and create index"): # takes around 1s
|
|
||||||
- self_index = pypi_server.create_index("self", "volatile=False")
|
|
||||||
- with elapsed("upload tox and its wheels to devpi"): # takes around 3.2s on build
|
|
||||||
- self_index.upload(*tox_wheels, demo_pkg_inline_wheel)
|
|
||||||
- return self_index
|
|
||||||
-
|
|
||||||
-
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
-def _pypi_index_self(pypi_index_self: Index, monkeypatch: MonkeyPatch) -> None:
|
-def _pypi_index_mirrored(local_pypi_indexes: tuple[Index, Index], monkeypatch: MonkeyPatch) -> None:
|
||||||
- pypi_index_self.use()
|
- pypi_index_mirrored, _ = local_pypi_indexes
|
||||||
- monkeypatch.setenv("PIP_INDEX_URL", pypi_index_self.url)
|
- _use_pypi_index(pypi_index_mirrored, monkeypatch)
|
||||||
- monkeypatch.setenv("PIP_RETRIES", str(2))
|
+def _pypi_index_mirrored() -> None:
|
||||||
- monkeypatch.setenv("PIP_TIMEOUT", str(5))
|
|
||||||
-
|
|
||||||
+def _pypi_index_self():
|
|
||||||
+ pytest.skip("needs devpi-process")
|
+ pytest.skip("needs devpi-process")
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
-def _pypi_index_self(local_pypi_indexes: tuple[Index, Index], monkeypatch: MonkeyPatch) -> None:
|
||||||
|
- _, pypi_index_self = local_pypi_indexes
|
||||||
|
- _use_pypi_index(pypi_index_self, monkeypatch)
|
||||||
|
+def _pypi_index_self() -> None:
|
||||||
|
+ pytest.skip("needs devpi-process")
|
||||||
|
|
||||||
|
|
||||||
def test_provision_requires_nok(tox_project: ToxProjectCreator) -> None:
|
def test_provision_requires_nok(tox_project: ToxProjectCreator) -> None:
|
||||||
ini = "[tox]\nrequires = pkg-does-not-exist\n setuptools==1\nskipsdist=true\n"
|
@@ -183,7 +181,6 @@ def test_provision_requires_ok(tox_project: ToxProjectCreator, tmp_path: Path) -
|
||||||
@@ -161,7 +148,6 @@ def test_provision_requires_ok(tox_project: ToxProjectCreator, tmp_path: Path) -
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.integration
|
@pytest.mark.integration
|
||||||
|
|
@ -119,6 +108,36 @@ index 5b2b652..7657c2e 100644
|
||||||
def test_provision_platform_check(tox_project: ToxProjectCreator) -> None:
|
def test_provision_platform_check(tox_project: ToxProjectCreator) -> None:
|
||||||
ini = "[tox]\nrequires=demo-pkg-inline\n[testenv]\npackage=skip\n[testenv:.tox]\nplatform=wrong_platform"
|
ini = "[tox]\nrequires=demo-pkg-inline\n[testenv]\npackage=skip\n[testenv:.tox]\nplatform=wrong_platform"
|
||||||
proj = tox_project({"tox.ini": ini})
|
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
|
||||||
|
--- 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:
|
||||||
|
|
||||||
|
from importlib.metadata import Distribution, PathDistribution
|
||||||
|
|
||||||
|
+from importlib.metadata import version
|
||||||
|
+from packaging.version import Version
|
||||||
|
+
|
||||||
|
+SETUPTOOLS_VERSION = Version(version("setuptools"))
|
||||||
|
+SETUPTOOLS_75_6 = SETUPTOOLS_VERSION >= Version("75.6")
|
||||||
|
+
|
||||||
|
|
||||||
|
@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:
|
||||||
|
exp = [
|
||||||
|
Requirement("platformdirs>=4.3.8"),
|
||||||
|
Requirement("colorama>=0.4.6"),
|
||||||
|
- *(sphinx if sys.version_info[0:2] <= (3, 8) else []),
|
||||||
|
+ *(sphinx if not SETUPTOOLS_75_6 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 []),
|
||||||
|
+ *(sphinx if SETUPTOOLS_75_6 else []),
|
||||||
|
]
|
||||||
|
for left, right in zip_longest(result, exp):
|
||||||
|
assert isinstance(right, Requirement)
|
||||||
--
|
--
|
||||||
2.47.0
|
2.51.1
|
||||||
|
|
||||||
|
|
|
||||||
102
plan.fmf
Normal file
102
plan.fmf
Normal file
|
|
@ -0,0 +1,102 @@
|
||||||
|
execute:
|
||||||
|
how: tmt
|
||||||
|
|
||||||
|
discover:
|
||||||
|
- name: rpms_pyproject-rpm-macros
|
||||||
|
how: shell
|
||||||
|
url: https://src.fedoraproject.org/rpms/pyproject-rpm-macros.git
|
||||||
|
tests:
|
||||||
|
- name: pyproject_pytest
|
||||||
|
path: /tests
|
||||||
|
test: ./mocktest.sh python-pytest
|
||||||
|
- name: pyproject_pluggy
|
||||||
|
path: /tests
|
||||||
|
test: ./mocktest.sh python-pluggy
|
||||||
|
- name: pyproject_openqa_client
|
||||||
|
path: /tests
|
||||||
|
test: ./mocktest.sh python-openqa_client
|
||||||
|
- name: same_repo
|
||||||
|
how: shell
|
||||||
|
dist-git-source: true
|
||||||
|
dist-git-download-only: true
|
||||||
|
tests:
|
||||||
|
- name: all_supplementing_pythons
|
||||||
|
test: ./tests/all_supplementing_pythons.py
|
||||||
|
- name: mock_with_tests
|
||||||
|
# Needs cwd to contain downloaded sources, path to mocktes.sh depends on tmt tree structure
|
||||||
|
test: |
|
||||||
|
cd $TMT_SOURCE_DIR &&
|
||||||
|
$TMT_TREE/../discover/rpms_pyproject-rpm-macros/tests/tests/mocktest.sh python-tox --enable-network --with ci_tests
|
||||||
|
- name: tests_python
|
||||||
|
how: shell
|
||||||
|
url: https://src.fedoraproject.org/tests/python.git
|
||||||
|
tests:
|
||||||
|
- name: smoke27
|
||||||
|
path: /smoke
|
||||||
|
test: VERSION=2.7 INSTALL_OR_SKIP=true METHOD=virtualenv TOX_REQUIRES="virtualenv<20.22.0" ./venv.sh
|
||||||
|
- name: smoke36
|
||||||
|
path: /smoke
|
||||||
|
test: VERSION=3.6 INSTALL_OR_SKIP=true TOX_REQUIRES="virtualenv<20.22.0" ./venv.sh
|
||||||
|
- name: smoke39
|
||||||
|
path: /smoke
|
||||||
|
test: VERSION=3.9 INSTALL_OR_SKIP=true ./venv.sh
|
||||||
|
- name: smoke310
|
||||||
|
path: /smoke
|
||||||
|
test: VERSION=3.10 INSTALL_OR_SKIP=true ./venv.sh
|
||||||
|
- name: smoke311
|
||||||
|
path: /smoke
|
||||||
|
test: VERSION=3.11 INSTALL_OR_SKIP=true ./venv.sh
|
||||||
|
- name: smoke312
|
||||||
|
path: /smoke
|
||||||
|
test: VERSION=3.12 ./venv.sh
|
||||||
|
- name: smoke313
|
||||||
|
path: /smoke
|
||||||
|
test: VERSION=3.13 INSTALL_OR_SKIP=true ./venv.sh
|
||||||
|
- name: smoke313t
|
||||||
|
path: /smoke
|
||||||
|
test: VERSION=3.13t INSTALL_OR_SKIP=true ./venv.sh
|
||||||
|
- name: smoke314
|
||||||
|
path: /smoke
|
||||||
|
test: VERSION=3.14 INSTALL_OR_SKIP=true ./venv.sh
|
||||||
|
- name: smoke314t
|
||||||
|
path: /smoke
|
||||||
|
test: VERSION=3.14t INSTALL_OR_SKIP=true ./venv.sh
|
||||||
|
- name: smoke315
|
||||||
|
path: /smoke
|
||||||
|
test: VERSION=3.15 INSTALL_OR_SKIP=true ./venv.sh
|
||||||
|
- name: smoke315t
|
||||||
|
path: /smoke
|
||||||
|
test: VERSION=3.15t INSTALL_OR_SKIP=true ./venv.sh
|
||||||
|
- name: smoke_pypy39
|
||||||
|
path: /smoke
|
||||||
|
test: PYTHON=pypy3.9 VERSION=3.9 INSTALL_OR_SKIP=true ./venv.sh
|
||||||
|
- name: smoke_pypy310
|
||||||
|
path: /smoke
|
||||||
|
test: PYTHON=pypy3.10 VERSION=3.10 INSTALL_OR_SKIP=true ./venv.sh
|
||||||
|
- name: smoke_pypy311
|
||||||
|
path: /smoke
|
||||||
|
test: PYTHON=pypy3.11 VERSION=3.11 INSTALL_OR_SKIP=true ./venv.sh
|
||||||
|
|
||||||
|
prepare:
|
||||||
|
- name: Install dependencies
|
||||||
|
how: install
|
||||||
|
package:
|
||||||
|
- gcc
|
||||||
|
- virtualenv
|
||||||
|
- python3-devel
|
||||||
|
- python3.12-devel
|
||||||
|
- python3-tox
|
||||||
|
- python3-dnf
|
||||||
|
- mock
|
||||||
|
- rpmdevtools
|
||||||
|
- rpm-build
|
||||||
|
- python3-pyyaml
|
||||||
|
- rpm
|
||||||
|
- dnf
|
||||||
|
- name: Update packages
|
||||||
|
how: shell
|
||||||
|
script: dnf upgrade -y
|
||||||
|
- name: rpm_qa
|
||||||
|
order: 100
|
||||||
|
how: shell
|
||||||
|
script: rpm -qa | sort | tee $TMT_PLAN_DATA/rpmqa.txt
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
%undefine _py3_shebang_s
|
%undefine _py3_shebang_s
|
||||||
|
|
||||||
Name: python-tox
|
Name: python-tox
|
||||||
Version: 4.23.2
|
Version: 4.33.0
|
||||||
Release: %autorelease
|
Release: %autorelease
|
||||||
Summary: Virtualenv-based automation of test activities
|
Summary: Virtualenv-based automation of test activities
|
||||||
|
|
||||||
|
|
@ -28,10 +28,11 @@ License: MIT
|
||||||
URL: https://tox.readthedocs.io/
|
URL: https://tox.readthedocs.io/
|
||||||
Source: %{pypi_source tox}
|
Source: %{pypi_source tox}
|
||||||
|
|
||||||
# Remove dependency on devpi-process.
|
# Remove usage of devpi-process.
|
||||||
# Remove dependency on detect-test-pollution.
|
# Remove coverage options.
|
||||||
# Remove coverage-related dependencies.
|
|
||||||
# Adjust virtualenv environment variables to make it work with our patched virtualenv.
|
# Adjust virtualenv environment variables to make it work with our patched virtualenv.
|
||||||
|
# Adjust setuptools-version specific ifs to check for setuptools version rather than Python version.
|
||||||
|
# Ignore ResourceWarning: subprocess ... is still running (happens arbitrarily, possibly due to pytest-xdist usage)
|
||||||
Patch: fix-tests.patch
|
Patch: fix-tests.patch
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
@ -81,10 +82,11 @@ Summary: %{summary}
|
||||||
# however it launches other Python versions as subprocesses.
|
# however it launches other Python versions as subprocesses.
|
||||||
# It recommends all Python versions it supports. (This is an exception to
|
# It recommends all Python versions it supports. (This is an exception to
|
||||||
# the rule that Fedora packages may not require the alternative interpreters.)
|
# the rule that Fedora packages may not require the alternative interpreters.)
|
||||||
Recommends: python3.8
|
%if 0%{?fedora}
|
||||||
Recommends: python3.9
|
Recommends: python3.9
|
||||||
Recommends: python3.10
|
Recommends: python3.10
|
||||||
Recommends: pypy3-devel
|
Recommends: pypy3-devel
|
||||||
|
%endif
|
||||||
Recommends: python3-devel
|
Recommends: python3-devel
|
||||||
# Instead of adding new Pythons here, add `Supplements: tox` to them, see:
|
# 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/
|
# https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org/thread/NVVUXSVSPFQOWIGBE2JNI67HEO7R63ZQ/
|
||||||
|
|
@ -99,10 +101,15 @@ Recommends: python3-devel
|
||||||
|
|
||||||
# Upstream updates dependencies too aggressively
|
# Upstream updates dependencies too aggressively
|
||||||
# see https://github.com/tox-dev/tox/pull/2843#discussion_r1065028356
|
# see https://github.com/tox-dev/tox/pull/2843#discussion_r1065028356
|
||||||
sed -ri -e 's/"(packaging|filelock|platformdirs|psutil|pyproject-api|pytest|pytest-mock|pytest-xdist|wheel|pluggy|distlib|cachetools|build\[virtualenv\]|setuptools|flaky)>=.*/"\1",/g' \
|
# First, carefully adjust the pins of build and runtime dependencies,
|
||||||
-e 's/"(time-machine)>=[^;"]+/"\1/' \
|
# then remove all the >= specifiers from tests deps, whatever they are,
|
||||||
-e 's/"(virtualenv)>=.*/"\1>=20",/g' \
|
# 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' \
|
||||||
-e 's/"(hatchling)>=.*/"\1>=1.13",/g' \
|
-e 's/"(hatchling)>=.*/"\1>=1.13",/g' \
|
||||||
|
-e 's/"(pluggy)>=.*/"\1>=1.5",/g' \
|
||||||
|
-e '/^test = \[/,/^\]/ { s/>=[^;"]+// }' \
|
||||||
|
-e '/^test = \[/,/^\]/ { /"(covdefaults|coverage|detect-test-pollution|devpi-process|diff-cover|pytest-cov)[;"]/d }' \
|
||||||
pyproject.toml
|
pyproject.toml
|
||||||
|
|
||||||
%generate_buildrequires
|
%generate_buildrequires
|
||||||
|
|
@ -122,6 +129,12 @@ export SETUPTOOLS_SCM_PRETEND_VERSION="%{version}"
|
||||||
|
|
||||||
%if %{with tests}
|
%if %{with tests}
|
||||||
%check
|
%check
|
||||||
|
# Upstream requires virtualenv >= 20.31 for tests, and no longer sets VIRTUALENV_WHEEL.
|
||||||
|
# To support environments with older virtualenv, we set it manually:
|
||||||
|
%if v"%(%{python3} -c 'import importlib.metadata as im; print(im.version("virtualenv"))' 2>/dev/null || echo 0)" < v"20.31"
|
||||||
|
export VIRTUALENV_WHEEL=bundle
|
||||||
|
%endif
|
||||||
|
|
||||||
# Skipped tests use internal virtualenv functionality to
|
# Skipped tests use internal virtualenv functionality to
|
||||||
# download wheels which does not work with "bundled" version of wheel in
|
# download wheels which does not work with "bundled" version of wheel in
|
||||||
# the Fedora's virtualenv patch.
|
# the Fedora's virtualenv patch.
|
||||||
|
|
@ -135,23 +148,27 @@ k="${k-}${k+ and }not test_str_convert_ok_py39"
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# https://github.com/tox-dev/tox/commit/698f1dd663
|
# https://github.com/tox-dev/tox/commit/698f1dd663
|
||||||
# Until we have setuptools 70.1+ we skip those
|
# The tests fail with setuptools < 70.1
|
||||||
|
%if v"%(%{python3} -c 'import importlib.metadata as im; print(im.version("setuptools"))' 2>/dev/null || echo 0)" < v"70.1"
|
||||||
k="${k-}${k+ and }not test_result_json_sequential"
|
k="${k-}${k+ and }not test_result_json_sequential"
|
||||||
k="${k-}${k+ and }not test_setuptools_package"
|
k="${k-}${k+ and }not test_setuptools_package"
|
||||||
k="${k-}${k+ and }not test_skip_develop_mode"
|
k="${k-}${k+ and }not test_skip_develop_mode"
|
||||||
k="${k-}${k+ and }not test_tox_install_pkg_sdist"
|
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
|
||||||
|
|
||||||
# The following tests either need internet connection or installed tox
|
# The following tests either need internet connection or installed tox
|
||||||
# so we only run them on the CI.
|
# so we only run them on the CI.
|
||||||
%if %{without ci_tests}
|
%if %{without ci_tests}
|
||||||
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"
|
|
||||||
k="${k-}${k+ and }not test_build_wheel_external"
|
k="${k-}${k+ and }not test_build_wheel_external"
|
||||||
k="${k-}${k+ and }not keyboard_interrupt"
|
k="${k-}${k+ and }not keyboard_interrupt"
|
||||||
k="${k-}${k+ and }not test_call_as_module"
|
k="${k-}${k+ and }not test_call_as_module"
|
||||||
k="${k-}${k+ and }not test_call_as_exe"
|
k="${k-}${k+ and }not test_call_as_exe"
|
||||||
k="${k-}${k+ and }not test_run_installpkg_targz"
|
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"
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%pytest -v -n auto -k "${k-}" --run-integration
|
%pytest -v -n auto -k "${k-}" --run-integration
|
||||||
|
|
|
||||||
3
rpmlint.toml
Normal file
3
rpmlint.toml
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
Filters = [
|
||||||
|
'spelling-error .* en_US [Vv]irtualenv ',
|
||||||
|
]
|
||||||
2
sources
2
sources
|
|
@ -1 +1 @@
|
||||||
SHA512 (tox-4.23.2.tar.gz) = 5008964ebed3c94a6ad5f0985150c7bf73fd3996b91171b16323d195bf0288102aac0dc38848bd4c63e5c5678ab1a82c170579139eda97132a4555eb11d381a0
|
SHA512 (tox-4.33.0.tar.gz) = e46a19ea92a556dc45a592a8d9567b863e072bd2ca8bc7866a3e4992f737fb29ff263a88cfd3cfaa9edaf4d097dd232d710ff9ac072bb16a98adcffea8fe3b70
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ See https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproje
|
||||||
This script:
|
This script:
|
||||||
|
|
||||||
1) figures out all packages in the enabled repositories supplementing tox
|
1) figures out all packages in the enabled repositories supplementing tox
|
||||||
2) ensures there is a venv.sh test for each of them in tests.yml
|
2) ensures there is a venv.sh test for each of them in plan.fmf
|
||||||
|
|
||||||
That way, when we change tox (update, patch, etc.),
|
That way, when we change tox (update, patch, etc.),
|
||||||
we will always test it with all Pythons that supplement it.
|
we will always test it with all Pythons that supplement it.
|
||||||
|
|
@ -34,16 +34,18 @@ def parse_python_test_arg(command):
|
||||||
|
|
||||||
# First, construct a set of various Pythons we test, e.g. {python3.10, python3.7, pypy3.6, ...}
|
# First, construct a set of various Pythons we test, e.g. {python3.10, python3.7, pypy3.6, ...}
|
||||||
tested_pythons = set()
|
tested_pythons = set()
|
||||||
with open('tests.yml') as f:
|
with open('plan.fmf') as f:
|
||||||
tests_yml = yaml.safe_load(f)
|
plan_fmf = yaml.safe_load(f)
|
||||||
# this nested structure access is quite fragile,
|
# this nested structure access is quite fragile,
|
||||||
# but at least it should fail the test if we reach to a wrong place
|
# but at least it should fail the test if we reach to a wrong place
|
||||||
for test in tests_yml[-1]['roles'][0]['tests']:
|
for discover_section in plan_fmf['discover']:
|
||||||
for value in test.values():
|
if discover_section['name'] != 'tests_python':
|
||||||
run = value['run']
|
continue
|
||||||
if run.endswith('./venv.sh'):
|
for test in discover_section['tests']:
|
||||||
tested_pythons.add(parse_python_test_arg(run))
|
test_cmd = test['test']
|
||||||
print('Tested Pythons found in tests.yml:', file=sys.stderr)
|
if test_cmd.endswith('./venv.sh'):
|
||||||
|
tested_pythons.add(parse_python_test_arg(test_cmd))
|
||||||
|
print('Tested Pythons found in plan.fmf:', file=sys.stderr)
|
||||||
for python in sorted(tested_pythons):
|
for python in sorted(tested_pythons):
|
||||||
print(' ', python, file=sys.stderr)
|
print(' ', python, file=sys.stderr)
|
||||||
|
|
||||||
|
|
@ -64,10 +66,13 @@ for nvra in supplementing_pkgs:
|
||||||
|
|
||||||
|
|
||||||
# We use this hack to treat -devel and -libs packages as if they were not such
|
# We use this hack to treat -devel and -libs packages as if they were not such
|
||||||
|
# We also convert the freethreading packages to the exectuable name
|
||||||
def normalize_name(pkgname):
|
def normalize_name(pkgname):
|
||||||
for suffix in '-devel', '-libs':
|
for suffix in '-devel', '-libs':
|
||||||
if pkgname.endswith(suffix):
|
if pkgname.endswith(suffix):
|
||||||
return pkgname.removesuffix(suffix)
|
pkgname = pkgname.removesuffix(suffix)
|
||||||
|
if pkgname.endswith('-freethreading'):
|
||||||
|
pkgname = pkgname.removesuffix('-freethreading') + 't'
|
||||||
return pkgname
|
return pkgname
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,86 +0,0 @@
|
||||||
---
|
|
||||||
- hosts: localhost
|
|
||||||
tags:
|
|
||||||
- classic
|
|
||||||
tasks:
|
|
||||||
- dnf:
|
|
||||||
name: "*"
|
|
||||||
state: latest
|
|
||||||
|
|
||||||
- hosts: localhost
|
|
||||||
tags:
|
|
||||||
- classic
|
|
||||||
pre_tasks:
|
|
||||||
- import_role:
|
|
||||||
name: standard-test-source
|
|
||||||
vars:
|
|
||||||
fetch_only: True
|
|
||||||
|
|
||||||
roles:
|
|
||||||
- role: standard-test-basic
|
|
||||||
repositories:
|
|
||||||
- repo: "https://src.fedoraproject.org/tests/python.git"
|
|
||||||
dest: "python"
|
|
||||||
- repo: "https://src.fedoraproject.org/rpms/pyproject-rpm-macros.git"
|
|
||||||
dest: "pyproject-rpm-macros"
|
|
||||||
tests:
|
|
||||||
- mock_with_tests:
|
|
||||||
dir: .
|
|
||||||
run: pyproject-rpm-macros/tests/mocktest.sh python-tox --enable-network --with ci_tests
|
|
||||||
- all_supplementing_pythons:
|
|
||||||
dir: tests
|
|
||||||
run: ./all_supplementing_pythons.py
|
|
||||||
- smoke38:
|
|
||||||
dir: python/smoke
|
|
||||||
run: VERSION=3.8 ./venv.sh
|
|
||||||
- smoke39:
|
|
||||||
dir: python/smoke
|
|
||||||
run: VERSION=3.9 ./venv.sh
|
|
||||||
- smoke310:
|
|
||||||
dir: python/smoke
|
|
||||||
run: VERSION=3.10 ./venv.sh
|
|
||||||
- smoke311:
|
|
||||||
dir: python/smoke
|
|
||||||
run: VERSION=3.11 ./venv.sh
|
|
||||||
- smoke312:
|
|
||||||
dir: python/smoke
|
|
||||||
run: VERSION=3.12 ./venv.sh
|
|
||||||
- smoke313:
|
|
||||||
dir: python/smoke
|
|
||||||
run: VERSION=3.13 ./venv.sh
|
|
||||||
- smoke314:
|
|
||||||
dir: python/smoke
|
|
||||||
run: VERSION=3.14 ./venv.sh
|
|
||||||
- smoke_pypy39:
|
|
||||||
dir: python/smoke
|
|
||||||
run: PYTHON=pypy3.9 VERSION=3.9 ./venv.sh
|
|
||||||
- smoke_pypy310:
|
|
||||||
dir: python/smoke
|
|
||||||
run: PYTHON=pypy3.10 VERSION=3.10 ./venv.sh
|
|
||||||
- pyproject_pytest:
|
|
||||||
dir: pyproject-rpm-macros/tests
|
|
||||||
run: ./mocktest.sh python-pytest
|
|
||||||
- pyproject_pluggy:
|
|
||||||
dir: pyproject-rpm-macros/tests
|
|
||||||
run: ./mocktest.sh python-pluggy
|
|
||||||
- pyproject_openqa_client:
|
|
||||||
dir: pyproject-rpm-macros/tests
|
|
||||||
run: ./mocktest.sh python-openqa_client
|
|
||||||
required_packages:
|
|
||||||
- gcc
|
|
||||||
- virtualenv
|
|
||||||
- python3.8
|
|
||||||
- python3.9
|
|
||||||
- python3.10-devel
|
|
||||||
- python3.11-devel
|
|
||||||
- python3.12-devel
|
|
||||||
- python3.13-devel
|
|
||||||
- python3.14-devel
|
|
||||||
- pypy3.9-devel
|
|
||||||
- pypy3.10-devel
|
|
||||||
- python3-tox
|
|
||||||
- python3-dnf
|
|
||||||
- mock
|
|
||||||
- rpmdevtools
|
|
||||||
- rpm-build
|
|
||||||
- python3-pyyaml
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue