From 5183a7da7ba14fc7919b7455314f8e37eb33aee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 5 May 2025 23:33:04 +0200 Subject: [PATCH] Drop unused test requirement of python-wheel-wheel - Run more tests The motivation for this is the need to drop python-wheel-wheel in wheel 0.46+. Due to newly gained runtime dependencies of wheel, such wheel cannot be used as is. I realized that when the explicit BuildRequires is removed, the package is brought in by python3-virtualenv. But even when python3-virtualenv drops the dependency, the tests still passed without python-wheel-wheel. Because the tests that require packaged wheels were all --ignored for obsolete reasons. When unignored, they errored due to missing coverage.whl. As a result of this change, the unused dependencies on packaged wheels are dropped, but the tests are collected and only those that require wheels are skipped (still the most). This change enables some tests, but skips most of them :/ Before: 1567 passed, 28 skipped, 12 deselected, 8 xfailed After: 1602 passed, 893 skipped, 173 deselected, 8 xfailed The added comment assumes python-wheel-wheel no longer exists. --- python-pip.spec | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/python-pip.spec b/python-pip.spec index 1b953ec..3f1c19f 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -51,8 +51,6 @@ BuildRequires: /usr/bin/git BuildRequires: /usr/bin/hg BuildRequires: /usr/bin/bzr BuildRequires: /usr/bin/svn -BuildRequires: python-setuptools-wheel -BuildRequires: python-wheel-wheel %endif %if %{with man} @@ -192,9 +190,6 @@ A Python wheel of pip to use with venv. # this goes together with patch4 rm src/pip/_vendor/certifi/*.pem -# tests expect wheels in here -ln -s %{python_wheel_dir} tests/data/common_wheels - # Remove windows executable binaries rm -v src/pip/_vendor/distlib/*.exe sed -i '/\.exe/d' pyproject.toml @@ -202,6 +197,16 @@ sed -i '/\.exe/d' pyproject.toml # Remove unused test requirements sed -Ei '/(pytest-(cov|xdist|rerunfailures)|proxy\.py)/d' tests/requirements.txt +# Skip tests requiring common_wheels +# Upstream fetches wheels of setuptools+wheel+coverage from PyPI to tests/data/common_wheels before running tests. +# We don't have enough packaged wheels in Fedora to replace this with %%{python_wheel_dir}. +# To enable such tests we would need to: +# - supply setuptools.whl from python-setuptools-wheel, e.g. by +# ln -s %%{python_wheel_dir} tests/data/common_wheels +# - drop the requirement for wheel.whl -- https://github.com/pypa/pip/pull/13382 +# - patch out the coverage.whl installation, as it is only used for pytest-cov +sed -i 's/assert len(wheel_candidates) == 1/pytest.skip("no common_wheels")/' tests/conftest.py + %if %{with tests} %generate_buildrequires @@ -275,14 +280,8 @@ grep "pem$" %{pyproject_files} && exit 1 || true # bash completion tests only work from installed package pytest_k='not completion' -# --ignore'd tests are not compatible with the latest virtualenv -# These files contain almost 500 tests so we should enable them back -# as soon as pip will be compatible upstream -# https://github.com/pypa/pip/pull/8441 -# among them, tests/functional/test_proxy.py needs proxy.py which is not -# yet packaged in Fedora %pytest -m 'not network' -k "$(echo $pytest_k)" \ - --ignore tests/functional --ignore tests/lib/test_lib.py + --ignore tests/functional/test_proxy.py # no proxy.py in Fedora %endif