From 3dcabb5165ed599d9df5522adc17e936c98893eb Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Thu, 27 Jun 2024 12:06:09 +0200 Subject: [PATCH] Update to 24.1.1 --- 12698.patch | 30 --------- dummy-certifi.patch | 26 +++++--- no-version-warning.patch | 16 ----- nowarn-pip._internal.main.patch | 19 +++--- python-pip.spec | 66 +++++++------------ ...existing-dist-only-if-path-conflicts.patch | 34 +++++----- sources | 2 +- 7 files changed, 68 insertions(+), 125 deletions(-) delete mode 100644 12698.patch delete mode 100644 no-version-warning.patch diff --git a/12698.patch b/12698.patch deleted file mode 100644 index 6251567..0000000 --- a/12698.patch +++ /dev/null @@ -1,30 +0,0 @@ -From a2b23ffd477dcd90de6f1cb1f4cb75e0229d0e16 Mon Sep 17 00:00:00 2001 -From: Richard Si -Date: Sat, 11 May 2024 13:26:30 -0400 -Subject: [PATCH] Also patch time.time_ns() in unit tests - -The logging implementation in Python 3.13.0b1 uses time.time_ns() instead -of time.time(). ---- - tests/unit/test_base_command.py | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/tests/unit/test_base_command.py b/tests/unit/test_base_command.py -index 80c93799d94..f9fae651422 100644 ---- a/tests/unit/test_base_command.py -+++ b/tests/unit/test_base_command.py -@@ -17,8 +17,12 @@ - - @pytest.fixture - def fixed_time() -> Iterator[None]: -- with patch("time.time", lambda: 1547704837.040001 + time.timezone): -- yield -+ # Patch time so logs contain a constant timestamp. time.time_ns is used by -+ # logging starting with Python 3.13. -+ year2019 = 1547704837.040001 + time.timezone -+ with patch("time.time", lambda: year2019): -+ with patch("time.time_ns", lambda: int(year2019 * 1e9)): -+ yield - - - class FakeCommand(Command): diff --git a/dummy-certifi.patch b/dummy-certifi.patch index 8896ce8..371a74c 100644 --- a/dummy-certifi.patch +++ b/dummy-certifi.patch @@ -1,30 +1,31 @@ -From 09c983fdeabe3fa0b90b73f32ddf84a61e498e09 Mon Sep 17 00:00:00 2001 +From 0741e5a665308184ddbd20900f92e4417204092f Mon Sep 17 00:00:00 2001 From: Karolina Surma -Date: Tue, 15 Nov 2022 09:22:46 +0100 +Date: Thu, 27 Jun 2024 10:38:53 +0200 Subject: [PATCH] Dummy certifi patch --- - src/pip/_vendor/certifi/core.py | 105 ++------------------------------ - 1 file changed, 6 insertions(+), 99 deletions(-) + src/pip/_vendor/certifi/core.py | 110 ++------------------------------ + 1 file changed, 6 insertions(+), 104 deletions(-) diff --git a/src/pip/_vendor/certifi/core.py b/src/pip/_vendor/certifi/core.py -index c3e5466..eb297f7 100644 +index 70e0c3b..eaf4210 100644 --- a/src/pip/_vendor/certifi/core.py +++ b/src/pip/_vendor/certifi/core.py -@@ -4,105 +4,12 @@ certifi.py +@@ -4,111 +4,13 @@ certifi.py This module returns the installation location of cacert.pem or its contents. """ -import sys +-import atexit + +-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/tls/certs/ca-bundle.crt' -if sys.version_info >= (3, 11): -+def contents() -> str: -+ with open(where(), encoding='utf=8') as data: -+ return data.read() - from importlib.resources import as_file, files - @@ -52,6 +53,7 @@ index c3e5466..eb297f7 100644 - # we will also store that at the global level as well. - _CACERT_CTX = as_file(files("pip._vendor.certifi").joinpath("cacert.pem")) - _CACERT_PATH = str(_CACERT_CTX.__enter__()) +- atexit.register(exit_cacert_ctx) - - return _CACERT_PATH - @@ -87,6 +89,7 @@ index c3e5466..eb297f7 100644 - # we will also store that at the global level as well. - _CACERT_CTX = get_path("pip._vendor.certifi", "cacert.pem") - _CACERT_PATH = str(_CACERT_CTX.__enter__()) +- atexit.register(exit_cacert_ctx) - - return _CACERT_PATH - @@ -123,6 +126,9 @@ index c3e5466..eb297f7 100644 - - 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.37.3 +2.45.1 diff --git a/no-version-warning.patch b/no-version-warning.patch deleted file mode 100644 index 6c34bec..0000000 --- a/no-version-warning.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/src/pip/_vendor/packaging/version.py b/src/pip/_vendor/packaging/version.py -index de9a09a..154e94d 100644 ---- a/src/pip/_vendor/packaging/version.py -+++ b/src/pip/_vendor/packaging/version.py -@@ -108,11 +108,6 @@ class LegacyVersion(_BaseVersion): - self._version = str(version) - self._key = _legacy_cmpkey(self._version) - -- warnings.warn( -- "Creating a LegacyVersion has been deprecated and will be " -- "removed in the next major release", -- DeprecationWarning, -- ) - - def __str__(self) -> str: - return self._version diff --git a/nowarn-pip._internal.main.patch b/nowarn-pip._internal.main.patch index 68f5971..c8c98ed 100644 --- a/nowarn-pip._internal.main.patch +++ b/nowarn-pip._internal.main.patch @@ -1,6 +1,6 @@ -From 8dd3793d1bab226cec9c5c49b01718a9634bc403 Mon Sep 17 00:00:00 2001 +From 9d1e0a0e91cad143702b3a2d8c54bd765a5d9eb2 Mon Sep 17 00:00:00 2001 From: Karolina Surma -Date: Mon, 10 May 2021 16:48:49 +0200 +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, @@ -14,17 +14,17 @@ Co-Authored-By: =?UTF-8?q?Miro=20Hron=C4=8Dok?= 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/pip/_internal/__init__.py b/src/pip/_internal/__init__.py -index 6afb5c6..faf25af 100755 +index 1a5b7f8..682b9e4 100755 --- a/src/pip/_internal/__init__.py +++ b/src/pip/_internal/__init__.py -@@ -16,4 +16,4 @@ def main(args: (Optional[List[str]]) = None) -> int: +@@ -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 f292c64..2e29a5e 100644 +index 1501369..70034eb 100644 --- a/src/pip/_internal/utils/entrypoints.py +++ b/src/pip/_internal/utils/entrypoints.py @@ -20,7 +20,7 @@ if WINDOWS: @@ -61,16 +61,19 @@ index f292c64..2e29a5e 100644 diff --git a/tests/functional/test_cli.py b/tests/functional/test_cli.py -index 3e85703..f86c392 100644 +index e1ccf04..30b8f74 100644 --- a/tests/functional/test_cli.py +++ b/tests/functional/test_cli.py -@@ -43,4 +43,5 @@ def test_entrypoints_work(entrypoint: str, script: PipTestEnvironment) -> None: +@@ -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.35.3 +2.45.1 diff --git a/python-pip.spec b/python-pip.spec index 5e35e5f..61662ba 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.0 +%global base_version 24.1.1 %global upstream_version %{base_version}%{?prerel} %global python_wheel_name %{srcname}-%{upstream_version}-py3-none-any.whl @@ -18,35 +18,27 @@ Summary: A tool for installing and managing Python packages # We bundle a lot of libraries with pip, which itself is under MIT license. # Here is the list of the libraries with corresponding licenses: -# appdirs: MIT # certifi: MPL-2.0 -# chardet: LGPL-2.1-only -# colorama: BSD-3-Clause # CacheControl: Apache-2.0 # distlib: Python-2.0.1 # distro: Apache-2.0 -# html5lib: MIT # idna: BSD-3-Clause -# ipaddress: Python-2.0.1 # msgpack: Apache-2.0 # packaging: Apache-2.0 OR BSD-2-Clause -# progress: ISC +# platformdirs: MIT # pygments: BSD-2-Clause -# pyparsing: MIT # pyproject-hooks: MIT # requests: Apache-2.0 # resolvelib: ISC # rich: MIT # setuptools: MIT -# six: MIT # tenacity: Apache-2.0 # truststore: MIT # tomli: MIT # typing-extensions: Python-2.0.1 # urllib3: MIT -# webencodings: BSD-3-Clause -License: MIT AND Python-2.0.1 AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND LGPL-2.1-only AND MPL-2.0 AND (Apache-2.0 OR BSD-2-Clause) +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) URL: https://pip.pypa.io/ Source0: https://github.com/pypa/pip/archive/%{upstream_version}/%{srcname}-%{upstream_version}.tar.gz @@ -77,13 +69,6 @@ Patch: dummy-certifi.patch # this warning is juts moot. Also, the warning breaks CPython test suite. Patch: nowarn-pip._internal.main.patch -# Don't warn the user about packaging's LegacyVersion being deprecated. -# (This also breaks Python's test suite when warnings are treated as errors.) -# Upstream issue: https://github.com/pypa/packaging/issues/368 -Patch: no-version-warning.patch - -# Python 3.13 support: Also patch time.time_ns() in unit tests -Patch: https://github.com/pypa/pip/pull/12698.patch %description pip is a package management system used to install and manage software packages @@ -97,30 +82,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.13.1 -Provides: bundled(python%{1}dist(certifi)) = 2023.7.22 -Provides: bundled(python%{1}dist(chardet)) = 5.1 -Provides: bundled(python%{1}dist(colorama)) = 0.4.6 +Provides: bundled(python%{1}dist(cachecontrol)) = 0.14 +Provides: bundled(python%{1}dist(certifi)) = 2024.2.2 Provides: bundled(python%{1}dist(distlib)) = 0.3.8 -Provides: bundled(python%{1}dist(distro)) = 1.8 -Provides: bundled(python%{1}dist(idna)) = 3.4 -Provides: bundled(python%{1}dist(msgpack)) = 1.0.5 -Provides: bundled(python%{1}dist(packaging)) = 21.3 -Provides: bundled(python%{1}dist(platformdirs)) = 3.8.1 -Provides: bundled(python%{1}dist(pygments)) = 2.15.1 -Provides: bundled(python%{1}dist(pyparsing)) = 3.1 +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.1 +Provides: bundled(python%{1}dist(pygments)) = 2.17.2 Provides: bundled(python%{1}dist(pyproject-hooks)) = 1 -Provides: bundled(python%{1}dist(requests)) = 2.31 +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.4.2 -Provides: bundled(python%{1}dist(setuptools)) = 68 -Provides: bundled(python%{1}dist(six)) = 1.16 -Provides: bundled(python%{1}dist(tenacity)) = 8.2.2 -Provides: bundled(python%{1}dist(truststore)) = 0.8 +Provides: bundled(python%{1}dist(rich)) = 13.7.1 +Provides: bundled(python%{1}dist(setuptools)) = 69.5.1 +Provides: bundled(python%{1}dist(tenacity)) = 8.2.3 Provides: bundled(python%{1}dist(tomli)) = 2.0.1 -Provides: bundled(python%{1}dist(typing-extensions)) = 4.7.1 -Provides: bundled(python%{1}dist(urllib3)) = 1.26.17 -Provides: bundled(python%{1}dist(webencodings)) = 0.5.1 +Provides: bundled(python%{1}dist(truststore)) = 0.9.1 +Provides: bundled(python%{1}dist(typing-extensions)) = 4.11 +Provides: bundled(python%{1}dist(urllib3)) = 1.26.18 } # Some manylinux1 wheels need libcrypt.so.1. @@ -224,14 +204,14 @@ ln -s %{python_wheel_dir} tests/data/common_wheels # Remove windows executable binaries rm -v src/pip/_vendor/distlib/*.exe -sed -i '/\.exe/d' setup.py +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)/d' tests/requirements.txt +sed -Ei '/(pytest-(cov|xdist|rerunfailures)|proxy\.py)/d' tests/requirements.txt %if %{with tests} @@ -323,12 +303,14 @@ install -p %{_pyproject_wheeldir}/%{python_wheel_name} -t %{buildroot}%{python_w # bash completion tests only work from installed package pytest_k='not completion' -# --deselect'ed tests are not compatible with the latest virtualenv +# --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)" \ - --deselect tests/functional --deselect tests/lib/test_lib.py + --ignore tests/functional --ignore tests/lib/test_lib.py %endif diff --git a/remove-existing-dist-only-if-path-conflicts.patch b/remove-existing-dist-only-if-path-conflicts.patch index 3a9ea25..20e5f28 100644 --- a/remove-existing-dist-only-if-path-conflicts.patch +++ b/remove-existing-dist-only-if-path-conflicts.patch @@ -1,11 +1,8 @@ -From 2c3f3a590ddfc151a456b44a5f96f0f603d178e9 Mon Sep 17 00:00:00 2001 -From: Lumir Balhar +From 9020f56e88a7dbaef688c147c281909f95b4e1d1 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 @@ -15,6 +12,7 @@ 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 +- @@ -23,11 +21,11 @@ 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 151fd6d..f9109cd 100644 +index 9eabcdb..9816691 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 - from pip._vendor.packaging.version import LegacyVersion, Version +@@ -28,7 +28,7 @@ from pip._vendor.packaging.utils import NormalizedName, canonicalize_name + from pip._vendor.packaging.version import Version from pip._internal.exceptions import NoneMetadataError -from pip._internal.locations import site_packages, user_site @@ -35,7 +33,7 @@ index 151fd6d..f9109cd 100644 from pip._internal.models.direct_url import ( DIRECT_URL_METADATA_NAME, DirectUrl, -@@ -560,6 +560,16 @@ class BaseDistribution(Protocol): +@@ -578,6 +578,16 @@ class BaseDistribution(Protocol): for extra in self._iter_egg_info_extras(): metadata["Provides-Extra"] = extra @@ -53,10 +51,10 @@ index 151fd6d..f9109cd 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 a1e376c..ed7facf 100644 +index 2132785..0340890 100644 --- a/src/pip/_internal/req/req_install.py +++ b/src/pip/_internal/req/req_install.py -@@ -416,7 +416,7 @@ class InstallRequirement: +@@ -449,7 +449,7 @@ class InstallRequirement: f"lack sys.path precedence to {existing_dist.raw_name} " f"in {existing_dist.location}" ) @@ -66,13 +64,13 @@ index a1e376c..ed7facf 100644 else: if self.editable: diff --git a/src/pip/_internal/resolution/legacy/resolver.py b/src/pip/_internal/resolution/legacy/resolver.py -index fb49d41..040f2c1 100644 +index 1dd0d70..414bdbe 100644 --- a/src/pip/_internal/resolution/legacy/resolver.py +++ b/src/pip/_internal/resolution/legacy/resolver.py -@@ -325,7 +325,9 @@ class Resolver(BaseResolver): - """ +@@ -319,7 +319,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 - if not self.use_user_site or req.satisfied_by.in_usersite: + if ((not self.use_user_site + or req.satisfied_by.in_usersite) @@ -81,7 +79,7 @@ index fb49d41..040f2c1 100644 req.satisfied_by = None diff --git a/src/pip/_internal/resolution/resolvelib/factory.py b/src/pip/_internal/resolution/resolvelib/factory.py -index a4c24b5..e7e2da9 100644 +index 1f31d83..3804774 100644 --- a/src/pip/_internal/resolution/resolvelib/factory.py +++ b/src/pip/_internal/resolution/resolvelib/factory.py @@ -1,6 +1,8 @@ @@ -92,8 +90,8 @@ index a4c24b5..e7e2da9 100644 +import sysconfig from typing import ( TYPE_CHECKING, - Dict, -@@ -549,6 +551,16 @@ class Factory: + Callable, +@@ -617,6 +619,16 @@ class Factory: if dist is None: # Not installed, no uninstallation required. return None @@ -111,5 +109,5 @@ index a4c24b5..e7e2da9 100644 # be uninstalled, no matter it's in global or user site, because the # user site installation has precedence over global. -- -2.35.3 +2.45.1 diff --git a/sources b/sources index 2a0559e..95d9fff 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pip-24.0.tar.gz) = 0c2ecb2ecde4f155c83468d35bc4f52f37efffc16821ae7c706d035e1e8cc3709b41cb10f8140ff09205e8bbdba2c76128ad76d1cbd18401328b619228e834df +SHA512 (pip-24.1.1.tar.gz) = 523e7273134b68252693ba7a032e7992c72075aebd2bcd895fbd90ad28d76f98b13ea1a7df0b6da1802650782ae977868177f740dc6f0a2eaccb95915c27b318