From 048126313bd5dc5f856f2d5d1948641c6557f41b Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 27 Feb 2025 01:11:53 +0100 Subject: [PATCH 01/34] Update to 25.0.1 - Fixes: rhbz#2342135 --- python-pip.spec | 19 ++++++++++--------- sources | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/python-pip.spec b/python-pip.spec index 4e3a41d..69d9723 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -6,7 +6,7 @@ %bcond doc %[%{defined fedora} || %{defined epel}] %global srcname pip -%global base_version 24.3.1 +%global base_version 25.0.1 %global upstream_version %{base_version}%{?prerel} %global python_wheel_name %{srcname}-%{upstream_version}-py3-none-any.whl @@ -84,21 +84,21 @@ Packages" or "Pip Installs Python". # You can generate it with: # %%{_rpmconfigdir}/pythonbundles.py --namespace 'python%%{1}dist' src/pip/_vendor/vendor.txt %global bundled() %{expand: -Provides: bundled(python%{1}dist(cachecontrol)) = 0.14 +Provides: bundled(python%{1}dist(cachecontrol)) = 0.14.1 Provides: bundled(python%{1}dist(certifi)) = 2024.8.30 Provides: bundled(python%{1}dist(distlib)) = 0.3.9 Provides: bundled(python%{1}dist(distro)) = 1.9 -Provides: bundled(python%{1}dist(idna)) = 3.7 -Provides: bundled(python%{1}dist(msgpack)) = 1.0.8 -Provides: bundled(python%{1}dist(packaging)) = 24.1 -Provides: bundled(python%{1}dist(platformdirs)) = 4.2.2 +Provides: bundled(python%{1}dist(idna)) = 3.10 +Provides: bundled(python%{1}dist(msgpack)) = 1.1 +Provides: bundled(python%{1}dist(packaging)) = 24.2 +Provides: bundled(python%{1}dist(platformdirs)) = 4.3.6 Provides: bundled(python%{1}dist(pygments)) = 2.18 -Provides: bundled(python%{1}dist(pyproject-hooks)) = 1 +Provides: bundled(python%{1}dist(pyproject-hooks)) = 1.2 Provides: bundled(python%{1}dist(requests)) = 2.32.3 Provides: bundled(python%{1}dist(resolvelib)) = 1.0.1 -Provides: bundled(python%{1}dist(rich)) = 13.7.1 +Provides: bundled(python%{1}dist(rich)) = 13.9.4 Provides: bundled(python%{1}dist(setuptools)) = 70.3 -Provides: bundled(python%{1}dist(tomli)) = 2.0.1 +Provides: bundled(python%{1}dist(tomli)) = 2.2.1 Provides: bundled(python%{1}dist(truststore)) = 0.10 Provides: bundled(python%{1}dist(typing-extensions)) = 4.12.2 Provides: bundled(python%{1}dist(urllib3)) = 1.26.20 @@ -159,6 +159,7 @@ Summary: A documentation for a tool for installing and managing Python pa BuildRequires: python%{python3_pkgversion}-sphinx BuildRequires: python%{python3_pkgversion}-sphinx-inline-tabs +BuildRequires: python%{python3_pkgversion}-sphinx-issues BuildRequires: python%{python3_pkgversion}-sphinx-copybutton BuildRequires: python%{python3_pkgversion}-myst-parser diff --git a/sources b/sources index 2569c69..e92388f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pip-24.3.1.tar.gz) = 9cf5f18eefd559cf27bc026e5206b0028ea77fd904a61fea9a6682b519305c962dd19170b841581bd05ff72192a9c458ec0eba173fa66db0438b046111ff5856 +SHA512 (pip-25.0.1.tar.gz) = a6850c8567082bbf98483a45e523c4de12132136d2b0aa388ac619c02ffd0c8f6aea7d727f7d84167dadec5f1e56dd478b2233b0caa5d9b3e5cadc9e1f3dc12c From d681b5b429a32a5fd431eb6b37d9ade3474d947b Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 27 Feb 2025 02:39:37 +0100 Subject: [PATCH 02/34] Remove testing of retired python3.8 from the CI See https://fedoraproject.org/wiki/Changes/RetirePython3.8 [skip changelog] --- tests/tests.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/tests.yml b/tests/tests.yml index 02b7040..1448bc8 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -13,9 +13,6 @@ - smoke36: dir: python/smoke run: VERSION=3.6 TOX=false ./venv.sh - - smoke38: - dir: python/smoke - run: VERSION=3.8 ./venv.sh - smoke39: dir: python/smoke run: VERSION=3.9 ./venv.sh @@ -34,9 +31,6 @@ - smoke314: dir: python/smoke run: VERSION=3.14 ./venv.sh - - smoke38_virtualenv: - dir: python/smoke - run: VERSION=3.8 METHOD=virtualenv ./venv.sh - smoke39_virtualenv: dir: python/smoke run: VERSION=3.9 METHOD=virtualenv ./venv.sh @@ -72,7 +66,6 @@ - gcc - virtualenv - python3.6 - - python3.8 - python3.9 - python3.10-devel - python3.11-devel From 97a9e3e2155364562c2438142982fbb7afb4629a Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 6 Mar 2025 13:03:52 +0100 Subject: [PATCH 03/34] Fix CI tests to account for normalization of dist-info dirs (PEP 491) setuptools now normalizes the dist-info directory names to lowercase according to PEP 491 Also egg-info directories are not created anymore [skip changelog] --- tests/pip_install_upgrade/runtest.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/pip_install_upgrade/runtest.sh b/tests/pip_install_upgrade/runtest.sh index 40e14a3..4c520f5 100755 --- a/tests/pip_install_upgrade/runtest.sh +++ b/tests/pip_install_upgrade/runtest.sh @@ -18,14 +18,14 @@ RPM_BUILD_ROOT=/ /usr/bin/pip install 'Pello==1.0.1' /usr/bin/pip freeze | grep '^Pello==1\.0\.2$' # Both installations should still exist -test -d "${RPM_SITELIB}/Pello-1.0.1-py${PYTHON_VERSION}.egg-info" || test -d "${RPM_SITELIB}/Pello-1.0.1.dist-info" +test -d "${RPM_SITELIB}/pello-1.0.1.dist-info" test -d "${LOCAL_SITELIB}/Pello-1.0.2.dist-info" # Let's ditch the local one /usr/bin/pip uninstall --yes Pello # It should only remove one of them -test -d "${RPM_SITELIB}/Pello-1.0.1-py${PYTHON_VERSION}.egg-info" || test -d "${RPM_SITELIB}/Pello-1.0.1.dist-info" +test -d "${RPM_SITELIB}/pello-1.0.1.dist-info" ! test -d "${LOCAL_SITELIB}/Pello-1.0.2.dist-info" # And pip should still see the RPM-installed one From 8c346262d536ba9705940f456d765c4fa200fd3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 24 Apr 2025 13:34:32 +0200 Subject: [PATCH 04/34] Bootstrap: wheel is not needed Also, test this on the CI. [skip changelog] --- python-pip.spec | 1 - tests/tests.yml | 11 +++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/python-pip.spec b/python-pip.spec index 69d9723..443c617 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -136,7 +136,6 @@ BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python3-rpm-generators >= 11-8 BuildRequires: pyproject-rpm-macros BuildRequires: python%{python3_pkgversion}-setuptools -BuildRequires: python%{python3_pkgversion}-wheel BuildRequires: bash-completion BuildRequires: ca-certificates Requires: ca-certificates diff --git a/tests/tests.yml b/tests/tests.yml index 1448bc8..69d8c0b 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -1,5 +1,13 @@ --- - hosts: localhost + tags: + - classic + pre_tasks: + - import_role: + name: standard-test-source + vars: + fetch_only: True + roles: - role: standard-test-basic tags: @@ -49,6 +57,9 @@ - smoke314_virtualenv: dir: python/smoke run: VERSION=3.14 METHOD=virtualenv ./venv.sh + - mock_bootstrap_build: + dir: . + run: pyproject-rpm-macros/tests/mocktest.sh python-pip --without tests --without doc - pyproject_pytest: dir: pyproject-rpm-macros/tests run: ./mocktest.sh python-pytest From d4edbde90247196d2d511e9e1af492b7a928b442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= Date: Mon, 28 Apr 2025 10:06:59 +0200 Subject: [PATCH 05/34] Update to 25.1.0 (rhbz#2362438) --- python-pip.spec | 24 ++++++++++++++---------- sources | 2 +- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/python-pip.spec b/python-pip.spec index 443c617..06a11eb 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -6,7 +6,7 @@ %bcond doc %[%{defined fedora} || %{defined epel}] %global srcname pip -%global base_version 25.0.1 +%global base_version 25.1 %global upstream_version %{base_version}%{?prerel} %global python_wheel_name %{srcname}-%{upstream_version}-py3-none-any.whl @@ -20,6 +20,7 @@ Summary: A tool for installing and managing Python packages # certifi: MPL-2.0 # CacheControl: Apache-2.0 +# dependency-groups: MIT # distlib: Python-2.0.1 # distro: Apache-2.0 # idna: BSD-3-Clause @@ -34,6 +35,7 @@ Summary: A tool for installing and managing Python packages # setuptools: MIT # truststore: MIT # tomli: MIT +# tomli-w: MIT # typing-extensions: Python-2.0.1 # urllib3: MIT @@ -84,23 +86,25 @@ Packages" or "Pip Installs Python". # You can generate it with: # %%{_rpmconfigdir}/pythonbundles.py --namespace 'python%%{1}dist' src/pip/_vendor/vendor.txt %global bundled() %{expand: -Provides: bundled(python%{1}dist(cachecontrol)) = 0.14.1 -Provides: bundled(python%{1}dist(certifi)) = 2024.8.30 +Provides: bundled(python%{1}dist(cachecontrol)) = 0.14.2 +Provides: bundled(python%{1}dist(certifi)) = 2025.1.31 +Provides: bundled(python%{1}dist(dependency-groups)) = 1.3 Provides: bundled(python%{1}dist(distlib)) = 0.3.9 Provides: bundled(python%{1}dist(distro)) = 1.9 Provides: bundled(python%{1}dist(idna)) = 3.10 Provides: bundled(python%{1}dist(msgpack)) = 1.1 -Provides: bundled(python%{1}dist(packaging)) = 24.2 -Provides: bundled(python%{1}dist(platformdirs)) = 4.3.6 -Provides: bundled(python%{1}dist(pygments)) = 2.18 +Provides: bundled(python%{1}dist(packaging)) = 25 +Provides: bundled(python%{1}dist(platformdirs)) = 4.3.7 +Provides: bundled(python%{1}dist(pygments)) = 2.19.1 Provides: bundled(python%{1}dist(pyproject-hooks)) = 1.2 Provides: bundled(python%{1}dist(requests)) = 2.32.3 -Provides: bundled(python%{1}dist(resolvelib)) = 1.0.1 -Provides: bundled(python%{1}dist(rich)) = 13.9.4 +Provides: bundled(python%{1}dist(resolvelib)) = 1.1 +Provides: bundled(python%{1}dist(rich)) = 14 Provides: bundled(python%{1}dist(setuptools)) = 70.3 Provides: bundled(python%{1}dist(tomli)) = 2.2.1 -Provides: bundled(python%{1}dist(truststore)) = 0.10 -Provides: bundled(python%{1}dist(typing-extensions)) = 4.12.2 +Provides: bundled(python%{1}dist(tomli-w)) = 1.2 +Provides: bundled(python%{1}dist(truststore)) = 0.10.1 +Provides: bundled(python%{1}dist(typing-extensions)) = 4.13.2 Provides: bundled(python%{1}dist(urllib3)) = 1.26.20 } diff --git a/sources b/sources index e92388f..cacb27f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pip-25.0.1.tar.gz) = a6850c8567082bbf98483a45e523c4de12132136d2b0aa388ac619c02ffd0c8f6aea7d727f7d84167dadec5f1e56dd478b2233b0caa5d9b3e5cadc9e1f3dc12c +SHA512 (pip-25.1.tar.gz) = d6b93aeabe6a4e046caf85c028fca380936ab65cb3c5028a7fa7dbc61cef2cf7d0c46c499fe548dc0af8f7bc30f7ecace8f257b20a60c0cc905b531f193b5a9d From 274df105b5c43a4ce01e3f9f2be496681853c3cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Sat, 3 May 2025 09:43:56 +0200 Subject: [PATCH 06/34] Remove no longer needed RIGHT-TO-LEFT OVERRIDE stripping See https://github.com/pypa/pip/pull/12517 [skip changelog] --- python-pip.spec | 4 ---- 1 file changed, 4 deletions(-) diff --git a/python-pip.spec b/python-pip.spec index 06a11eb..80ac098 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -211,10 +211,6 @@ ln -s %{python_wheel_dir} tests/data/common_wheels rm -v src/pip/_vendor/distlib/*.exe sed -i '/\.exe/d' pyproject.toml -# Remove RIGHT-TO-LEFT OVERRIDE from AUTHORS.txt -# https://github.com/pypa/pip/pull/12046 -%{python3} -c 'from pathlib import Path; p = Path("AUTHORS.txt"); p.write_text("".join(c for c in p.read_text() if c != "\u202e"))' - # Remove unused test requirements sed -Ei '/(pytest-(cov|xdist|rerunfailures)|proxy\.py)/d' tests/requirements.txt From be112f861aec617af55b1372730287799a02d73c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Sat, 3 May 2025 11:09:49 +0200 Subject: [PATCH 07/34] Drop unused rpmlintrc filter python3-pip.noarch: E: unused-rpmlintrc-filter "E: spelling-error .+'venv'" [skip changelog] --- python-pip.rpmlintrc | 3 --- 1 file changed, 3 deletions(-) diff --git a/python-pip.rpmlintrc b/python-pip.rpmlintrc index afa5713..d32664b 100644 --- a/python-pip.rpmlintrc +++ b/python-pip.rpmlintrc @@ -7,6 +7,3 @@ addFilter(r'non-executable-script .+/pip/_vendor/distro/distro.py\b') # We ship README with the main package but not with the wheel addFilter(r'python-pip-wheel.noarch: W: no-documentation') - -# Spelling errors -addFilter(r"E: spelling-error .+'venv'") From 8390734c31b5dc35c33e8bfb4b714def0a0bb640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Sat, 3 May 2025 09:56:03 +0200 Subject: [PATCH 08/34] Stop building the HTML documentation, only build manual pages - Also build manual pages on RHEL - The python-pip-doc package is gone but not Obsoleted, it has no dependencies Also: Rename the bcond, update the CI test, use sphinx-build without the -3 suffix, always BR python3-sphinx (for RHEL alternate Python versions where we don't package Sphinx). --- python-pip.spec | 51 +++++++++++++++---------------------------------- tests/tests.yml | 2 +- 2 files changed, 16 insertions(+), 37 deletions(-) diff --git a/python-pip.spec b/python-pip.spec index 80ac098..947b7ae 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -1,9 +1,10 @@ # The original RHEL N+1 content set is defined by (build)dependencies -# of the packages in Fedora ELN. Hence we disable tests and documentation here +# of the packages in Fedora ELN. Hence we disable tests here # to prevent pulling many unwanted packages in. # We intentionally keep this enabled on EPEL. %bcond tests %[%{defined fedora} || %{defined epel}] -%bcond doc %[%{defined fedora} || %{defined epel}] +# Whether to build the manual pages (useful for bootstrapping Sphinx) +%bcond man 1 %global srcname pip %global base_version 25.1 @@ -54,6 +55,14 @@ BuildRequires: python-setuptools-wheel BuildRequires: python-wheel-wheel %endif +%if %{with man} +# docs/requirements.txt contains many sphinx extensions +# however, we only build the manual pages thanks to +# https://github.com/pypa/pip/pull/13168 +# We also always use the "main" Sphinx, not python%%{python3_pkgversion}-sphinx +BuildRequires: python3-sphinx +%endif + # Prevent removing of the system packages installed under /usr/lib # when pip install -U is executed. # https://bugzilla.redhat.com/show_bug.cgi?id=1550368#c24 @@ -156,20 +165,6 @@ written in Python. Many packages can be found in the Python Package Index (PyPI). pip is a recursive acronym that can stand for either "Pip Installs Packages" or "Pip Installs Python". -%if %{with doc} -%package doc -Summary: A documentation for a tool for installing and managing Python packages - -BuildRequires: python%{python3_pkgversion}-sphinx -BuildRequires: python%{python3_pkgversion}-sphinx-inline-tabs -BuildRequires: python%{python3_pkgversion}-sphinx-issues -BuildRequires: python%{python3_pkgversion}-sphinx-copybutton -BuildRequires: python%{python3_pkgversion}-myst-parser - -%description doc -A documentation for a tool for installing and managing Python packages - -%endif %package -n %{python_wheel_pkg_prefix}-%{srcname}-wheel Summary: The pip wheel @@ -197,13 +192,6 @@ A Python wheel of pip to use with venv. # this goes together with patch4 rm src/pip/_vendor/certifi/*.pem -# Do not use furo as HTML theme in docs -# furo is not available in Fedora -sed -i '/html_theme = "furo"/d' docs/html/conf.py - -# towncrier extension for Sphinx is not yet available in Fedora -sed -i '/"sphinxcontrib.towncrier",/d' docs/html/conf.py - # tests expect wheels in here ln -s %{python_wheel_dir} tests/data/common_wheels @@ -227,11 +215,8 @@ sed -Ei '/(pytest-(cov|xdist|rerunfailures)|proxy\.py)/d' tests/requirements.txt export PYTHONPATH=./src/ %pyproject_wheel -%if %{with doc} -# from tox.ini -sphinx-build-3 -b html docs/html docs/build/html -sphinx-build-3 -b man docs/man docs/build/man -c docs/html -rm -rf docs/build/html/{.doctrees,.buildinfo} +%if %{with man} +sphinx-build --tag man -b man -d docs/build/doctrees/man -c docs/html docs/man docs/build/man %endif @@ -240,7 +225,7 @@ export PYTHONPATH=./src/ %pyproject_install %pyproject_save_files -l pip -%if %{with doc} +%if %{with man} pushd docs/build/man install -d %{buildroot}%{_mandir}/man1 for MAN in *1; do @@ -303,7 +288,7 @@ pytest_k='not completion' %files -n python%{python3_pkgversion}-%{srcname} -f %{pyproject_files} %doc README.rst -%if %{with doc} +%if %{with man} %{_mandir}/man1/pip.* %{_mandir}/man1/pip-*.* %{_mandir}/man1/pip3.* @@ -317,12 +302,6 @@ pytest_k='not completion' %dir %{bash_completions_dir} %{bash_completions_dir}/pip3 -%if %{with doc} -%files doc -%license LICENSE.txt -%doc README.rst -%doc docs/build/html -%endif %files -n %{python_wheel_pkg_prefix}-%{srcname}-wheel %license LICENSE.txt diff --git a/tests/tests.yml b/tests/tests.yml index 69d8c0b..b2347e3 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -59,7 +59,7 @@ run: VERSION=3.14 METHOD=virtualenv ./venv.sh - mock_bootstrap_build: dir: . - run: pyproject-rpm-macros/tests/mocktest.sh python-pip --without tests --without doc + run: pyproject-rpm-macros/tests/mocktest.sh python-pip --without tests --without man - pyproject_pytest: dir: pyproject-rpm-macros/tests run: ./mocktest.sh python-pytest From 2fbd290be070a552e0c7861efd554b07770f9157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Sat, 3 May 2025 09:41:03 +0200 Subject: [PATCH 09/34] Update to 25.1.1 - Fixes: rhbz#2363801 --- python-pip.spec | 4 ++-- sources | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python-pip.spec b/python-pip.spec index 947b7ae..1b953ec 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -7,7 +7,7 @@ %bcond man 1 %global srcname pip -%global base_version 25.1 +%global base_version 25.1.1 %global upstream_version %{base_version}%{?prerel} %global python_wheel_name %{srcname}-%{upstream_version}-py3-none-any.whl @@ -97,7 +97,7 @@ Packages" or "Pip Installs Python". %global bundled() %{expand: Provides: bundled(python%{1}dist(cachecontrol)) = 0.14.2 Provides: bundled(python%{1}dist(certifi)) = 2025.1.31 -Provides: bundled(python%{1}dist(dependency-groups)) = 1.3 +Provides: bundled(python%{1}dist(dependency-groups)) = 1.3.1 Provides: bundled(python%{1}dist(distlib)) = 0.3.9 Provides: bundled(python%{1}dist(distro)) = 1.9 Provides: bundled(python%{1}dist(idna)) = 3.10 diff --git a/sources b/sources index cacb27f..8c41529 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pip-25.1.tar.gz) = d6b93aeabe6a4e046caf85c028fca380936ab65cb3c5028a7fa7dbc61cef2cf7d0c46c499fe548dc0af8f7bc30f7ecace8f257b20a60c0cc905b531f193b5a9d +SHA512 (pip-25.1.1.tar.gz) = ce61c9861265139b3c5ea9be9dc246097cd75c21687cf8301f80a377d02420c4524f0d6307d2ca0232ff8715b1105343bcfdb9cac6b69503780ab2c4645558dc From f467900a68999f4695b94e29770e942de0a15332 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 6 May 2025 00:02:06 +0200 Subject: [PATCH 10/34] Remove Recommends only related to unsupported Pythons This pip version no longer supports Python 3.7 and 3.8. --- python-pip.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/python-pip.spec b/python-pip.spec index 1b953ec..6235e9f 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -179,8 +179,6 @@ Requires: ca-certificates %{crypt_compat_recommends 3.11} %{crypt_compat_recommends 3.10} %{crypt_compat_recommends 3.9} -%{crypt_compat_recommends 3.8} -%{crypt_compat_recommends 3.7} %endif %description -n %{python_wheel_pkg_prefix}-%{srcname}-wheel From b4fe5333a1342b62289749ef56a9e4dbc40b601c 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 11/34] Run functional tests - Drop test requirement of python-wheel-wheel - Use pytest-xdist to run tests faster The motivation for this was 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. While attempting to fix this, I realized we cannot use the RPM packaged wheel anyway. When the functional tests run, it takes a while, hence pytest-xdist. --- For the record, the coverage-0-py3-none-any.whl was created as: [project] name = "coverage" version = "0" [build-system] requires = ["setuptools >= 77.0.3"] build-backend = "setuptools.build_meta" And coverage.py with: def process_startup(): pass Wheel generated by `python3 -m build` (with python3-build-1.2.1-4.fc41.noarch). --- .gitignore | 2 +- python-pip.spec | 55 +++++++++++++++++++++++++++++++++++++------------ sources | 3 +++ 3 files changed, 46 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 8e24ed4..72d39d5 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ /pip/ /results_python-pip/ *.rpm - +*.whl diff --git a/python-pip.spec b/python-pip.spec index 6235e9f..78219b9 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -44,6 +44,28 @@ License: MIT AND Python-2.0.1 AND Apache-2.0 AND BSD-2-Clause AND BSD-3-C URL: https://pip.pypa.io/ Source0: https://github.com/pypa/pip/archive/%{upstream_version}/%{srcname}-%{upstream_version}.tar.gz +# The following sources are wheels used only for tests. +# They are not bundled in the built package and do not contribute to the overall license. +# They are pre-built but only contain text files, rebuilding them in %%build has very little benefit. + +# setuptools.whl +# We cannot use RPM-packaged python-setuptools-wheel because upstream pins to <80. +# See https://github.com/pypa/pip/pull/13357 for rationale. +Source1: https://files.pythonhosted.org/packages/0d/6d/b4752b044bf94cb802d88a888dc7d288baaf77d7910b7dedda74b5ceea0c/setuptools-79.0.1-py3-none-any.whl + +# wheel.whl +# We cannot use RPM-packaged python-wheel-wheel because we intent to drop that package in wheel 0.46+. +# That version of wheel has runtime dependencies and is generally useless as a standalone wheel. +# See https://github.com/pypa/pip/pull/13382 as an attempt to drop the requirement from pip tests. +Source2: https://files.pythonhosted.org/packages/0b/2c/87f3254fd8ffd29e4c02732eee68a83a1d3c346ae39bc6822dcbcb697f2b/wheel-0.45.1-py3-none-any.whl + +# coverage.whl +# There is no RPM-packaged python-coverage-wheel, the package is archful. +# Upstream uses this to measure coverage, which we don't. +# This is a dummy placeholder package that only contains empty coverage.process_startup(). +# That way, we don't need to patch the usage out of conftest.py. +Source3: coverage-0-py3-none-any.whl + BuildArch: noarch %if %{with tests} @@ -51,8 +73,7 @@ BuildRequires: /usr/bin/git BuildRequires: /usr/bin/hg BuildRequires: /usr/bin/bzr BuildRequires: /usr/bin/svn -BuildRequires: python-setuptools-wheel -BuildRequires: python-wheel-wheel +BuildRequires: python%{python3_pkgversion}-pytest-xdist %endif %if %{with man} @@ -190,9 +211,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 @@ -200,6 +218,12 @@ sed -i '/\.exe/d' pyproject.toml # Remove unused test requirements sed -Ei '/(pytest-(cov|xdist|rerunfailures)|proxy\.py)/d' tests/requirements.txt +%if %{with tests} +# tests expect wheels in here +mkdir tests/data/common_wheels +cp -a %{SOURCE1} %{SOURCE2} %{SOURCE3} tests/data/common_wheels +%endif + %if %{with tests} %generate_buildrequires @@ -272,15 +296,20 @@ grep "pem$" %{pyproject_files} && exit 1 || true # Upstream tests # bash completion tests only work from installed package pytest_k='not completion' +# this clashes with our PYTHONPATH +pytest_k="$pytest_k and not environments_with_no_pip" +# this seems to require internet (despite no network marker) +# added in https://github.com/pypa/pip/pull/13378 TODO drop this in the next release +pytest_k="$pytest_k and not test_prompt_for_keyring_if_needed and not test_double_install_fail and not test_install_sdist_links and not test_lock_vcs and not test_lock_archive and not test_backend_sees_config_via_sdist" +# this cannot import breezy, TODO investigate +pytest_k="$pytest_k and not (functional and bazaar)" +# failures to investigate +pytest_k="$pytest_k and not test_all_fields and not test_report_mixed_not_found and not test_basic_show" # "Editable project location" missing +pytest_k="$pytest_k and not test_basic_install_from_wheel" +pytest_k="$pytest_k and not test_check_unsupported" -# --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 +%pytest -n auto -m 'not network' -k "$(echo $pytest_k)" \ + --ignore tests/functional/test_proxy.py # no proxy.py in Fedora %endif diff --git a/sources b/sources index 8c41529..4c3846d 100644 --- a/sources +++ b/sources @@ -1 +1,4 @@ SHA512 (pip-25.1.1.tar.gz) = ce61c9861265139b3c5ea9be9dc246097cd75c21687cf8301f80a377d02420c4524f0d6307d2ca0232ff8715b1105343bcfdb9cac6b69503780ab2c4645558dc +SHA512 (setuptools-79.0.1-py3-none-any.whl) = fef6cfc6f95a5bb7320f1680e1c665cb8d9a4e4227cde4d8aab8a50bed4bcf04320085b9d7d5343359f887008db5c5a861e57f3d08b7b0b2311a28adaeee6b4a +SHA512 (wheel-0.45.1-py3-none-any.whl) = 86c16248ec804ee0ac95d43b03d47351dceb534d0cdc4025ca1eb073e39e539de44c870b9261f0373144e1537f0e42675a759a318a8d5d346bbd9efcb704061d +SHA512 (coverage-0-py3-none-any.whl) = e734192565347010efe68f8ba600254259c9b647f3c553fd4e5d87b1d7f955cb15d6f7d807716f4a6415d239beed945fbec7210feaf502e9cc849c332845926e From 8e291b0b6ca0895ccb6c870c4f9bdc0a56e38a2c Mon Sep 17 00:00:00 2001 From: Python Maint Date: Mon, 2 Jun 2025 11:23:07 +0200 Subject: [PATCH 12/34] Bootstrap for Python 3.14 --- python-pip.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python-pip.spec b/python-pip.spec index 78219b9..1035dbe 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -1,3 +1,5 @@ +%global _without_tests 1 +%global _without_man 1 # The original RHEL N+1 content set is defined by (build)dependencies # of the packages in Fedora ELN. Hence we disable tests here # to prevent pulling many unwanted packages in. From b0472d2883529db994ba95664ba9196e48d62162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 16 Jun 2025 11:01:07 +0200 Subject: [PATCH 13/34] Rebuilt for Python 3.14 - Fix test failures - Fixes: rhbz#2335909 --- python-pip.spec | 6 ++-- python3.14-file-urls.patch | 67 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 python3.14-file-urls.patch diff --git a/python-pip.spec b/python-pip.spec index 1035dbe..29f46b3 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -1,5 +1,3 @@ -%global _without_tests 1 -%global _without_man 1 # The original RHEL N+1 content set is defined by (build)dependencies # of the packages in Fedora ELN. Hence we disable tests here # to prevent pulling many unwanted packages in. @@ -102,6 +100,10 @@ Patch: dummy-certifi.patch # this warning is juts moot. Also, the warning breaks CPython test suite. Patch: nowarn-pip._internal.main.patch +# Adjust path_to_url et al. to produce the same results on Python 3.14+ +# https://github.com/pypa/pip/pull/13423 +Patch: python3.14-file-urls.patch + # Remove -s from Python shebang - ensure that packages installed with pip # to user locations are seen by pip itself %undefine _py3_shebang_s diff --git a/python3.14-file-urls.patch b/python3.14-file-urls.patch new file mode 100644 index 0000000..77e89de --- /dev/null +++ b/python3.14-file-urls.patch @@ -0,0 +1,67 @@ +From 03b4b94a0338d80d1f45697a5ea083a5e5c937db Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Thu, 12 Jun 2025 23:36:24 +0200 +Subject: [PATCH] Adjust path_to_url et al. to produce the same results on + Python 3.14+ + +See https://github.com/python/cpython/issues/125974 +and https://github.com/pypa/pip/pull/13138#issuecomment-2567715303 +--- + src/pip/_internal/models/link.py | 6 +++++- + src/pip/_internal/utils/urls.py | 2 +- + tests/unit/test_urls.py | 2 +- + 3 files changed, 7 insertions(+), 3 deletions(-) + +diff --git a/src/pip/_internal/models/link.py b/src/pip/_internal/models/link.py +index f0560f6..38423d1 100644 +--- a/src/pip/_internal/models/link.py ++++ b/src/pip/_internal/models/link.py +@@ -4,6 +4,7 @@ import logging + import os + import posixpath + import re ++import sys + import urllib.parse + from dataclasses import dataclass + from typing import ( +@@ -134,7 +135,10 @@ def _clean_file_url_path(part: str) -> str: + # should not be quoted. On Linux where drive letters do not + # exist, the colon should be quoted. We rely on urllib.request + # to do the right thing here. +- return urllib.request.pathname2url(urllib.request.url2pathname(part)) ++ ret = urllib.request.pathname2url(urllib.request.url2pathname(part)) ++ if sys.version_info >= (3, 14): ++ ret = ret.removeprefix("//") ++ return ret + + + # percent-encoded: / +diff --git a/src/pip/_internal/utils/urls.py b/src/pip/_internal/utils/urls.py +index 9f34f88..e951a5e 100644 +--- a/src/pip/_internal/utils/urls.py ++++ b/src/pip/_internal/utils/urls.py +@@ -12,7 +12,7 @@ def path_to_url(path: str) -> str: + quoted path parts. + """ + path = os.path.normpath(os.path.abspath(path)) +- url = urllib.parse.urljoin("file:", urllib.request.pathname2url(path)) ++ url = urllib.parse.urljoin("file://", urllib.request.pathname2url(path)) + return url + + +diff --git a/tests/unit/test_urls.py b/tests/unit/test_urls.py +index 0c14525..2a56e45 100644 +--- a/tests/unit/test_urls.py ++++ b/tests/unit/test_urls.py +@@ -11,7 +11,7 @@ from pip._internal.utils.urls import path_to_url, url_to_path + def test_path_to_url_unix() -> None: + assert path_to_url("/tmp/file") == "file:///tmp/file" + path = os.path.join(os.getcwd(), "file") +- assert path_to_url("file") == "file://" + urllib.request.pathname2url(path) ++ assert path_to_url("file") == "file://" + path + + + @pytest.mark.skipif("sys.platform != 'win32'") +-- +2.49.0 + From 2b190b00bf65d1898b73b6b770eeb94270b24ef5 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Thu, 19 Jun 2025 14:06:18 +0200 Subject: [PATCH 14/34] We don't want to run tests on EPEL by default It adds unwanted complexity, and in some alternative stacks the dependencies are not available. [skip changelog] --- python-pip.spec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python-pip.spec b/python-pip.spec index 29f46b3..0690d01 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -1,8 +1,7 @@ # The original RHEL N+1 content set is defined by (build)dependencies # of the packages in Fedora ELN. Hence we disable tests here # to prevent pulling many unwanted packages in. -# We intentionally keep this enabled on EPEL. -%bcond tests %[%{defined fedora} || %{defined epel}] +%bcond tests %{defined fedora} # Whether to build the manual pages (useful for bootstrapping Sphinx) %bcond man 1 From 1ae923743179e226ab75e08f9035c8fba6666bfb Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Thu, 19 Jun 2025 14:08:00 +0200 Subject: [PATCH 15/34] Macronize the Python version of the bundled provides We build it in alternative Python stacks and want it to pick up the redefined %{python3_pkgversion}. For main Python it evaluates to 3, meaning no change in Fedora proper. It will result in a smaller diff when creating alternative package definitions. [skip changelog] --- python-pip.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python-pip.spec b/python-pip.spec index 0690d01..9b1e25e 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -178,7 +178,7 @@ BuildRequires: ca-certificates Requires: ca-certificates # Virtual provides for the packages bundled by pip: -%{bundled 3} +%{bundled %{python3_pkgversion}} Provides: pip = %{version}-%{release} Conflicts: python-pip < %{version}-%{release} @@ -195,7 +195,7 @@ Summary: The pip wheel Requires: ca-certificates # Virtual provides for the packages bundled by pip: -%{bundled 3} +%{bundled %{python3_pkgversion}} # This is only relevant for Pythons that are older than 3.12 and don't use their own bundled wheels # It is also only relevant when this wheel is shared across multiple Pythons From 6c37700fd567226cefad01baee145c15741ec410 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Thu, 19 Jun 2025 14:14:06 +0200 Subject: [PATCH 16/34] Remove the obsolete Conflicts from the Python 2 -> 3 transition [skip changelog] --- python-pip.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/python-pip.spec b/python-pip.spec index 9b1e25e..4d3221a 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -181,7 +181,6 @@ Requires: ca-certificates %{bundled %{python3_pkgversion}} Provides: pip = %{version}-%{release} -Conflicts: python-pip < %{version}-%{release} %description -n python%{python3_pkgversion}-%{srcname} pip is a package management system used to install and manage software packages From 435a2e9aa1eaad128aed2d6ad0e9ad8bc525dc30 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Thu, 19 Jun 2025 15:06:04 +0200 Subject: [PATCH 17/34] Use the short -t CLI option for sphinx-build The long options were added in Sphinx 7.3.0, which is not available in RHEL 9 and 10. The short option works for each of the currently supported systems. Ref: https://www.sphinx-doc.org/en/master/changes/7.3.html [skip changelog] --- python-pip.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pip.spec b/python-pip.spec index 4d3221a..ec68d37 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -240,7 +240,7 @@ export PYTHONPATH=./src/ %pyproject_wheel %if %{with man} -sphinx-build --tag man -b man -d docs/build/doctrees/man -c docs/html docs/man docs/build/man +sphinx-build -t man -b man -d docs/build/doctrees/man -c docs/html docs/man docs/build/man %endif From 5802dc6818d2387677ad31f3f51c52835836df23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 20 Jun 2025 19:12:08 +0200 Subject: [PATCH 18/34] Handle alternate executable names for cases this isn't the main Python This is based on work in https://gitlab.com/redhat/centos-stream/rpms/python3.12-pip/-/commit/f1b86318fc6f21d5514fb7933172798cb4ea3db4 and https://src.fedoraproject.org/rpms/python-pip/pull-request/71 (not merged) With one notable difference: The Bash completion function has no dot in it now. I believe that having a dot in it breaks it: https://issues.redhat.com/browse/RHEL-99083 [skip changelog] --- python-pip.spec | 59 ++++++++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 23 deletions(-) diff --git a/python-pip.spec b/python-pip.spec index ec68d37..055999d 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -249,13 +249,28 @@ export PYTHONPATH=./src/ %pyproject_install %pyproject_save_files -l pip +# We'll install pip as pip3.X +# Later we'll provide symbolic links, manpage links and bashcompletion fixes for alternative names +%if "%{python3_pkgversion}" == "3" +%global alternate_names pip-%{python3_version} pip-3 pip3 pip +%else +%global alternate_names pip-%{python3_version} +%endif + +# Provide symlinks to executables +mv %{buildroot}%{_bindir}/pip %{buildroot}%{_bindir}/pip%{python3_version} +rm %{buildroot}%{_bindir}/pip3 +for pip in %{alternate_names}; do +ln -s ./pip%{python3_version} %{buildroot}%{_bindir}/$pip +done + %if %{with man} pushd docs/build/man install -d %{buildroot}%{_mandir}/man1 for MAN in *1; do -install -pm0644 $MAN %{buildroot}%{_mandir}/man1/$MAN -for pip in "pip3" "pip-3" "pip%{python3_version}" "pip-%{python3_version}"; do -echo ".so $MAN" > %{buildroot}%{_mandir}/man1/${MAN/pip/$pip} +install -pm0644 $MAN %{buildroot}%{_mandir}/man1/${MAN/pip/pip%{python3_version}} +for pip in %{alternate_names}; do +echo ".so ${MAN/pip/pip%{python3_version}}" > %{buildroot}%{_mandir}/man1/${MAN/pip/$pip} done done popd @@ -263,19 +278,13 @@ popd mkdir -p %{buildroot}%{bash_completions_dir} PYTHONPATH=%{buildroot}%{python3_sitelib} \ - %{buildroot}%{_bindir}/pip completion --bash \ - > %{buildroot}%{bash_completions_dir}/pip3 - -# Make bash completion apply to all the 5 symlinks we install -sed -i -e "s/^\\(complete.*\\) pip\$/\\1 pip pip{,-}{3,%{python3_version}}/" \ - -e s/_pip_completion/_pip3_completion/ \ - %{buildroot}%{bash_completions_dir}/pip3 - - -# Provide symlinks to executables to comply with Fedora guidelines for Python -ln -s ./pip%{python3_version} %{buildroot}%{_bindir}/pip-%{python3_version} -ln -s ./pip-%{python3_version} %{buildroot}%{_bindir}/pip-3 + %{buildroot}%{_bindir}/pip%{python3_version} completion --bash \ + > %{buildroot}%{bash_completions_dir}/pip%{python3_version} +# Make bash completion apply to all alternate names symlinks we install +sed -i -e "s/^\\(complete.*\\) pip%{python3_version}\$/\\1 pip%{python3_version} %{alternate_names}/" \ + -e s/_pip_completion/_pip%{python3_version_nodots}_completion/ \ + %{buildroot}%{bash_completions_dir}/pip%{python3_version} mkdir -p %{buildroot}%{python_wheel_dir} install -p %{_pyproject_wheeldir}/%{python_wheel_name} -t %{buildroot}%{python_wheel_dir} @@ -290,9 +299,9 @@ grep "exe$" %{pyproject_files} && exit 1 || true grep "pem$" %{pyproject_files} && exit 1 || true # Verify we can at least run basic commands without crashing -%{py3_test_envvars} %{buildroot}%{_bindir}/pip --help -%{py3_test_envvars} %{buildroot}%{_bindir}/pip list -%{py3_test_envvars} %{buildroot}%{_bindir}/pip show pip +%{py3_test_envvars} %{buildroot}%{_bindir}/pip%{python3_version} --help +%{py3_test_envvars} %{buildroot}%{_bindir}/pip%{python3_version} list +%{py3_test_envvars} %{buildroot}%{_bindir}/pip%{python3_version} show pip %if %{with tests} # Upstream tests @@ -318,18 +327,22 @@ pytest_k="$pytest_k and not test_check_unsupported" %files -n python%{python3_pkgversion}-%{srcname} -f %{pyproject_files} %doc README.rst %if %{with man} -%{_mandir}/man1/pip.* -%{_mandir}/man1/pip-*.* -%{_mandir}/man1/pip3.* -%{_mandir}/man1/pip3-*.* +%if "%{python3_pkgversion}" == "3" +%{_mandir}/man1/pip{,3,-3}.1.* +%{_mandir}/man1/pip{,3,-3}-[^3]*.1.* %endif +%{_mandir}/man1/pip{,-}%{python3_version}.1.* +%{_mandir}/man1/pip{,-}%{python3_version}-*.1.* +%endif +%if "%{python3_pkgversion}" == "3" %{_bindir}/pip %{_bindir}/pip3 %{_bindir}/pip-3 +%endif %{_bindir}/pip%{python3_version} %{_bindir}/pip-%{python3_version} %dir %{bash_completions_dir} -%{bash_completions_dir}/pip3 +%{bash_completions_dir}/pip%{python3_version} %files -n %{python_wheel_pkg_prefix}-%{srcname}-wheel From c61c7b352ccc2d71cab41decb4d0ed0a99f6f1a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 25 Mar 2025 15:14:31 +0100 Subject: [PATCH 19/34] Use /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem - https://fedoraproject.org/wiki/Changes/dropingOfCertPemFile --- dummy-certifi.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dummy-certifi.patch b/dummy-certifi.patch index 371a74c..01e8756 100644 --- a/dummy-certifi.patch +++ b/dummy-certifi.patch @@ -23,7 +23,7 @@ index 70e0c3b..eaf4210 100644 +# The RPM-packaged certifi always uses the system certificates +def where() -> str: -+ return '/etc/pki/tls/certs/ca-bundle.crt' ++ return '/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem' -if sys.version_info >= (3, 11): From 685d136d854f58a5e432f65142e1df9cb1b08f5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zachar?= Date: Thu, 3 Jul 2025 07:58:05 +0200 Subject: [PATCH 20/34] CI: Test bash completion Originally generated by CursorAI, manually edited. [skip changelog] --- tests/bash_completion/main.fmf | 35 ++++++ .../pip_completion_full_test.sh | 88 +++++++++++++ tests/bash_completion/test_pip_completion.exp | 117 ++++++++++++++++++ tests/tests.yml | 4 + 4 files changed, 244 insertions(+) create mode 100644 tests/bash_completion/main.fmf create mode 100755 tests/bash_completion/pip_completion_full_test.sh create mode 100755 tests/bash_completion/test_pip_completion.exp diff --git a/tests/bash_completion/main.fmf b/tests/bash_completion/main.fmf new file mode 100644 index 0000000..cde6f68 --- /dev/null +++ b/tests/bash_completion/main.fmf @@ -0,0 +1,35 @@ +summary: PIP bash completion functionality smoke test +description: | + Comprehensive test for pip bash completion functionality on Fedora/RHEL systems. + + The test performs the following steps: + 1. Finds the bash completion script in the given (e.g. python3-pip) RPM package + 2. Discovers all pip executables in the package (e.g. /usr/bin/pip and /usr/bin/pip3.14) + 3. Sources the completion script and verifies completion for all executables is registered + 4. Runs functional TAB completion tests using expect (for regular and POSIX mode of Bash) + 5. Validates that completion works for basic pip commands + + This is a smoke test to ensure pip bash completion is properly + installed and functional after package installation. + +component: + - python3-pip + +test: ./pip_completion_full_test.sh + +framework: shell + +duration: 5m +tier: 1 + + +require: + - python3-pip + - bash-completion + - expect + - rpm + - bash + + +environment: + PACKAGE: python3-pip diff --git a/tests/bash_completion/pip_completion_full_test.sh b/tests/bash_completion/pip_completion_full_test.sh new file mode 100755 index 0000000..94fcdb9 --- /dev/null +++ b/tests/bash_completion/pip_completion_full_test.sh @@ -0,0 +1,88 @@ +#!/bin/bash + +# Comprehensive PIP bash completion test for RHEL +# Finds completion scripts from RPM, tests all pip binaries, and runs functional tests + +PACKAGE="${PACKAGE:-python3-pip}" + + +# Step 1: Find bash completion scripts in python3-pip RPM package +echo "Step 1: Finding bash completion scripts in $PACKAGE RPM package..." + +COMPLETION_FILE=$(rpm -ql $PACKAGE 2>/dev/null | grep -E "/usr/share/bash-completion/completions/" || true) + +if [[ -z "$COMPLETION_FILE" ]]; then + echo "✗ No bash completion files found in $PACKAGE package" + exit 1 +fi + +# Check if there's exactly one completion file +COMPLETION_FILE_COUNT=$(echo "$COMPLETION_FILE" | wc -l) + +if [[ $COMPLETION_FILE_COUNT -gt 1 ]]; then + echo "✗ Multiple bash completion files found in $PACKAGE package:" + echo "$COMPLETION_FILE" | sed 's/^/ - /' + echo "Expected exactly one completion file, found $COMPLETION_FILE_COUNT" + exit 1 +fi + + +echo "✓ Found completion file from $PACKAGE package:" +echo "$COMPLETION_FILE" | sed 's/^/ - /' + +# Step 2: Find all pip binaries +echo +echo "Step 2: Finding all pip binaries..." +PIP_BINARIES=() +PIP_FILES=$(rpm -ql $PACKAGE | grep /bin/p) +for pip_file in $PIP_FILES; do + if [[ -x "$pip_file" ]]; then + pip_cmd=$(basename "$pip_file") + PIP_BINARIES+=("$pip_cmd") + echo "✓ Found: $pip_cmd -> $pip_file" + fi +done + +if [[ ${#PIP_BINARIES[@]} -eq 0 ]]; then + echo "✗ No pip binaries found" + exit 1 +fi + +echo "Total pip binaries found: ${#PIP_BINARIES[@]}" + +# Step 3: Source completion scripts and test each binary +echo +echo "Step 3: Testing completion for each pip binary..." + +for AS_POSIX in 0 1; do + if [[ $AS_POSIX -eq 1 ]]; then + echo "Testing in POSIX mode" + POSIX="--posix" + else + echo "Testing in non-POSIX mode" + POSIX="" + fi + + echo "Sourcing: $COMPLETION_FILE" + if bash --norc $POSIX -c "source $COMPLETION_FILE" ; then + echo "✓ Successfully sourced $COMPLETION_FILE" + else + echo "! Warning: Failed to source $COMPLETION_FILE" + exit 1 + fi + + export AS_POSIX + for pip_exec in "${PIP_BINARIES[@]}"; do + echo "Running expect test with $COMPLETION_FILE and $pip_exec..." + if ./test_pip_completion.exp "$COMPLETION_FILE" "$pip_exec"; then + echo "✓ Functional test passed" + else + echo "✗ Functional test failed" + exit 1 + fi + done + +done + + +echo "✓ All tests completed successfully!" diff --git a/tests/bash_completion/test_pip_completion.exp b/tests/bash_completion/test_pip_completion.exp new file mode 100755 index 0000000..4389174 --- /dev/null +++ b/tests/bash_completion/test_pip_completion.exp @@ -0,0 +1,117 @@ +#!/usr/bin/expect -f + +# PIP bash completion smoke test using expect +# Tests actual TAB completion functionality +# Usage: test_pip_completion.exp [completion_file] [pip_binary] + +set timeout 5 + + +set completion_file [lindex $argv 0] +set pip_exec [lindex $argv 1] + + +puts "=== PIP Bash Completion Test (using expect) ===" +puts "Testing completion file: $completion_file" +puts "Testing pip binary: $pip_exec" + +# Check if completion file exists first +if {![file exists $completion_file]} { + puts "✗ Completion file not found: $completion_file" + exit 1 +} +puts "✓ Completion file found: $completion_file" + +# Start bash shell +if {[info exists env(AS_POSIX)] && $env(AS_POSIX) == "1"} { + spawn bash --norc --posix +} else { + spawn bash --norc +} +expect "$ " + +# Source the completion file +send "source $completion_file\r" +expect "$ " +puts "Attempted to source completion file" + +# Test 1: Basic pip command completion +puts "\nTest 1: Testing '$pip_exec ' + TAB completion..." +send "$pip_exec " +sleep 0.1 +# Send TAB TAB using hex codes +send "\x09\x09" +expect { + -re "(install|uninstall|list|show)" { + puts "✓ Basic pip commands found in completion" + expect "$ " + } + -re "Display all" { + puts "✓ Completion showing options menu" + send "n\r" + expect "$ " + } + timeout { + puts "✗ Timeout waiting for completion - test failed" + exit 1 + } +} + +# Clear the line and ensure clean prompt +send "\x03" +expect "$ " +send "\r" +expect "$ " + +# Test 2: Test partial command completion (simpler test) +puts "\nTest 2: Testing '$pip_exec insta' + TAB completion..." +send "$pip_exec insta" +sleep 0.1 +# Single TAB for completion +send "\x09" +expect { + -re "install" { + puts "✓ Partial command completion works (insta -> install)" + expect "$ " + } + timeout { + puts "✗ Timeout on partial completion test - test failed" + exit 1 + } +} + +# Clear the line and ensure clean prompt +send "\x03" +expect "$ " +send "\r" +expect "$ " + +# Test 3: Test help completion +puts "\nTest 3: Testing '$pip_exec --' + TAB completion..." +send "$pip_exec --" +sleep 0.1 +send "\x09\x09" +expect { + -re "(--help|--version)" { + puts "✓ Command options found in completion" + expect "$ " + } + timeout { + puts "✗ Timeout on options completion test - test failed" + exit 1 + } +} + +# Final cleanup - make sure we're at clean prompt +send "\x03" +expect "$ " +send "\r" +expect "$ " + +# Exit bash cleanly +send "exit\r" +expect eof + +puts "\n=== Completion Test Complete ===" +puts "PIP bash completion functionality tested!" + diff --git a/tests/tests.yml b/tests/tests.yml index b2347e3..d1ff148 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -73,6 +73,9 @@ dir: pyproject-rpm-macros/tests run: ./mocktest.sh python-clikit - pip_install_upgrade + - bash_completion: + dir: tests/bash_completion + run: ./pip_completion_full_test.sh required_packages: - gcc - virtualenv @@ -91,3 +94,4 @@ - grep - util-linux - shadow-utils + - expect From cea7bb935ff44be641518aa5e12f90fb0ff1357e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 22 Jul 2025 11:45:35 +0200 Subject: [PATCH 21/34] Use /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem even in truststore - https://fedoraproject.org/wiki/Changes/dropingOfCertPemFile - Fixes: rhbz#2380441 --- python-pip.spec | 4 ++++ truststore-pem-path.patch | 26 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 truststore-pem-path.patch diff --git a/python-pip.spec b/python-pip.spec index 055999d..cc3f013 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -103,6 +103,10 @@ Patch: nowarn-pip._internal.main.patch # https://github.com/pypa/pip/pull/13423 Patch: python3.14-file-urls.patch +# https://fedoraproject.org/wiki/Changes/dropingOfCertPemFile +# https://github.com/sethmlarson/truststore/pull/183 +Patch: truststore-pem-path.patch + # Remove -s from Python shebang - ensure that packages installed with pip # to user locations are seen by pip itself %undefine _py3_shebang_s diff --git a/truststore-pem-path.patch b/truststore-pem-path.patch new file mode 100644 index 0000000..f771a33 --- /dev/null +++ b/truststore-pem-path.patch @@ -0,0 +1,26 @@ +From 2c8231f03987daaf9524f9568884a7b296480b32 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Thu, 17 Jul 2025 09:50:35 +0200 +Subject: [PATCH] Fedora 43 removes some symbolic links + +See https://fedoraproject.org/wiki/Changes/dropingOfCertPemFile +--- + src/pip/_vendor/truststore/_openssl.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/pip/_vendor/truststore/_openssl.py b/src/pip/_vendor/truststore/_openssl.py +index 9951cf7..3e25a56 100644 +--- a/src/pip/_vendor/truststore/_openssl.py ++++ b/src/pip/_vendor/truststore/_openssl.py +@@ -6,8 +6,10 @@ + + # candidates based on https://github.com/tiran/certifi-system-store by Christian Heimes + _CA_FILE_CANDIDATES = [ +- # Alpine, Arch, Fedora 34+, OpenWRT, RHEL 9+, BSD ++ # Alpine, Arch, Fedora 34-42, OpenWRT, RHEL 9-10, BSD + "/etc/ssl/cert.pem", ++ # Fedora 43+, RHEL 11+ ++ "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem", + # Fedora <= 34, RHEL <= 9, CentOS <= 9 + "/etc/pki/tls/cert.pem", + # Debian, Ubuntu (requires ca-certificates) From 69759f29723c829766e59e5b6b52ff5bc652c839 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 09:21:56 +0000 Subject: [PATCH 22/34] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From c830f0f9ae1466a7e72c70bd6d44612ce8c507d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zachar?= Date: Mon, 28 Jul 2025 17:57:26 +0200 Subject: [PATCH 23/34] CI: Drop STI and use tmt instead Use 'discovery --how shell' for bash completion test as well, even though it contains metadata, to be same as all other migrated plans. Resolves: rhbz#2383041 [skip changelog] --- .fmf/version | 1 + plan.fmf | 104 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/tests.yml | 97 -------------------------------------------- 3 files changed, 105 insertions(+), 97 deletions(-) create mode 100644 .fmf/version create mode 100644 plan.fmf delete mode 100644 tests/tests.yml diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/plan.fmf b/plan.fmf new file mode 100644 index 0000000..79f9d9c --- /dev/null +++ b/plan.fmf @@ -0,0 +1,104 @@ +execute: + how: tmt + +discover: + - name: tests_python + how: shell + url: https://src.fedoraproject.org/tests/python.git + tests: + - name: smoke36 + path: /smoke + test: VERSION=3.6 TOX=false ./venv.sh + - name: smoke39 + path: /smoke + test: VERSION=3.9 ./venv.sh + - name: smoke310 + path: /smoke + test: VERSION=3.10 ./venv.sh + - name: smoke311 + path: /smoke + test: VERSION=3.11 ./venv.sh + - name: smoke312 + path: /smoke + test: VERSION=3.12 ./venv.sh + - name: smoke313 + path: /smoke + test: VERSION=3.13 ./venv.sh + - name: smoke314 + path: /smoke + test: VERSION=3.14 ./venv.sh + - name: smoke39_virtualenv + path: /smoke + test: VERSION=3.9 METHOD=virtualenv ./venv.sh + - name: smoke310_virtualenv + path: /smoke + test: VERSION=3.10 METHOD=virtualenv ./venv.sh + - name: smoke311_virtualenv + path: /smoke + test: VERSION=3.11 METHOD=virtualenv ./venv.sh + - name: smoke312_virtualenv + path: /smoke + test: VERSION=3.12 METHOD=virtualenv ./venv.sh + - name: smoke313_virtualenv + path: /smoke + test: VERSION=3.13 METHOD=virtualenv ./venv.sh + - name: smoke314_virtualenv + path: /smoke + test: VERSION=3.14 METHOD=virtualenv ./venv.sh + - 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_entrypoints + path: /tests + test: ./mocktest.sh python-entrypoints + - name: pyproject_pluggy + path: /tests + test: ./mocktest.sh python-pluggy + - name: pyproject_clikit + path: /tests + test: ./mocktest.sh python-clikit + - name: same_repo + how: shell + dist-git-source: true + dist-git-download-only: true + tests: + - name: mock_bootstrap_build + test: | + cd $TMT_SOURCE_DIR && + $TMT_TREE/../discover/rpms_pyproject-rpm-macros/tests/tests/mocktest.sh python-pip --without tests --without man + - name: pip_install_upgrade + path: /tests/pip_install_upgrade/ + test: ./runtest.sh + - name: bash_completion + path: /tests/bash_completion + test: ./pip_completion_full_test.sh +prepare: + - name: Install dependencies + how: install + package: + - gcc + - virtualenv + - python3.6 + - python3.9 + - python3.10-devel + - python3.11-devel + - python3.12-devel + - python3.13-devel + - python3.14-devel + - python3-devel + - python3-tox + - mock + - rpmdevtools + - rpm-build + - grep + - util-linux + - shadow-utils + - expect + - dnf + - name: Update packages + how: shell + script: dnf upgrade -y diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index d1ff148..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,97 +0,0 @@ ---- -- hosts: localhost - tags: - - classic - pre_tasks: - - import_role: - name: standard-test-source - vars: - fetch_only: True - - roles: - - role: standard-test-basic - tags: - - classic - 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: - - smoke36: - dir: python/smoke - run: VERSION=3.6 TOX=false ./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 - - smoke39_virtualenv: - dir: python/smoke - run: VERSION=3.9 METHOD=virtualenv ./venv.sh - - smoke310_virtualenv: - dir: python/smoke - run: VERSION=3.10 METHOD=virtualenv ./venv.sh - - smoke311_virtualenv: - dir: python/smoke - run: VERSION=3.11 METHOD=virtualenv ./venv.sh - - smoke312_virtualenv: - dir: python/smoke - run: VERSION=3.12 METHOD=virtualenv ./venv.sh - - smoke313_virtualenv: - dir: python/smoke - run: VERSION=3.13 METHOD=virtualenv ./venv.sh - - smoke314_virtualenv: - dir: python/smoke - run: VERSION=3.14 METHOD=virtualenv ./venv.sh - - mock_bootstrap_build: - dir: . - run: pyproject-rpm-macros/tests/mocktest.sh python-pip --without tests --without man - - pyproject_pytest: - dir: pyproject-rpm-macros/tests - run: ./mocktest.sh python-pytest - - pyproject_entrypoints: - dir: pyproject-rpm-macros/tests - run: ./mocktest.sh python-entrypoints - - pyproject_pluggy: - dir: pyproject-rpm-macros/tests - run: ./mocktest.sh python-pluggy - - pyproject_clikit: - dir: pyproject-rpm-macros/tests - run: ./mocktest.sh python-clikit - - pip_install_upgrade - - bash_completion: - dir: tests/bash_completion - run: ./pip_completion_full_test.sh - required_packages: - - gcc - - virtualenv - - python3.6 - - python3.9 - - python3.10-devel - - python3.11-devel - - python3.12-devel - - python3.13-devel - - python3.14-devel - - python3-devel - - python3-tox - - mock - - rpmdevtools - - rpm-build - - grep - - util-linux - - shadow-utils - - expect From 13d07e4daf7999d9be8595d9db9ddafd0af6479e Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 15 Aug 2025 14:23:19 +0200 Subject: [PATCH 24/34] Rebuilt for Python 3.14.0rc2 bytecode From 3a83d6ce5d289434a11516e18c5cee8dd0873449 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Thu, 7 Aug 2025 15:40:40 +0200 Subject: [PATCH 25/34] Update to 25.2 (rhbz#2385294) Drop nowarn-pip._internal.main.patch as the warning is no longer emitted via ensurepip in Fedora Pythons. --- downstream-remove-pytest-subket.patch | 54 +++++++++++++ dummy-certifi.patch | 49 +++--------- nowarn-pip._internal.main.patch | 79 ------------------- python-pip.spec | 43 +++++----- python3.14-file-urls.patch | 67 ---------------- ...existing-dist-only-if-path-conflicts.patch | 30 +++---- sources | 2 +- 7 files changed, 100 insertions(+), 224 deletions(-) create mode 100644 downstream-remove-pytest-subket.patch delete mode 100644 nowarn-pip._internal.main.patch delete mode 100644 python3.14-file-urls.patch diff --git a/downstream-remove-pytest-subket.patch b/downstream-remove-pytest-subket.patch new file mode 100644 index 0000000..564794c --- /dev/null +++ b/downstream-remove-pytest-subket.patch @@ -0,0 +1,54 @@ +From 35378ae02912d704d466e4809070e17a8d13ad0a Mon Sep 17 00:00:00 2001 +From: Karolina Surma +Date: Thu, 7 Aug 2025 15:05:34 +0200 +Subject: [PATCH] Downstream-Only: Remove pytest-subket from tests + +--- + tests/conftest.py | 17 ----------------- + 1 file changed, 17 deletions(-) + +diff --git a/tests/conftest.py b/tests/conftest.py +index c98b871..ada7a7e 100644 +--- a/tests/conftest.py ++++ b/tests/conftest.py +@@ -451,18 +451,6 @@ def coverage_install( + return _common_wheel_editable_install(tmpdir_factory, common_wheels, "coverage") + + +-@pytest.fixture(scope="session") +-def socket_install(tmpdir_factory: pytest.TempPathFactory, common_wheels: Path) -> Path: +- lib_dir = _common_wheel_editable_install( +- tmpdir_factory, common_wheels, "pytest_subket" +- ) +- # pytest-subket is only included so it can intercept and block unexpected +- # network requests. It should NOT be visible to the pip under test. +- dist_info = next(lib_dir.glob("*.dist-info")) +- shutil.rmtree(dist_info) +- return lib_dir +- +- + def install_pth_link( + venv: VirtualEnvironment, project_name: str, lib_dir: Path + ) -> None: +@@ -480,7 +468,6 @@ def virtualenv_template( + setuptools_install: Path, + wheel_install: Path, + coverage_install: Path, +- socket_install: Path, + ) -> VirtualEnvironment: + venv_type: VirtualEnvironmentType + if request.config.getoption("--use-venv"): +@@ -495,10 +482,6 @@ def virtualenv_template( + # Install setuptools, wheel, pytest-subket, and pip. + install_pth_link(venv, "setuptools", setuptools_install) + install_pth_link(venv, "wheel", wheel_install) +- install_pth_link(venv, "pytest_subket", socket_install) +- # Also copy pytest-subket's .pth file so it can intercept socket calls. +- with open(venv.site / "pytest_socket.pth", "w") as f: +- f.write(socket_install.joinpath("pytest_socket.pth").read_text()) + + pth, dist_info = pip_editable_parts + +-- +2.50.1 + diff --git a/dummy-certifi.patch b/dummy-certifi.patch index 01e8756..ce34415 100644 --- a/dummy-certifi.patch +++ b/dummy-certifi.patch @@ -1,17 +1,17 @@ -From 0741e5a665308184ddbd20900f92e4417204092f Mon Sep 17 00:00:00 2001 +From 7b5fbac83944e3a0dd975ff17b69358791b68721 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Thu, 27 Jun 2024 10:38:53 +0200 Subject: [PATCH] Dummy certifi patch --- - src/pip/_vendor/certifi/core.py | 110 ++------------------------------ - 1 file changed, 6 insertions(+), 104 deletions(-) + src/pip/_vendor/certifi/core.py | 80 +++------------------------------ + 1 file changed, 6 insertions(+), 74 deletions(-) diff --git a/src/pip/_vendor/certifi/core.py b/src/pip/_vendor/certifi/core.py -index 70e0c3b..eaf4210 100644 +index 2f2f7e0..bec6595 100644 --- a/src/pip/_vendor/certifi/core.py +++ b/src/pip/_vendor/certifi/core.py -@@ -4,111 +4,13 @@ certifi.py +@@ -4,80 +4,12 @@ certifi.py This module returns the installation location of cacert.pem or its contents. """ @@ -20,13 +20,13 @@ index 70e0c3b..eaf4210 100644 -def exit_cacert_ctx() -> None: - _CACERT_CTX.__exit__(None, None, None) # type: ignore[union-attr] - +# The RPM-packaged certifi always uses the system certificates +def where() -> str: + return '/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem' --if sys.version_info >= (3, 11): +-if sys.version_info >= (3, 11): +- - from importlib.resources import as_file, files - - _CACERT_CTX = None @@ -60,7 +60,7 @@ index 70e0c3b..eaf4210 100644 - def contents() -> str: - return files("pip._vendor.certifi").joinpath("cacert.pem").read_text(encoding="ascii") - --elif sys.version_info >= (3, 7): +-else: - - from importlib.resources import path as get_path, read_text - @@ -95,40 +95,9 @@ index 70e0c3b..eaf4210 100644 - - def contents() -> str: - return read_text("pip._vendor.certifi", "cacert.pem", encoding="ascii") -- --else: -- import os -- import types -- from typing import Union -- -- Package = Union[types.ModuleType, str] -- Resource = Union[str, "os.PathLike"] -- -- # This fallback will work for Python versions prior to 3.7 that lack the -- # importlib.resources module but relies on the existing `where` function -- # so won't address issues with environments like PyOxidizer that don't set -- # __file__ on modules. -- def read_text( -- package: Package, -- resource: Resource, -- encoding: str = 'utf-8', -- errors: str = 'strict' -- ) -> str: -- with open(where(), encoding=encoding) as data: -- return data.read() -- -- # If we don't have importlib.resources, then we will just do the old logic -- # of assuming we're on the filesystem and munge the path directly. -- def where() -> str: -- f = os.path.dirname(__file__) -- -- return os.path.join(f, "cacert.pem") -- -- def contents() -> str: -- return read_text("pip._vendor.certifi", "cacert.pem", encoding="ascii") +def contents() -> str: + with open(where(), encoding='utf=8') as data: + return data.read() -- -2.45.1 +2.50.1 diff --git a/nowarn-pip._internal.main.patch b/nowarn-pip._internal.main.patch deleted file mode 100644 index c8c98ed..0000000 --- a/nowarn-pip._internal.main.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 9d1e0a0e91cad143702b3a2d8c54bd765a5d9eb2 Mon Sep 17 00:00:00 2001 -From: Karolina Surma -Date: Thu, 27 Jun 2024 10:48:03 +0200 -Subject: [PATCH] Don't warn the user about pip._internal.main() entrypoint - -In Fedora, we use that in ensurepip and users cannot do anything about it, -this warning is juts moot. Also, the warning breaks CPython test suite. - -Co-Authored-By: =?UTF-8?q?Miro=20Hron=C4=8Dok?= ---- - src/pip/_internal/__init__.py | 2 +- - src/pip/_internal/utils/entrypoints.py | 19 ++++++++++--------- - tests/functional/test_cli.py | 3 ++- - 3 files changed, 13 insertions(+), 11 deletions(-) - -diff --git a/src/pip/_internal/__init__.py b/src/pip/_internal/__init__.py -index 1a5b7f8..682b9e4 100755 ---- a/src/pip/_internal/__init__.py -+++ b/src/pip/_internal/__init__.py -@@ -15,4 +15,4 @@ def main(args: Optional[List[str]] = None) -> int: - """ - from pip._internal.utils.entrypoints import _wrapper - -- return _wrapper(args) -+ return _wrapper(args, _nowarn=True) -diff --git a/src/pip/_internal/utils/entrypoints.py b/src/pip/_internal/utils/entrypoints.py -index 1501369..70034eb 100644 ---- a/src/pip/_internal/utils/entrypoints.py -+++ b/src/pip/_internal/utils/entrypoints.py -@@ -20,7 +20,7 @@ if WINDOWS: - ] - - --def _wrapper(args: Optional[List[str]] = None) -> int: -+def _wrapper(args: Optional[List[str]] = None, _nowarn: bool = False) -> int: - """Central wrapper for all old entrypoints. - - Historically pip has had several entrypoints defined. Because of issues -@@ -32,14 +32,15 @@ def _wrapper(args: Optional[List[str]] = None) -> int: - directing them to an appropriate place for help, we now define all of - our old entrypoints as wrappers for the current one. - """ -- sys.stderr.write( -- "WARNING: pip is being invoked by an old script wrapper. This will " -- "fail in a future version of pip.\n" -- "Please see https://github.com/pypa/pip/issues/5599 for advice on " -- "fixing the underlying issue.\n" -- "To avoid this problem you can invoke Python with '-m pip' instead of " -- "running pip directly.\n" -- ) -+ if not _nowarn: -+ sys.stderr.write( -+ "WARNING: pip is being invoked by an old script wrapper. This will " -+ "fail in a future version of pip.\n" -+ "Please see https://github.com/pypa/pip/issues/5599 for advice on " -+ "fixing the underlying issue.\n" -+ "To avoid this problem you can invoke Python with '-m pip' instead of " -+ "running pip directly.\n" -+ ) - return main(args) - - -diff --git a/tests/functional/test_cli.py b/tests/functional/test_cli.py -index e1ccf04..30b8f74 100644 ---- a/tests/functional/test_cli.py -+++ b/tests/functional/test_cli.py -@@ -49,7 +49,8 @@ def test_entrypoints_work(entrypoint: str, script: PipTestEnvironment) -> None: - result = script.pip("-V") - result2 = script.run("fake_pip", "-V", allow_stderr_warning=True) - assert result.stdout == result2.stdout -- assert "old script wrapper" in result2.stderr -+ if entrypoint[0] != "fake_pip = pip._internal:main": -+ assert "old script wrapper" in result2.stderr - - - @pytest.mark.parametrize( --- -2.45.1 - diff --git a/python-pip.spec b/python-pip.spec index cc3f013..fdea020 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -6,7 +6,7 @@ %bcond man 1 %global srcname pip -%global base_version 25.1.1 +%global base_version 25.2 %global upstream_version %{base_version}%{?prerel} %global python_wheel_name %{srcname}-%{upstream_version}-py3-none-any.whl @@ -36,7 +36,6 @@ Summary: A tool for installing and managing Python packages # truststore: MIT # tomli: MIT # tomli-w: MIT -# typing-extensions: Python-2.0.1 # urllib3: MIT License: MIT AND Python-2.0.1 AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MPL-2.0 AND (Apache-2.0 OR BSD-2-Clause) @@ -94,19 +93,15 @@ Patch: remove-existing-dist-only-if-path-conflicts.patch # The same patch is a part of the RPM-packaged python-certifi Patch: dummy-certifi.patch -# Don't warn the user about pip._internal.main() entrypoint -# In Fedora, we use that in ensurepip and users cannot do anything about it, -# this warning is juts moot. Also, the warning breaks CPython test suite. -Patch: nowarn-pip._internal.main.patch - -# Adjust path_to_url et al. to produce the same results on Python 3.14+ -# https://github.com/pypa/pip/pull/13423 -Patch: python3.14-file-urls.patch - # https://fedoraproject.org/wiki/Changes/dropingOfCertPemFile # https://github.com/sethmlarson/truststore/pull/183 Patch: truststore-pem-path.patch +# pytest-subket has been introduced to intercept network calls +# https://github.com/pypa/pip/commit/a4b40f62332ccb3228b12cc5ae1493c75177247a +# We don't need a layer to check that, as we're by default in an offline environment +Patch: downstream-remove-pytest-subket.patch + # Remove -s from Python shebang - ensure that packages installed with pip # to user locations are seen by pip itself %undefine _py3_shebang_s @@ -123,25 +118,24 @@ Packages" or "Pip Installs Python". # You can generate it with: # %%{_rpmconfigdir}/pythonbundles.py --namespace 'python%%{1}dist' src/pip/_vendor/vendor.txt %global bundled() %{expand: -Provides: bundled(python%{1}dist(cachecontrol)) = 0.14.2 -Provides: bundled(python%{1}dist(certifi)) = 2025.1.31 +Provides: bundled(python%{1}dist(cachecontrol)) = 0.14.3 +Provides: bundled(python%{1}dist(certifi)) = 2025.7.14 Provides: bundled(python%{1}dist(dependency-groups)) = 1.3.1 -Provides: bundled(python%{1}dist(distlib)) = 0.3.9 +Provides: bundled(python%{1}dist(distlib)) = 0.4 Provides: bundled(python%{1}dist(distro)) = 1.9 Provides: bundled(python%{1}dist(idna)) = 3.10 -Provides: bundled(python%{1}dist(msgpack)) = 1.1 +Provides: bundled(python%{1}dist(msgpack)) = 1.1.1 Provides: bundled(python%{1}dist(packaging)) = 25 -Provides: bundled(python%{1}dist(platformdirs)) = 4.3.7 -Provides: bundled(python%{1}dist(pygments)) = 2.19.1 +Provides: bundled(python%{1}dist(platformdirs)) = 4.3.8 +Provides: bundled(python%{1}dist(pygments)) = 2.19.2 Provides: bundled(python%{1}dist(pyproject-hooks)) = 1.2 -Provides: bundled(python%{1}dist(requests)) = 2.32.3 -Provides: bundled(python%{1}dist(resolvelib)) = 1.1 -Provides: bundled(python%{1}dist(rich)) = 14 +Provides: bundled(python%{1}dist(requests)) = 2.32.4 +Provides: bundled(python%{1}dist(resolvelib)) = 1.2 +Provides: bundled(python%{1}dist(rich)) = 14.1 Provides: bundled(python%{1}dist(setuptools)) = 70.3 Provides: bundled(python%{1}dist(tomli)) = 2.2.1 Provides: bundled(python%{1}dist(tomli-w)) = 1.2 Provides: bundled(python%{1}dist(truststore)) = 0.10.1 -Provides: bundled(python%{1}dist(typing-extensions)) = 4.13.2 Provides: bundled(python%{1}dist(urllib3)) = 1.26.20 } @@ -222,7 +216,10 @@ rm -v src/pip/_vendor/distlib/*.exe sed -i '/\.exe/d' pyproject.toml # Remove unused test requirements -sed -Ei '/(pytest-(cov|xdist|rerunfailures)|proxy\.py)/d' tests/requirements.txt +sed -Ei '/(pytest-(cov|xdist|rerunfailures|subket)|proxy\.py)/d' pyproject.toml + +# Remove unused pytest-subket options +sed -Ei '/(--disable-socket|--allow-unix-socket|--allow-hosts=localhost)/d' pyproject.toml %if %{with tests} # tests expect wheels in here @@ -235,7 +232,7 @@ cp -a %{SOURCE1} %{SOURCE2} %{SOURCE3} tests/data/common_wheels %generate_buildrequires # we only use this to generate test requires # the "pyproject" part is explicitly disabled as it generates a requirement on pip -%pyproject_buildrequires -N tests/requirements.txt +%pyproject_buildrequires -N -g test %endif diff --git a/python3.14-file-urls.patch b/python3.14-file-urls.patch deleted file mode 100644 index 77e89de..0000000 --- a/python3.14-file-urls.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 03b4b94a0338d80d1f45697a5ea083a5e5c937db Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= -Date: Thu, 12 Jun 2025 23:36:24 +0200 -Subject: [PATCH] Adjust path_to_url et al. to produce the same results on - Python 3.14+ - -See https://github.com/python/cpython/issues/125974 -and https://github.com/pypa/pip/pull/13138#issuecomment-2567715303 ---- - src/pip/_internal/models/link.py | 6 +++++- - src/pip/_internal/utils/urls.py | 2 +- - tests/unit/test_urls.py | 2 +- - 3 files changed, 7 insertions(+), 3 deletions(-) - -diff --git a/src/pip/_internal/models/link.py b/src/pip/_internal/models/link.py -index f0560f6..38423d1 100644 ---- a/src/pip/_internal/models/link.py -+++ b/src/pip/_internal/models/link.py -@@ -4,6 +4,7 @@ import logging - import os - import posixpath - import re -+import sys - import urllib.parse - from dataclasses import dataclass - from typing import ( -@@ -134,7 +135,10 @@ def _clean_file_url_path(part: str) -> str: - # should not be quoted. On Linux where drive letters do not - # exist, the colon should be quoted. We rely on urllib.request - # to do the right thing here. -- return urllib.request.pathname2url(urllib.request.url2pathname(part)) -+ ret = urllib.request.pathname2url(urllib.request.url2pathname(part)) -+ if sys.version_info >= (3, 14): -+ ret = ret.removeprefix("//") -+ return ret - - - # percent-encoded: / -diff --git a/src/pip/_internal/utils/urls.py b/src/pip/_internal/utils/urls.py -index 9f34f88..e951a5e 100644 ---- a/src/pip/_internal/utils/urls.py -+++ b/src/pip/_internal/utils/urls.py -@@ -12,7 +12,7 @@ def path_to_url(path: str) -> str: - quoted path parts. - """ - path = os.path.normpath(os.path.abspath(path)) -- url = urllib.parse.urljoin("file:", urllib.request.pathname2url(path)) -+ url = urllib.parse.urljoin("file://", urllib.request.pathname2url(path)) - return url - - -diff --git a/tests/unit/test_urls.py b/tests/unit/test_urls.py -index 0c14525..2a56e45 100644 ---- a/tests/unit/test_urls.py -+++ b/tests/unit/test_urls.py -@@ -11,7 +11,7 @@ from pip._internal.utils.urls import path_to_url, url_to_path - def test_path_to_url_unix() -> None: - assert path_to_url("/tmp/file") == "file:///tmp/file" - path = os.path.join(os.getcwd(), "file") -- assert path_to_url("file") == "file://" + urllib.request.pathname2url(path) -+ assert path_to_url("file") == "file://" + path - - - @pytest.mark.skipif("sys.platform != 'win32'") --- -2.49.0 - diff --git a/remove-existing-dist-only-if-path-conflicts.patch b/remove-existing-dist-only-if-path-conflicts.patch index 20e5f28..d280f34 100644 --- a/remove-existing-dist-only-if-path-conflicts.patch +++ b/remove-existing-dist-only-if-path-conflicts.patch @@ -1,8 +1,11 @@ -From 9020f56e88a7dbaef688c147c281909f95b4e1d1 Mon Sep 17 00:00:00 2001 +From d5cb806a14bb50a96484bca6536e81f2ac316b9d Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Wed, 16 Feb 2022 08:36:21 +0100 Subject: [PATCH] Prevent removing of the system packages installed under /usr/lib when pip install --upgrade is executed. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit Resolves: rhbz#1550368 @@ -12,7 +15,6 @@ Co-Authored-By: Petr Viktorin Co-Authored-By: Lumir Balhar Co-Authored-By: Miro Hrončok Co-Authored-By: Karolina Surma - --- src/pip/_internal/metadata/base.py | 12 +++++++++++- src/pip/_internal/req/req_install.py | 2 +- @@ -21,10 +23,10 @@ Co-Authored-By: Karolina Surma 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/pip/_internal/metadata/base.py b/src/pip/_internal/metadata/base.py -index 9eabcdb..9816691 100644 +index 230e114..8bd5d31 100644 --- a/src/pip/_internal/metadata/base.py +++ b/src/pip/_internal/metadata/base.py -@@ -28,7 +28,7 @@ from pip._vendor.packaging.utils import NormalizedName, canonicalize_name +@@ -23,7 +23,7 @@ from pip._vendor.packaging.utils import NormalizedName, canonicalize_name from pip._vendor.packaging.version import Version from pip._internal.exceptions import NoneMetadataError @@ -33,7 +35,7 @@ index 9eabcdb..9816691 100644 from pip._internal.models.direct_url import ( DIRECT_URL_METADATA_NAME, DirectUrl, -@@ -578,6 +578,16 @@ class BaseDistribution(Protocol): +@@ -575,6 +575,16 @@ class BaseDistribution(Protocol): for extra in self._iter_egg_info_extras(): metadata["Provides-Extra"] = extra @@ -51,10 +53,10 @@ index 9eabcdb..9816691 100644 class BaseEnvironment: """An environment containing distributions to introspect.""" diff --git a/src/pip/_internal/req/req_install.py b/src/pip/_internal/req/req_install.py -index 2132785..0340890 100644 +index c9f6bff..c101826 100644 --- a/src/pip/_internal/req/req_install.py +++ b/src/pip/_internal/req/req_install.py -@@ -449,7 +449,7 @@ class InstallRequirement: +@@ -453,7 +453,7 @@ class InstallRequirement: f"lack sys.path precedence to {existing_dist.raw_name} " f"in {existing_dist.location}" ) @@ -64,10 +66,10 @@ index 2132785..0340890 100644 else: if self.editable: diff --git a/src/pip/_internal/resolution/legacy/resolver.py b/src/pip/_internal/resolution/legacy/resolver.py -index 1dd0d70..414bdbe 100644 +index 33a4fdc..1fe886e 100644 --- a/src/pip/_internal/resolution/legacy/resolver.py +++ b/src/pip/_internal/resolution/legacy/resolver.py -@@ -319,7 +319,9 @@ class Resolver(BaseResolver): +@@ -322,7 +322,9 @@ class Resolver(BaseResolver): # Don't uninstall the conflict if doing a user install and the # conflict is not a user install. assert req.satisfied_by is not None @@ -79,19 +81,19 @@ index 1dd0d70..414bdbe 100644 req.satisfied_by = None diff --git a/src/pip/_internal/resolution/resolvelib/factory.py b/src/pip/_internal/resolution/resolvelib/factory.py -index 1f31d83..3804774 100644 +index f23e4cd..1bada79 100644 --- a/src/pip/_internal/resolution/resolvelib/factory.py +++ b/src/pip/_internal/resolution/resolvelib/factory.py -@@ -1,6 +1,8 @@ +@@ -3,6 +3,8 @@ from __future__ import annotations import contextlib import functools import logging +import sys +import sysconfig + from collections.abc import Iterable, Iterator, Mapping, Sequence from typing import ( TYPE_CHECKING, - Callable, -@@ -617,6 +619,16 @@ class Factory: +@@ -615,6 +617,16 @@ class Factory: if dist is None: # Not installed, no uninstallation required. return None @@ -109,5 +111,5 @@ index 1f31d83..3804774 100644 # be uninstalled, no matter it's in global or user site, because the # user site installation has precedence over global. -- -2.45.1 +2.50.1 diff --git a/sources b/sources index 4c3846d..7230ff9 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ -SHA512 (pip-25.1.1.tar.gz) = ce61c9861265139b3c5ea9be9dc246097cd75c21687cf8301f80a377d02420c4524f0d6307d2ca0232ff8715b1105343bcfdb9cac6b69503780ab2c4645558dc +SHA512 (pip-25.2.tar.gz) = 5cc65c9091fdda7905e26ce32ddaa3a1c2fd287d69fd3da67c814ba7e8e5be59301d8327c06cdca78c1b95f4a5b5f75c87f36a549022408cc0e8f9411c0db11e SHA512 (setuptools-79.0.1-py3-none-any.whl) = fef6cfc6f95a5bb7320f1680e1c665cb8d9a4e4227cde4d8aab8a50bed4bcf04320085b9d7d5343359f887008db5c5a861e57f3d08b7b0b2311a28adaeee6b4a SHA512 (wheel-0.45.1-py3-none-any.whl) = 86c16248ec804ee0ac95d43b03d47351dceb534d0cdc4025ca1eb073e39e539de44c870b9261f0373144e1537f0e42675a759a318a8d5d346bbd9efcb704061d SHA512 (coverage-0-py3-none-any.whl) = e734192565347010efe68f8ba600254259c9b647f3c553fd4e5d87b1d7f955cb15d6f7d807716f4a6415d239beed945fbec7210feaf502e9cc849c332845926e From e2a1a1a9947c6f5b6ceff1148f2e32fe57249ee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 27 Aug 2025 16:52:27 +0200 Subject: [PATCH 26/34] Include SBOM in the .whl file in python-pip-wheel --- python-pip.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python-pip.spec b/python-pip.spec index fdea020..91369d3 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -287,8 +287,10 @@ sed -i -e "s/^\\(complete.*\\) pip%{python3_version}\$/\\1 pip%{python3_version} -e s/_pip_completion/_pip%{python3_version_nodots}_completion/ \ %{buildroot}%{bash_completions_dir}/pip%{python3_version} +# Install the built wheel and inject SBOM into it (if the macro is available) mkdir -p %{buildroot}%{python_wheel_dir} install -p %{_pyproject_wheeldir}/%{python_wheel_name} -t %{buildroot}%{python_wheel_dir} +%{?python_wheel_inject_sbom:%python_wheel_inject_sbom %{buildroot}%{python_wheel_dir}/%{python_wheel_name}} %check From 8ddd39d6cd1ba1ee38a8ee0e8a31a511807b2b80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 10 Sep 2025 19:11:16 +0200 Subject: [PATCH 27/34] Security fix for the bundled urllib3 for CVE-2025-50181 --- python-pip.spec | 5 ++++ urllib3-CVE-2025-50181.patch | 51 ++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 urllib3-CVE-2025-50181.patch diff --git a/python-pip.spec b/python-pip.spec index 91369d3..de7e8db 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -102,6 +102,11 @@ Patch: truststore-pem-path.patch # We don't need a layer to check that, as we're by default in an offline environment Patch: downstream-remove-pytest-subket.patch +# Patch for the bundled urllib3 for CVE-2025-50181 +# Redirects are not disabled when retries are disabled on PoolManager instantiation +# Upstream fix: https://github.com/urllib3/urllib3/commit/f05b1329126d5be6de501f9d1e3e36738bc08857 +Patch: urllib3-CVE-2025-50181.patch + # Remove -s from Python shebang - ensure that packages installed with pip # to user locations are seen by pip itself %undefine _py3_shebang_s diff --git a/urllib3-CVE-2025-50181.patch b/urllib3-CVE-2025-50181.patch new file mode 100644 index 0000000..05e6353 --- /dev/null +++ b/urllib3-CVE-2025-50181.patch @@ -0,0 +1,51 @@ +From b3d543d7e16af844394316360ef1bf0b9d10f1b1 Mon Sep 17 00:00:00 2001 +From: Illia Volochii +Date: Wed, 18 Jun 2025 16:25:01 +0300 +Subject: [PATCH] Security fix for CVE-2025-50181 + +Co-authored-by: Seth Michael Larson +Co-authored-by: Quentin Pradet +Co-authored-by: Seth Michael Larson +--- + src/pip/_vendor/urllib3/poolmanager.py | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +diff --git a/src/pip/_vendor/urllib3/poolmanager.py b/src/pip/_vendor/urllib3/poolmanager.py +index fb51bf7..a8de7c6 100644 +--- a/src/pip/_vendor/urllib3/poolmanager.py ++++ b/src/pip/_vendor/urllib3/poolmanager.py +@@ -170,6 +170,22 @@ class PoolManager(RequestMethods): + + def __init__(self, num_pools=10, headers=None, **connection_pool_kw): + RequestMethods.__init__(self, headers) ++ if "retries" in connection_pool_kw: ++ retries = connection_pool_kw["retries"] ++ if not isinstance(retries, Retry): ++ # When Retry is initialized, raise_on_redirect is based ++ # on a redirect boolean value. ++ # But requests made via a pool manager always set ++ # redirect to False, and raise_on_redirect always ends ++ # up being False consequently. ++ # Here we fix the issue by setting raise_on_redirect to ++ # a value needed by the pool manager without considering ++ # the redirect boolean. ++ raise_on_redirect = retries is not False ++ retries = Retry.from_int(retries, redirect=False) ++ retries.raise_on_redirect = raise_on_redirect ++ connection_pool_kw = connection_pool_kw.copy() ++ connection_pool_kw["retries"] = retries + self.connection_pool_kw = connection_pool_kw + self.pools = RecentlyUsedContainer(num_pools) + +@@ -389,7 +405,7 @@ class PoolManager(RequestMethods): + kw["body"] = None + kw["headers"] = HTTPHeaderDict(kw["headers"])._prepare_for_method_change() + +- retries = kw.get("retries") ++ retries = kw.get("retries", response.retries) + if not isinstance(retries, Retry): + retries = Retry.from_int(retries, redirect=redirect) + +-- +2.51.0 + From 29f78324d1c12504e4474156129441437ca1bfe0 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 27 Feb 2025 02:39:37 +0100 Subject: [PATCH 28/34] Remove testing of retired python3.8 from the CI See https://fedoraproject.org/wiki/Changes/RetirePython3.8 [skip changelog] (cherry picked from commit d681b5b429a32a5fd431eb6b37d9ade3474d947b) --- tests/tests.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/tests.yml b/tests/tests.yml index 02b7040..1448bc8 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -13,9 +13,6 @@ - smoke36: dir: python/smoke run: VERSION=3.6 TOX=false ./venv.sh - - smoke38: - dir: python/smoke - run: VERSION=3.8 ./venv.sh - smoke39: dir: python/smoke run: VERSION=3.9 ./venv.sh @@ -34,9 +31,6 @@ - smoke314: dir: python/smoke run: VERSION=3.14 ./venv.sh - - smoke38_virtualenv: - dir: python/smoke - run: VERSION=3.8 METHOD=virtualenv ./venv.sh - smoke39_virtualenv: dir: python/smoke run: VERSION=3.9 METHOD=virtualenv ./venv.sh @@ -72,7 +66,6 @@ - gcc - virtualenv - python3.6 - - python3.8 - python3.9 - python3.10-devel - python3.11-devel From 282d8747eee8fa90eb5aa3cd7a31fcf8ba5103f8 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 6 Mar 2025 13:03:52 +0100 Subject: [PATCH 29/34] Fix CI tests to account for normalization of dist-info dirs (PEP 491) setuptools now normalizes the dist-info directory names to lowercase according to PEP 491 Also egg-info directories are not created anymore [skip changelog] (cherry picked from commit 97a9e3e2155364562c2438142982fbb7afb4629a) --- tests/pip_install_upgrade/runtest.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/pip_install_upgrade/runtest.sh b/tests/pip_install_upgrade/runtest.sh index 40e14a3..4c520f5 100755 --- a/tests/pip_install_upgrade/runtest.sh +++ b/tests/pip_install_upgrade/runtest.sh @@ -18,14 +18,14 @@ RPM_BUILD_ROOT=/ /usr/bin/pip install 'Pello==1.0.1' /usr/bin/pip freeze | grep '^Pello==1\.0\.2$' # Both installations should still exist -test -d "${RPM_SITELIB}/Pello-1.0.1-py${PYTHON_VERSION}.egg-info" || test -d "${RPM_SITELIB}/Pello-1.0.1.dist-info" +test -d "${RPM_SITELIB}/pello-1.0.1.dist-info" test -d "${LOCAL_SITELIB}/Pello-1.0.2.dist-info" # Let's ditch the local one /usr/bin/pip uninstall --yes Pello # It should only remove one of them -test -d "${RPM_SITELIB}/Pello-1.0.1-py${PYTHON_VERSION}.egg-info" || test -d "${RPM_SITELIB}/Pello-1.0.1.dist-info" +test -d "${RPM_SITELIB}/pello-1.0.1.dist-info" ! test -d "${LOCAL_SITELIB}/Pello-1.0.2.dist-info" # And pip should still see the RPM-installed one From 274c7d860e289bcfd8aa9d127fb76626733a0329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 10 Sep 2025 19:11:16 +0200 Subject: [PATCH 30/34] Security fix for the bundled urllib3 for CVE-2025-50181 --- python-pip.spec | 5 ++++ urllib3-CVE-2025-50181.patch | 51 ++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 urllib3-CVE-2025-50181.patch diff --git a/python-pip.spec b/python-pip.spec index 4e3a41d..6ac5f05 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -68,6 +68,11 @@ Patch: dummy-certifi.patch # this warning is juts moot. Also, the warning breaks CPython test suite. Patch: nowarn-pip._internal.main.patch +# Patch for the bundled urllib3 for CVE-2025-50181 +# Redirects are not disabled when retries are disabled on PoolManager instantiation +# Upstream fix: https://github.com/urllib3/urllib3/commit/f05b1329126d5be6de501f9d1e3e36738bc08857 +Patch: urllib3-CVE-2025-50181.patch + # Remove -s from Python shebang - ensure that packages installed with pip # to user locations are seen by pip itself %undefine _py3_shebang_s diff --git a/urllib3-CVE-2025-50181.patch b/urllib3-CVE-2025-50181.patch new file mode 100644 index 0000000..05e6353 --- /dev/null +++ b/urllib3-CVE-2025-50181.patch @@ -0,0 +1,51 @@ +From b3d543d7e16af844394316360ef1bf0b9d10f1b1 Mon Sep 17 00:00:00 2001 +From: Illia Volochii +Date: Wed, 18 Jun 2025 16:25:01 +0300 +Subject: [PATCH] Security fix for CVE-2025-50181 + +Co-authored-by: Seth Michael Larson +Co-authored-by: Quentin Pradet +Co-authored-by: Seth Michael Larson +--- + src/pip/_vendor/urllib3/poolmanager.py | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +diff --git a/src/pip/_vendor/urllib3/poolmanager.py b/src/pip/_vendor/urllib3/poolmanager.py +index fb51bf7..a8de7c6 100644 +--- a/src/pip/_vendor/urllib3/poolmanager.py ++++ b/src/pip/_vendor/urllib3/poolmanager.py +@@ -170,6 +170,22 @@ class PoolManager(RequestMethods): + + def __init__(self, num_pools=10, headers=None, **connection_pool_kw): + RequestMethods.__init__(self, headers) ++ if "retries" in connection_pool_kw: ++ retries = connection_pool_kw["retries"] ++ if not isinstance(retries, Retry): ++ # When Retry is initialized, raise_on_redirect is based ++ # on a redirect boolean value. ++ # But requests made via a pool manager always set ++ # redirect to False, and raise_on_redirect always ends ++ # up being False consequently. ++ # Here we fix the issue by setting raise_on_redirect to ++ # a value needed by the pool manager without considering ++ # the redirect boolean. ++ raise_on_redirect = retries is not False ++ retries = Retry.from_int(retries, redirect=False) ++ retries.raise_on_redirect = raise_on_redirect ++ connection_pool_kw = connection_pool_kw.copy() ++ connection_pool_kw["retries"] = retries + self.connection_pool_kw = connection_pool_kw + self.pools = RecentlyUsedContainer(num_pools) + +@@ -389,7 +405,7 @@ class PoolManager(RequestMethods): + kw["body"] = None + kw["headers"] = HTTPHeaderDict(kw["headers"])._prepare_for_method_change() + +- retries = kw.get("retries") ++ retries = kw.get("retries", response.retries) + if not isinstance(retries, Retry): + retries = Retry.from_int(retries, redirect=redirect) + +-- +2.51.0 + From 566ed62a196ae263b08efb11f1389b83153876c6 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 19 Sep 2025 13:59:29 +0200 Subject: [PATCH 31/34] Rebuilt for Python 3.14.0rc3 bytecode From 584939ebdd94304d085e21460ecb06063212713d Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Thu, 23 Oct 2025 15:14:18 +0200 Subject: [PATCH 32/34] CI: Run tests with Python 3.15 [skip changelog] --- plan.fmf | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plan.fmf b/plan.fmf index 79f9d9c..b336d72 100644 --- a/plan.fmf +++ b/plan.fmf @@ -27,6 +27,9 @@ discover: - name: smoke314 path: /smoke test: VERSION=3.14 ./venv.sh + - name: smoke315 + path: /smoke + test: VERSION=3.15 ./venv.sh - name: smoke39_virtualenv path: /smoke test: VERSION=3.9 METHOD=virtualenv ./venv.sh @@ -45,6 +48,9 @@ discover: - name: smoke314_virtualenv path: /smoke test: VERSION=3.14 METHOD=virtualenv ./venv.sh + - name: smoke315_virtualenv + path: /smoke + test: VERSION=3.15 METHOD=virtualenv ./venv.sh - name: rpms_pyproject-rpm-macros how: shell url: https://src.fedoraproject.org/rpms/pyproject-rpm-macros.git @@ -89,6 +95,7 @@ prepare: - python3.12-devel - python3.13-devel - python3.14-devel + - python3.15-devel - python3-devel - python3-tox - mock From 1f462a281f772282d8ade483860056f5175138c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Sun, 30 Nov 2025 10:13:45 +0100 Subject: [PATCH 33/34] CI: Ensure the devel subpackages for 3.6 and 3.9 are available See https://src.fedoraproject.org/rpms/python3.9/pull-request/213 and https://src.fedoraproject.org/rpms/python3.6/pull-request/153 [skip changelog] --- plan.fmf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plan.fmf b/plan.fmf index b336d72..72ad07b 100644 --- a/plan.fmf +++ b/plan.fmf @@ -88,8 +88,8 @@ prepare: package: - gcc - virtualenv - - python3.6 - - python3.9 + - python3.6-devel + - python3.9-devel - python3.10-devel - python3.11-devel - python3.12-devel From 2b2a030e77e9665b23c9b6d0e415556ec1b73a2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 28 Nov 2025 12:16:06 +0100 Subject: [PATCH 34/34] Update to 25.3 - Fixes: rhbz#2406299 --- python-pip.spec | 32 ++++++++++++++++---------------- sources | 3 ++- truststore-pem-path.patch | 26 -------------------------- 3 files changed, 18 insertions(+), 43 deletions(-) delete mode 100644 truststore-pem-path.patch diff --git a/python-pip.spec b/python-pip.spec index de7e8db..8dc0aff 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -6,7 +6,7 @@ %bcond man 1 %global srcname pip -%global base_version 25.2 +%global base_version 25.3 %global upstream_version %{base_version}%{?prerel} %global python_wheel_name %{srcname}-%{upstream_version}-py3-none-any.whl @@ -57,12 +57,16 @@ Source1: https://files.pythonhosted.org/packages/0d/6d/b4752b044bf94cb802 # See https://github.com/pypa/pip/pull/13382 as an attempt to drop the requirement from pip tests. Source2: https://files.pythonhosted.org/packages/0b/2c/87f3254fd8ffd29e4c02732eee68a83a1d3c346ae39bc6822dcbcb697f2b/wheel-0.45.1-py3-none-any.whl +# flit_core.whl +# This is not built as RPM-packaged wheel in Fedora at all. +Source3: https://files.pythonhosted.org/packages/f2/65/b6ba90634c984a4fcc02c7e3afe523fef500c4980fec67cc27536ee50acf/flit_core-3.12.0-py3-none-any.whl + # coverage.whl # There is no RPM-packaged python-coverage-wheel, the package is archful. # Upstream uses this to measure coverage, which we don't. # This is a dummy placeholder package that only contains empty coverage.process_startup(). # That way, we don't need to patch the usage out of conftest.py. -Source3: coverage-0-py3-none-any.whl +Source4: coverage-0-py3-none-any.whl BuildArch: noarch @@ -93,10 +97,6 @@ Patch: remove-existing-dist-only-if-path-conflicts.patch # The same patch is a part of the RPM-packaged python-certifi Patch: dummy-certifi.patch -# https://fedoraproject.org/wiki/Changes/dropingOfCertPemFile -# https://github.com/sethmlarson/truststore/pull/183 -Patch: truststore-pem-path.patch - # pytest-subket has been introduced to intercept network calls # https://github.com/pypa/pip/commit/a4b40f62332ccb3228b12cc5ae1493c75177247a # We don't need a layer to check that, as we're by default in an offline environment @@ -124,23 +124,23 @@ Packages" or "Pip Installs Python". # %%{_rpmconfigdir}/pythonbundles.py --namespace 'python%%{1}dist' src/pip/_vendor/vendor.txt %global bundled() %{expand: Provides: bundled(python%{1}dist(cachecontrol)) = 0.14.3 -Provides: bundled(python%{1}dist(certifi)) = 2025.7.14 +Provides: bundled(python%{1}dist(certifi)) = 2025.10.5 Provides: bundled(python%{1}dist(dependency-groups)) = 1.3.1 Provides: bundled(python%{1}dist(distlib)) = 0.4 Provides: bundled(python%{1}dist(distro)) = 1.9 Provides: bundled(python%{1}dist(idna)) = 3.10 -Provides: bundled(python%{1}dist(msgpack)) = 1.1.1 +Provides: bundled(python%{1}dist(msgpack)) = 1.1.2 Provides: bundled(python%{1}dist(packaging)) = 25 -Provides: bundled(python%{1}dist(platformdirs)) = 4.3.8 +Provides: bundled(python%{1}dist(platformdirs)) = 4.5 Provides: bundled(python%{1}dist(pygments)) = 2.19.2 Provides: bundled(python%{1}dist(pyproject-hooks)) = 1.2 -Provides: bundled(python%{1}dist(requests)) = 2.32.4 -Provides: bundled(python%{1}dist(resolvelib)) = 1.2 -Provides: bundled(python%{1}dist(rich)) = 14.1 +Provides: bundled(python%{1}dist(requests)) = 2.32.5 +Provides: bundled(python%{1}dist(resolvelib)) = 1.2.1 +Provides: bundled(python%{1}dist(rich)) = 14.2 Provides: bundled(python%{1}dist(setuptools)) = 70.3 -Provides: bundled(python%{1}dist(tomli)) = 2.2.1 +Provides: bundled(python%{1}dist(tomli)) = 2.3 Provides: bundled(python%{1}dist(tomli-w)) = 1.2 -Provides: bundled(python%{1}dist(truststore)) = 0.10.1 +Provides: bundled(python%{1}dist(truststore)) = 0.10.4 Provides: bundled(python%{1}dist(urllib3)) = 1.26.20 } @@ -175,7 +175,7 @@ BuildRequires: python%{python3_pkgversion}-devel # The minimal version is for bundled provides verification script BuildRequires: python3-rpm-generators >= 11-8 BuildRequires: pyproject-rpm-macros -BuildRequires: python%{python3_pkgversion}-setuptools +BuildRequires: python%{python3_pkgversion}-flit-core BuildRequires: bash-completion BuildRequires: ca-certificates Requires: ca-certificates @@ -229,7 +229,7 @@ sed -Ei '/(--disable-socket|--allow-unix-socket|--allow-hosts=localhost)/d' pypr %if %{with tests} # tests expect wheels in here mkdir tests/data/common_wheels -cp -a %{SOURCE1} %{SOURCE2} %{SOURCE3} tests/data/common_wheels +cp -a %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} tests/data/common_wheels %endif diff --git a/sources b/sources index 7230ff9..48867fb 100644 --- a/sources +++ b/sources @@ -1,4 +1,5 @@ -SHA512 (pip-25.2.tar.gz) = 5cc65c9091fdda7905e26ce32ddaa3a1c2fd287d69fd3da67c814ba7e8e5be59301d8327c06cdca78c1b95f4a5b5f75c87f36a549022408cc0e8f9411c0db11e +SHA512 (pip-25.3.tar.gz) = f50db092213ec3bb819d3da5669f73d119b5ec7f7ac5e8a587a17c27eafa32bc17a057df09389c526a3769ef3577f5553187d54ceffa89aed63f4b4498ff044e SHA512 (setuptools-79.0.1-py3-none-any.whl) = fef6cfc6f95a5bb7320f1680e1c665cb8d9a4e4227cde4d8aab8a50bed4bcf04320085b9d7d5343359f887008db5c5a861e57f3d08b7b0b2311a28adaeee6b4a SHA512 (wheel-0.45.1-py3-none-any.whl) = 86c16248ec804ee0ac95d43b03d47351dceb534d0cdc4025ca1eb073e39e539de44c870b9261f0373144e1537f0e42675a759a318a8d5d346bbd9efcb704061d +SHA512 (flit_core-3.12.0-py3-none-any.whl) = 790c12b1f43201e365fb3f8f2f0a54e1a578876799dfdf8bfeea679a25ea096bf62946d006618c1458ae6e37ce6d00998f37e9aba426d5ab80d32ef2d75da4e0 SHA512 (coverage-0-py3-none-any.whl) = e734192565347010efe68f8ba600254259c9b647f3c553fd4e5d87b1d7f955cb15d6f7d807716f4a6415d239beed945fbec7210feaf502e9cc849c332845926e diff --git a/truststore-pem-path.patch b/truststore-pem-path.patch deleted file mode 100644 index f771a33..0000000 --- a/truststore-pem-path.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 2c8231f03987daaf9524f9568884a7b296480b32 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= -Date: Thu, 17 Jul 2025 09:50:35 +0200 -Subject: [PATCH] Fedora 43 removes some symbolic links - -See https://fedoraproject.org/wiki/Changes/dropingOfCertPemFile ---- - src/pip/_vendor/truststore/_openssl.py | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/src/pip/_vendor/truststore/_openssl.py b/src/pip/_vendor/truststore/_openssl.py -index 9951cf7..3e25a56 100644 ---- a/src/pip/_vendor/truststore/_openssl.py -+++ b/src/pip/_vendor/truststore/_openssl.py -@@ -6,8 +6,10 @@ - - # candidates based on https://github.com/tiran/certifi-system-store by Christian Heimes - _CA_FILE_CANDIDATES = [ -- # Alpine, Arch, Fedora 34+, OpenWRT, RHEL 9+, BSD -+ # Alpine, Arch, Fedora 34-42, OpenWRT, RHEL 9-10, BSD - "/etc/ssl/cert.pem", -+ # Fedora 43+, RHEL 11+ -+ "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem", - # Fedora <= 34, RHEL <= 9, CentOS <= 9 - "/etc/pki/tls/cert.pem", - # Debian, Ubuntu (requires ca-certificates)