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