public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/python3.9] f44: Macronize and verify bundled() pip and setuptools provides
Date: Thu, 02 Jul 2026 14:03:57 GMT	[thread overview]
Message-ID: <178300103755.1.2149037420226521553.rpms-python3.9-e28ea4294041@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/python3.9
            Branch : f44
            Commit : e28ea4294041f47104e1faec6223914801c3e717
            Author : Miro Hrončok <miro@hroncok.cz>
            Date   : 2026-05-05T11:51:23+02:00
            Stats  : +75/-85 in 1 file(s)
            URL    : https://src.fedoraproject.org/rpms/python3.9/c/e28ea4294041f47104e1faec6223914801c3e717?branch=f44

            Log:
            Macronize and verify bundled() pip and setuptools provides

Cherry-picked from python3.12 commits:

6a47de8e840926ad08dabeb9928c0a6ecc90cac
6073e4f0062e4076028a803e3427a942009c0714
9dc158f0bf1a746d3d753e9dc02b5aa44fd65f23

Co-Authored-By: Karolina Surma <ksurma@redhat.com>

---
diff --git a/python3.9.spec b/python3.9.spec
index 9dea4a6..1494b27 100644
--- a/python3.9.spec
+++ b/python3.9.spec
@@ -38,7 +38,6 @@ Release: 9%{?dist}
 #   idna: BSD-3-Clause
 #   msgpack: Apache-2.0
 #   packaging: Apache-2.0 OR BSD-2-Clause
-#   pkg_resources: MIT
 #   platformdirs: MIT
 #   pygments: BSD-2-Clause
 #   pyparsing: MIT
@@ -46,6 +45,7 @@ Release: 9%{?dist}
 #   requests: Apache-2.0
 #   resolvelib: ISC
 #   rich: MIT
+#   setuptools (pkg_resources): MIT
 #   six: MIT
 #   tenacity: Apache-2.0
 #   tomli: MIT
@@ -75,6 +75,60 @@ License: Python-2.0.1
 License: Python-2.0.1 AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND LGPL-2.1-or-later AND LGPL-3.0-or-later AND MIT AND MPL-2.0 AND PSF-2.0 AND (Apache-2.0 OR BSD-2-Clause)
 %endif
 
+# If the rpmwheels condition is disabled, we use the bundled wheel packages
+# from Python with the versions below.
+%global pip_version 23.0.1
+%global setuptools_version 79.0.1
+# All of those also include a list of indirect bundled libs:
+# pip
+#  $ %%{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/ensurepip/_bundled/pip-*.whl pip/_vendor/vendor.txt)
+%global pip_bundled_provides %{expand:
+Provides: bundled(python3dist(cachecontrol)) = 0.12.11
+Provides: bundled(python3dist(certifi)) = 2022.12.7
+Provides: bundled(python3dist(chardet)) = 5.1
+Provides: bundled(python3dist(colorama)) = 0.4.6
+Provides: bundled(python3dist(distlib)) = 0.3.6
+Provides: bundled(python3dist(distro)) = 1.8
+Provides: bundled(python3dist(idna)) = 3.4
+Provides: bundled(python3dist(msgpack)) = 1.0.4
+Provides: bundled(python3dist(packaging)) = 21.3
+Provides: bundled(python3dist(platformdirs)) = 2.6.2
+Provides: bundled(python3dist(pygments)) = 2.13
+Provides: bundled(python3dist(pyparsing)) = 3.0.9
+Provides: bundled(python3dist(pyproject-hooks)) = 1
+Provides: bundled(python3dist(requests)) = 2.28.2
+Provides: bundled(python3dist(resolvelib)) = 0.8.1
+Provides: bundled(python3dist(rich)) = 12.6
+Provides: bundled(python3dist(setuptools)) = 44
+Provides: bundled(python3dist(six)) = 1.16
+Provides: bundled(python3dist(tenacity)) = 8.1
+Provides: bundled(python3dist(tomli)) = 2.0.1
+Provides: bundled(python3dist(typing-extensions)) = 4.4
+Provides: bundled(python3dist(urllib3)) = 1.26.14
+Provides: bundled(python3dist(webencodings)) = 0.5.1
+}
+# setuptools
+# vendor.txt not in .whl
+# %%{_rpmconfigdir}/pythonbundles.py <(unzip -l Lib/ensurepip/_bundled/setuptools-*.whl | grep -E '_vendor/.+dist-info/RECORD' | sed -E 's@^.*/([^-]+)-([^-]+)\.dist-info/.*$@\1==\2@')
+%global setuptools_bundled_provides %{expand:
+Provides: bundled(python3dist(autocommand)) = 2.2.2
+Provides: bundled(python3dist(backports-tarfile)) = 1.2
+Provides: bundled(python3dist(importlib-metadata)) = 8
+Provides: bundled(python3dist(inflect)) = 7.3.1
+Provides: bundled(python3dist(jaraco-collections)) = 5.1
+Provides: bundled(python3dist(jaraco-context)) = 5.3
+Provides: bundled(python3dist(jaraco-functools)) = 4.0.1
+Provides: bundled(python3dist(jaraco-text)) = 3.12.1
+Provides: bundled(python3dist(more-itertools)) = 10.3
+Provides: bundled(python3dist(packaging)) = 24.2
+Provides: bundled(python3dist(platformdirs)) = 4.2.2
+Provides: bundled(python3dist(tomli)) = 2.0.1
+Provides: bundled(python3dist(typeguard)) = 4.3
+Provides: bundled(python3dist(typing-extensions)) = 4.12.2
+Provides: bundled(python3dist(wheel)) = 0.45.1
+Provides: bundled(python3dist(zipp)) = 3.19.2
+}
+
 # ==================================
 # Conditionals controlling the build
 # ==================================
@@ -660,47 +714,10 @@ Summary:        Python runtime libraries
 Requires: python-setuptools-wheel
 Requires: python-pip-wheel
 %else
-Provides: bundled(python3dist(pip)) = 23.0.1
-Provides: bundled(python3dist(cachecontrol)) = 0.12.11
-Provides: bundled(python3dist(certifi)) = 2022.12.7
-Provides: bundled(python3dist(chardet)) = 5.1.0
-Provides: bundled(python3dist(colorama)) = 0.4.6
-Provides: bundled(python3dist(distlib)) = 0.3.6
-Provides: bundled(python3dist(distro)) = 1.8.0
-Provides: bundled(python3dist(idna)) = 3.4
-Provides: bundled(python3dist(msgpack)) = 1.0.4
-Provides: bundled(python3dist(packaging)) = 21.3
-Provides: bundled(python3dist(setuptools)) = 44.0.0
-Provides: bundled(python3dist(platformdirs)) = 2.6.2
-Provides: bundled(python3dist(pygments)) = 2.13.0
-Provides: bundled(python3dist(pyparsing)) = 3.0.9
-Provides: bundled(python3dist(pyproject-hooks)) = 1.0.0
-Provides: bundled(python3dist(requests)) = 2.28.2
-Provides: bundled(python3dist(resolvelib)) = 0.8.1
-Provides: bundled(python3dist(rich)) = 12.6.0
-Provides: bundled(python3dist(six)) = 1.16.0
-Provides: bundled(python3dist(tenacity)) = 8.1.0
-Provides: bundled(python3dist(tomli)) = 2.0.1
-Provides: bundled(python3dist(typing-extensions)) = 4.4.0
-Provides: bundled(python3dist(urllib3)) = 1.26.14
-Provides: bundled(python3dist(webencodings)) = 0.5.1
-Provides: bundled(python3dist(setuptools)) = 79.0.1
-Provides: bundled(python3dist(autocommand)) = 2.2.2
-Provides: bundled(python3dist(backports.tarfile)) = 1.2.0
-Provides: bundled(python3dist(importlib-metadata)) = 8.0.0
-Provides: bundled(python3dist(inflect)) = 7.3.1
-Provides: bundled(python3dist(jaraco.collections)) = 5.1.0
-Provides: bundled(python3dist(jaraco.context)) = 5.3.0
-Provides: bundled(python3dist(jaraco.functools)) = 4.0.1
-Provides: bundled(python3dist(jaraco.text)) = 3.12.1
-Provides: bundled(python3dist(more-itertools)) = 10.3.0
-Provides: bundled(python3dist(packaging)) = 24.2
-Provides: bundled(python3dist(platformdirs)) = 4.2.2
-Provides: bundled(python3dist(tomli)) = 2.0.1
-Provides: bundled(python3dist(typeguard)) = 4.3.0
-Provides: bundled(python3dist(typing-extensions)) = 4.12.2
-Provides: bundled(python3dist(wheel)) = 0.45.1
-Provides: bundled(python3dist(zipp)) = 3.19.2
+Provides: bundled(python3dist(pip)) = %{pip_version}
+%pip_bundled_provides
+Provides: bundled(python3dist(setuptools)) = %{setuptools_version}
+%setuptools_bundled_provides
 %endif
 
 # Provides for the bundled libmpdec
@@ -912,47 +929,10 @@ Obsoletes: python%{pyshortver} < %{version}-%{release}
 Requires: python-setuptools-wheel
 Requires: python-pip-wheel
 %else
-Provides: bundled(python3dist(pip)) = 23.0.1
-Provides: bundled(python3dist(cachecontrol)) = 0.12.11
-Provides: bundled(python3dist(certifi)) = 2022.12.7
-Provides: bundled(python3dist(chardet)) = 5.1.0
-Provides: bundled(python3dist(colorama)) = 0.4.6
-Provides: bundled(python3dist(distlib)) = 0.3.6
-Provides: bundled(python3dist(distro)) = 1.8.0
-Provides: bundled(python3dist(idna)) = 3.4
-Provides: bundled(python3dist(msgpack)) = 1.0.4
-Provides: bundled(python3dist(packaging)) = 21.3
-Provides: bundled(python3dist(setuptools)) = 44.0.0
-Provides: bundled(python3dist(platformdirs)) = 2.6.2
-Provides: bundled(python3dist(pygments)) = 2.13.0
-Provides: bundled(python3dist(pyparsing)) = 3.0.9
-Provides: bundled(python3dist(pyproject-hooks)) = 1.0.0
-Provides: bundled(python3dist(requests)) = 2.28.2
-Provides: bundled(python3dist(resolvelib)) = 0.8.1
-Provides: bundled(python3dist(rich)) = 12.6.0
-Provides: bundled(python3dist(six)) = 1.16.0
-Provides: bundled(python3dist(tenacity)) = 8.1.0
-Provides: bundled(python3dist(tomli)) = 2.0.1
-Provides: bundled(python3dist(typing-extensions)) = 4.4.0
-Provides: bundled(python3dist(urllib3)) = 1.26.14
-Provides: bundled(python3dist(webencodings)) = 0.5.1
-Provides: bundled(python3dist(setuptools)) = 79.0.1
-Provides: bundled(python3dist(autocommand)) = 2.2.2
-Provides: bundled(python3dist(backports.tarfile)) = 1.2.0
-Provides: bundled(python3dist(importlib-metadata)) = 8.0.0
-Provides: bundled(python3dist(inflect)) = 7.3.1
-Provides: bundled(python3dist(jaraco.collections)) = 5.1.0
-Provides: bundled(python3dist(jaraco.context)) = 5.3.0
-Provides: bundled(python3dist(jaraco.functools)) = 4.0.1
-Provides: bundled(python3dist(jaraco.text)) = 3.12.1
-Provides: bundled(python3dist(more-itertools)) = 10.3.0
-Provides: bundled(python3dist(packaging)) = 24.2
-Provides: bundled(python3dist(platformdirs)) = 4.2.2
-Provides: bundled(python3dist(tomli)) = 2.0.1
-Provides: bundled(python3dist(typeguard)) = 4.3.0
-Provides: bundled(python3dist(typing-extensions)) = 4.12.2
-Provides: bundled(python3dist(wheel)) = 0.45.1
-Provides: bundled(python3dist(zipp)) = 3.19.2
+Provides: bundled(python3dist(pip)) = %{pip_version}
+%pip_bundled_provides
+Provides: bundled(python3dist(setuptools)) = %{setuptools_version}
+%setuptools_bundled_provides
 %endif
 
 # Provides for the bundled libmpdec
@@ -991,12 +971,21 @@ that support it, such as CentOS or RHEL or older Fedora releases.
 %gpgverify -k2 -s1 -d0
 %autosetup -S git_am -N -n Python-%{upstream_version}
 
+# Verify the second level of bundled provides is up to date
+# Arguably this should be done in %%check, but %%prep has a faster feedback loop
+# setuptools.whl does not contain the vendored.txt files
+if [ -f %{_rpmconfigdir}/pythonbundles.py ]; then
+  %{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/ensurepip/_bundled/pip-*.whl pip/_vendor/vendor.txt) --compare-with '%pip_bundled_provides'
+  %{_rpmconfigdir}/pythonbundles.py <(unzip -l Lib/ensurepip/_bundled/setuptools-*.whl | grep -E '_vendor/.+dist-info/RECORD' | sed -E 's@^.*/([^-]+)-([^-]+)\.dist-info/.*$@\1==\2@') --compare-with '%setuptools_bundled_provides'
+fi
+
 # Apply patches up to 188
 %autopatch -M 188
 
 %if %{with rpmwheels}
 %autopatch 189
-rm Lib/ensurepip/_bundled/*.whl
+rm Lib/ensurepip/_bundled/pip-%{pip_version}-py3-none-any.whl
+rm Lib/ensurepip/_bundled/setuptools-%{setuptools_version}-py3-none-any.whl
 %endif
 
 # Apply the remaining patches
@@ -1608,7 +1597,8 @@ CheckPython optimized
 %exclude %{pylibdir}/ensurepip/_bundled
 %else
 %dir %{pylibdir}/ensurepip/_bundled
-%{pylibdir}/ensurepip/_bundled/*.whl
+%{pylibdir}/ensurepip/_bundled/pip-%{pip_version}-py3-none-any.whl
+%{pylibdir}/ensurepip/_bundled/setuptools-%{setuptools_version}-py3-none-any.whl
 %{pylibdir}/ensurepip/_bundled/__init__.py
 %{pylibdir}/ensurepip/_bundled/__pycache__/*%{bytecode_suffixes}
 %endif

                 reply	other threads:[~2026-07-02 14:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178300103755.1.2149037420226521553.rpms-python3.9-e28ea4294041@fedoraproject.org \
    --to=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox