From 590193ac39c1b6030b6f6617a6c83e22c28baf2cae4d78543fbaabbe205f6040 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sun, 30 Jun 2024 18:46:56 +0000 Subject: [PATCH 01/12] - update to 24.1.1: * Actually use system trust stores when the truststore feature is enabled. * Report informative messages about invalid requirements. * Eagerly import the self version check logic to avoid crashes while upgrading or downgrading pip at the same time. * Accommodate for mismatches between different sources of truth for extra names, for packages generated by setuptools. * Accommodate for development versions of CPython ending in + in the version string. * requests provides optional character detection support on some APIs when processing ambiguous bytes. This isn't relevant for pip to function and we're able to remove it due to recent upstream changes. * Drop support for EOL Python 3.7. * Remove support for legacy versions and dependency specifiers. * Packages with non standard-compliant versions or dependency specifiers are now ignored by the resolver. Already installed packages with non standard-compliant versions or dependency specifiers must be uninstalled before upgrading them. * Improve performance of resolution of large dependency trees, with more caching. * Further improve resolution performance of large dependency trees, by caching hash calculations. * Reduce startup time of commands (e.g. show, freeze) that do not access the network by 15-30%. * Reword and improve presentation of uninstallation errors. * Add a 'raw' progress_bar type for simple and parsable download progress reports * pip list no longer performs the pip version check unless OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pip?expand=0&rev=122 --- distutils-reproducible-compile.patch | 8 ++-- pip-24.0-gh.tar.gz | 3 -- pip-24.1.1-gh.tar.gz | 3 ++ pip-shipped-requests-cabundle.patch | 30 ++++++++++----- python-pip.changes | 57 ++++++++++++++++++++++++++++ python-pip.spec | 7 ++-- 6 files changed, 87 insertions(+), 21 deletions(-) delete mode 100644 pip-24.0-gh.tar.gz create mode 100644 pip-24.1.1-gh.tar.gz diff --git a/distutils-reproducible-compile.patch b/distutils-reproducible-compile.patch index f3fa1fd..5fe265b 100644 --- a/distutils-reproducible-compile.patch +++ b/distutils-reproducible-compile.patch @@ -2,11 +2,11 @@ src/pip/_vendor/distlib/wheel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -Index: pip-22.3.1/src/pip/_vendor/distlib/wheel.py +Index: pip-24.1.1/src/pip/_vendor/distlib/wheel.py =================================================================== ---- pip-22.3.1.orig/src/pip/_vendor/distlib/wheel.py -+++ pip-22.3.1/src/pip/_vendor/distlib/wheel.py -@@ -567,7 +567,7 @@ class Wheel(object): +--- pip-24.1.1.orig/src/pip/_vendor/distlib/wheel.py ++++ pip-24.1.1/src/pip/_vendor/distlib/wheel.py +@@ -578,7 +578,7 @@ class Wheel(object): maker.source_dir = workdir maker.target_dir = None try: diff --git a/pip-24.0-gh.tar.gz b/pip-24.0-gh.tar.gz deleted file mode 100644 index 3d05d7b..0000000 --- a/pip-24.0-gh.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ad0dfe75fb28092a8cbe18523391695ceb0c0d65a5c9a969349fcb13b12b84c7 -size 9398156 diff --git a/pip-24.1.1-gh.tar.gz b/pip-24.1.1-gh.tar.gz new file mode 100644 index 0000000..532a0f4 --- /dev/null +++ b/pip-24.1.1-gh.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5fc497cd1651c39af0207b88eab91b6905ca9cecbae11ad99503b317f8b06def +size 9190972 diff --git a/pip-shipped-requests-cabundle.patch b/pip-shipped-requests-cabundle.patch index c90e180..56a3f24 100644 --- a/pip-shipped-requests-cabundle.patch +++ b/pip-shipped-requests-cabundle.patch @@ -3,26 +3,32 @@ tests/unit/test_options.py | 5 + 2 files changed, 13 insertions(+), 97 deletions(-) ---- a/src/pip/_vendor/certifi/core.py -+++ b/src/pip/_vendor/certifi/core.py -@@ -3,106 +3,17 @@ certifi.py +Index: pip-24.1.1/src/pip/_vendor/certifi/core.py +=================================================================== +--- pip-24.1.1.orig/src/pip/_vendor/certifi/core.py ++++ pip-24.1.1/src/pip/_vendor/certifi/core.py +@@ -3,112 +3,15 @@ certifi.py ~~~~~~~~~~ This module returns the installation location of cacert.pem or its contents. +Patched by openSUSE: return the system bundle """ -import sys +-import atexit +-def exit_cacert_ctx() -> None: +- _CACERT_CTX.__exit__(None, None, None) # type: ignore[union-attr] +def read_text(_module=None, _path=None, encoding="ascii"): + with open(where(), "r", encoding=encoding) as data: + return data.read() --if sys.version_info >= (3, 11): - -- from importlib.resources import as_file, files +def where() -> str: + return "/etc/ssl/ca-bundle.pem" +-if sys.version_info >= (3, 11): +- +- from importlib.resources import as_file, files +- - _CACERT_CTX = None - _CACERT_PATH = None - @@ -47,6 +53,7 @@ - # 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 - @@ -82,6 +89,7 @@ - # 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 - @@ -113,15 +121,17 @@ - # 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: + return read_text(encoding="ascii") ---- a/tests/unit/test_options.py -+++ b/tests/unit/test_options.py +Index: pip-24.1.1/tests/unit/test_options.py +=================================================================== +--- pip-24.1.1.orig/tests/unit/test_options.py ++++ pip-24.1.1/tests/unit/test_options.py @@ -1,4 +1,5 @@ import os +import os.path @@ -136,7 +146,7 @@ from tests.lib.options_helpers import AddFakeCommandMixin -@@ -618,6 +620,9 @@ class TestOptionsConfigFiles: +@@ -617,6 +619,9 @@ class TestOptionsConfigFiles: else: assert expect == cmd._determine_file(options, need_value=False) diff --git a/python-pip.changes b/python-pip.changes index 2c3858b..3a336e8 100644 --- a/python-pip.changes +++ b/python-pip.changes @@ -1,3 +1,60 @@ +------------------------------------------------------------------- +Sun Jun 30 18:45:16 UTC 2024 - Dirk Müller + +- update to 24.1.1: + * Actually use system trust stores when the truststore feature + is enabled. + * Report informative messages about invalid requirements. + * Eagerly import the self version check logic to avoid crashes + while upgrading or downgrading pip at the same time. + * Accommodate for mismatches between different sources of truth + for extra names, for packages generated by setuptools. + * Accommodate for development versions of CPython ending in + + in the version string. + * requests provides optional character detection support on + some APIs when processing ambiguous bytes. This isn't + relevant for pip to function and we're able to remove it due + to recent upstream changes. + * Drop support for EOL Python 3.7. + * Remove support for legacy versions and dependency specifiers. + * Packages with non standard-compliant versions or dependency + specifiers are now ignored by the resolver. Already installed + packages with non standard-compliant versions or dependency + specifiers must be uninstalled before upgrading them. + * Improve performance of resolution of large dependency trees, + with more caching. + * Further improve resolution performance of large dependency + trees, by caching hash calculations. + * Reduce startup time of commands (e.g. show, freeze) that do + not access the network by 15-30%. + * Reword and improve presentation of uninstallation errors. + * Add a 'raw' progress_bar type for simple and parsable + download progress reports + * pip list no longer performs the pip version check unless + --outdated or --uptodate is given. + * Use the data_filter when extracting tarballs, if it's + available. + * Display the Project-URL value under key "Home-page" in pip + show when the Home-Page metadata field is not set. + * The Project-URL key detection is case-insensitive, and + ignores any dashes and underscores. + * Ensure -vv gets passed to any pip install build environment + subprocesses. + * Deduplicate entries in the Requires field of pip show. + * Fix error on checkout for subversion and bazaar with verbose + mode on. + * Fix exception with completions when COMP_CWORD is not set + * Fix intermittent "cannot locate t64.exe" errors when + upgrading pip. + * Remove duplication in invalid wheel error message + * Remove the incorrect pip3.x console entrypoint from the pip + wheel. This console script continues to be generated by pip + when it installs itself. + * Gracefully skip VCS detection in pip freeze when PATH points + to a non-directory path. + * Make the --proxy parameter take precedence over environment + variables. + ------------------------------------------------------------------- Sun Apr 28 19:10:12 UTC 2024 - Dirk Müller diff --git a/python-pip.spec b/python-pip.spec index 7bcd08d..3e3fa83 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -34,7 +34,7 @@ %define mypython python %{?sle15_python_module_pythons} Name: python-pip%{psuffix} -Version: 24.0 +Version: 24.1.1 Release: 0 Summary: A Python package management system License: MIT @@ -69,15 +69,15 @@ BuildRequires: %{python_module pip = %{version}} BuildRequires: %{python_module PyYAML} BuildRequires: %{python_module Werkzeug} BuildRequires: %{python_module cryptography} -BuildRequires: %{python_module docutils} BuildRequires: %{python_module freezegun} BuildRequires: %{python_module installer} BuildRequires: %{python_module pretend} +BuildRequires: %{python_module pytest-xdist} BuildRequires: %{python_module pytest} BuildRequires: %{python_module scripttest} BuildRequires: %{python_module setuptools-wheel} BuildRequires: %{python_module virtualenv >= 1.10} -BuildRequires: ca-certificates +BuildRequires: ca-certificates-mozilla BuildRequires: git-core %endif %python_subpackages @@ -114,7 +114,6 @@ done # Remove windows executable binaries # bsc#1212015 rm -v src/pip/_vendor/distlib/*.exe -sed -i '/\.exe/d' setup.py %build %if !%{with test} From b216d6a5e932b86beae7065b4a9fecbe393aa58389f9fc290d3f192694dc930d Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sun, 30 Jun 2024 18:58:06 +0000 Subject: [PATCH 02/12] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pip?expand=0&rev=123 --- python-pip.spec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python-pip.spec b/python-pip.spec index 3e3fa83..0d02b5f 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -52,9 +52,8 @@ BuildRequires: %{python_module setuptools >= 40.8.0} BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros >= 20210929 -Requires: ca-certificates +Requires: ca-certificates-mozilla Requires: coreutils -Recommends: ca-certificates-mozilla BuildArch: noarch %if %{with libalternatives} BuildRequires: alts From 1240a85eb29a2dcde44aa60ea3e6f2c48d38e7dd895937b59ffb3dd8eb774000 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 12 Aug 2024 16:49:25 +0000 Subject: [PATCH 03/12] - update to 24.2: * Deprecate pip install --editable falling back to setup.py develop when using a setuptools version that does not support PEP 660 (setuptools v63 and older). * Check unsupported packages for the current platform. (#11054) * Check unsupported packages for the current platform. * Use system certificates and certifi certificates to verify HTTPS connections on Python 3.10+. Python 3.9 and earlier only use certifi. To revert to previous behaviour, pass the flag --use-deprecated=legacy-certs. (#11647) * Use system certificates and certifi certificates to verify HTTPS connections on Python 3.10+. Python 3.9 and earlier only use certifi. * To revert to previous behaviour, pass the flag --use- deprecated=legacy-certs. * Improve discovery performance of installed packages when the importlib.metadata backend is used to load distribution metadata (used by default under Python 3.11+). (#12656) * Improve discovery performance of installed packages when the importlib.metadata backend is used to load distribution metadata (used by default under Python 3.11+). * Improve performance when the same requirement string appears many times during resolution, by consistently caching the parsed requirement string. (#12663) * Improve performance when the same requirement string appears many times during resolution, by consistently caching the parsed requirement string. * Minor performance improvement of finding applicable package candidates by not repeatedly calculating their versions (#12664) OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pip?expand=0&rev=124 --- pip-24.1.1-gh.tar.gz | 3 -- pip-24.2-gh.tar.gz | 3 ++ python-pip.changes | 100 +++++++++++++++++++++++++++++++++++++++++++ python-pip.spec | 2 +- 4 files changed, 104 insertions(+), 4 deletions(-) delete mode 100644 pip-24.1.1-gh.tar.gz create mode 100644 pip-24.2-gh.tar.gz diff --git a/pip-24.1.1-gh.tar.gz b/pip-24.1.1-gh.tar.gz deleted file mode 100644 index 532a0f4..0000000 --- a/pip-24.1.1-gh.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5fc497cd1651c39af0207b88eab91b6905ca9cecbae11ad99503b317f8b06def -size 9190972 diff --git a/pip-24.2-gh.tar.gz b/pip-24.2-gh.tar.gz new file mode 100644 index 0000000..9429a52 --- /dev/null +++ b/pip-24.2-gh.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e527f2366551b8483fa3a8ac2954aa79f2461e6600d917f3b6ae741d708cb982 +size 9189637 diff --git a/python-pip.changes b/python-pip.changes index 3a336e8..dbae277 100644 --- a/python-pip.changes +++ b/python-pip.changes @@ -1,3 +1,103 @@ +------------------------------------------------------------------- +Mon Aug 12 16:49:06 UTC 2024 - Dirk Müller + +- update to 24.2: + * Deprecate pip install --editable falling back to setup.py + develop when using a setuptools version that does not support + PEP 660 (setuptools v63 and older). + * Check unsupported packages for the current platform. (#11054) + * Check unsupported packages for the current platform. + * Use system certificates and certifi certificates to verify + HTTPS connections on Python 3.10+. Python 3.9 and earlier + only use certifi. To revert to previous behaviour, pass the + flag --use-deprecated=legacy-certs. (#11647) + * Use system certificates and certifi certificates to verify + HTTPS connections on Python 3.10+. Python 3.9 and earlier + only use certifi. + * To revert to previous behaviour, pass the flag --use- + deprecated=legacy-certs. + * Improve discovery performance of installed packages when the + importlib.metadata backend is used to load distribution + metadata (used by default under Python 3.11+). (#12656) + * Improve discovery performance of installed packages when the + importlib.metadata backend is used to load distribution + metadata (used by default under Python 3.11+). + * Improve performance when the same requirement string appears + many times during resolution, by consistently caching the + parsed requirement string. (#12663) + * Improve performance when the same requirement string appears + many times during resolution, by consistently caching the + parsed requirement string. + * Minor performance improvement of finding applicable package + candidates by not repeatedly calculating their versions + (#12664) + * Minor performance improvement of finding applicable package + candidates by not repeatedly calculating their versions + * Disable pip's self version check when invoking a pip + subprocess to install PEP 517 build requirements. (#12683) + * Disable pip's self version check when invoking a pip + subprocess to install PEP 517 build requirements. + * Improve dependency resolution performance by caching platform + compatibility tags during wheel cache lookup. (#12712) + * Improve dependency resolution performance by caching platform + compatibility tags during wheel cache lookup. + * wheel is no longer explicitly listed as a build dependency of + pip. setuptools injects this dependency in the + get_requires_for_build_wheel() hook and no longer needs it on + newer versions. (#12728) + * wheel is no longer explicitly listed as a build dependency of + pip. setuptools injects this dependency in the + get_requires_for_build_wheel() hook and no longer needs it on + newer versions. + * Ignore --require-virtualenv for pip check and pip freeze + (#12842) + * Ignore --require-virtualenv for pip check and pip freeze + * Improve package download and install performance. Increase + chunk sizes when downloading (256 kB, up from 10 kB) and + reading files (1 MB, up from 8 kB). This reduces the + frequency of updates to pip's progress bar. (#12810) + * Improve package download and install performance. + * Increase chunk sizes when downloading (256 kB, up from 10 kB) + and reading files (1 MB, up from 8 kB). This reduces the + frequency of updates to pip's progress bar. + * Improve pip install performance. Files are now extracted in + 1MB blocks, or in one block matching the file size for + smaller files. A decompressor is no longer instantiated when + extracting 0 bytes files, it is not necessary because there + is no data to decompress. (#12803) + * Improve pip install performance. + * Files are now extracted in 1MB blocks, or in one block + matching the file size for smaller files. A decompressor is + no longer instantiated when extracting 0 bytes files, it is + not necessary because there is no data to decompress. + * Set no_color to global rich.Console instance. + * Fix resolution to respect --python-version when checking + Requires-Python. + * Perform hash comparisons in a case-insensitive manner. + * Avoid dlopen failure for glibc detection in musl builds + * Avoid keyring logging crashes when pip is run in verbose + mode. + * Fix finding hardlink targets in tar files with an ignored + top-level directory. + * Improve pip install performance by only creating required + parent directories once, instead of before extracting every + file in the wheel. + * Improve pip install performance by calculating installed + packages printout in linear time instead of quadratic time. + * Remove vendored tenacity. + * Update the preload list for the DEBUNDLED case, to replace + pep517 that has been renamed to pyproject_hooks. + * Use tomllib from the stdlib if available, rather than tomli + * Upgrade certifi to 2024.7.4 + * Upgrade platformdirs to 4.2.2 + * Upgrade pygments to 2.18.0 + * Upgrade setuptools to 70.3.0 + * Upgrade typing_extensions to 4.12.2 + * Correct —-ignore-conflicts (including an em dash) to + --ignore-conflicts. + * Fix finding hardlink targets in tar files with an ignored + top-level directory. + ------------------------------------------------------------------- Sun Jun 30 18:45:16 UTC 2024 - Dirk Müller diff --git a/python-pip.spec b/python-pip.spec index 0d02b5f..49a5490 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -34,7 +34,7 @@ %define mypython python %{?sle15_python_module_pythons} Name: python-pip%{psuffix} -Version: 24.1.1 +Version: 24.2 Release: 0 Summary: A Python package management system License: MIT From dca8b05f40f836e01ea1ae53ea0ea0ff80d70e4334919f4053c57d17b6c52c6f Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 12 Aug 2024 16:50:37 +0000 Subject: [PATCH 04/12] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pip?expand=0&rev=125 --- python-pip.spec | 3 --- 1 file changed, 3 deletions(-) diff --git a/python-pip.spec b/python-pip.spec index 49a5490..a1f5f58 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -76,7 +76,6 @@ BuildRequires: %{python_module pytest} BuildRequires: %{python_module scripttest} BuildRequires: %{python_module setuptools-wheel} BuildRequires: %{python_module virtualenv >= 1.10} -BuildRequires: ca-certificates-mozilla BuildRequires: git-core %endif %python_subpackages @@ -99,8 +98,6 @@ the wheel needs to be used directly in test or install setups # Exception: Use our own cabundle. Adapted patch from python-certifi package %autosetup -p1 -n pip-%{version} -rm src/pip/_vendor/certifi/cacert.pem - %if %{with test} mkdir -p tests/data/common_wheels %python_expand cp %{$python_sitelib}/../wheels/setuptools*.whl tests/data/common_wheels/ From 90d953f4c149e9c5655e3b19bf316dc485e4eeeb440fb92511152a9abe4ec31d Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 12 Aug 2024 17:08:12 +0000 Subject: [PATCH 05/12] - add on-demand-linkcollector.patch to delay loading the linkcollector in build environments which have no network and no useful set of certificates OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pip?expand=0&rev=126 --- on-demand-linkcollector.patch | 20 ++++++++++++++++++++ python-pip.changes | 3 +++ python-pip.spec | 2 ++ 3 files changed, 25 insertions(+) create mode 100644 on-demand-linkcollector.patch diff --git a/on-demand-linkcollector.patch b/on-demand-linkcollector.patch new file mode 100644 index 0000000..d396d51 --- /dev/null +++ b/on-demand-linkcollector.patch @@ -0,0 +1,20 @@ +Index: pip-24.2/src/pip/_internal/cli/req_command.py +=================================================================== +--- pip-24.2.orig/src/pip/_internal/cli/req_command.py ++++ pip-24.2/src/pip/_internal/cli/req_command.py +@@ -15,7 +15,6 @@ from pip._internal.cli import cmdoptions + from pip._internal.cli.index_command import IndexGroupCommand + from pip._internal.cli.index_command import SessionCommandMixin as SessionCommandMixin + from pip._internal.exceptions import CommandError, PreviousBuildDirError +-from pip._internal.index.collector import LinkCollector + from pip._internal.index.package_finder import PackageFinder + from pip._internal.models.selection_prefs import SelectionPreferences + from pip._internal.models.target_python import TargetPython +@@ -313,6 +312,7 @@ class RequirementCommand(IndexGroupComma + :param ignore_requires_python: Whether to ignore incompatible + "Requires-Python" values in links. Defaults to False. + """ ++ from pip._internal.index.collector import LinkCollector + link_collector = LinkCollector.create(session, options=options) + selection_prefs = SelectionPreferences( + allow_yanked=True, diff --git a/python-pip.changes b/python-pip.changes index dbae277..89194c4 100644 --- a/python-pip.changes +++ b/python-pip.changes @@ -97,6 +97,9 @@ Mon Aug 12 16:49:06 UTC 2024 - Dirk Müller --ignore-conflicts. * Fix finding hardlink targets in tar files with an ignored top-level directory. +- add on-demand-linkcollector.patch to delay loading the + linkcollector in build environments which have no network + and no useful set of certificates ------------------------------------------------------------------- Sun Jun 30 18:45:16 UTC 2024 - Dirk Müller diff --git a/python-pip.spec b/python-pip.spec index a1f5f58..0007f78 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -46,6 +46,8 @@ Patch0: pip-shipped-requests-cabundle.patch # PATCH-FIX-UPSTREAM distutils-reproducible-compile.patch gh#python/cpython#8057 mcepl@suse.com # To get reproducible builds, byte_compile() of distutils.util now sorts filenames. Patch1: distutils-reproducible-compile.patch +# PATCH-FIX-OPENSUSE: delay loading requests and ca-certificates to avoid build cycles +Patch2: on-demand-linkcollector.patch BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module setuptools >= 40.8.0} # The rpm python-wheel build is bootstrap friendly since 0.42 From 264767f03baf017c23aabfec1d267064d5ba56b105da927358c1207fd5ce2acc Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 12 Aug 2024 17:12:41 +0000 Subject: [PATCH 06/12] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pip?expand=0&rev=127 --- on-demand-linkcollector.patch | 20 -------------------- python-pip.changes | 3 --- python-pip.spec | 2 -- 3 files changed, 25 deletions(-) delete mode 100644 on-demand-linkcollector.patch diff --git a/on-demand-linkcollector.patch b/on-demand-linkcollector.patch deleted file mode 100644 index d396d51..0000000 --- a/on-demand-linkcollector.patch +++ /dev/null @@ -1,20 +0,0 @@ -Index: pip-24.2/src/pip/_internal/cli/req_command.py -=================================================================== ---- pip-24.2.orig/src/pip/_internal/cli/req_command.py -+++ pip-24.2/src/pip/_internal/cli/req_command.py -@@ -15,7 +15,6 @@ from pip._internal.cli import cmdoptions - from pip._internal.cli.index_command import IndexGroupCommand - from pip._internal.cli.index_command import SessionCommandMixin as SessionCommandMixin - from pip._internal.exceptions import CommandError, PreviousBuildDirError --from pip._internal.index.collector import LinkCollector - from pip._internal.index.package_finder import PackageFinder - from pip._internal.models.selection_prefs import SelectionPreferences - from pip._internal.models.target_python import TargetPython -@@ -313,6 +312,7 @@ class RequirementCommand(IndexGroupComma - :param ignore_requires_python: Whether to ignore incompatible - "Requires-Python" values in links. Defaults to False. - """ -+ from pip._internal.index.collector import LinkCollector - link_collector = LinkCollector.create(session, options=options) - selection_prefs = SelectionPreferences( - allow_yanked=True, diff --git a/python-pip.changes b/python-pip.changes index 89194c4..dbae277 100644 --- a/python-pip.changes +++ b/python-pip.changes @@ -97,9 +97,6 @@ Mon Aug 12 16:49:06 UTC 2024 - Dirk Müller --ignore-conflicts. * Fix finding hardlink targets in tar files with an ignored top-level directory. -- add on-demand-linkcollector.patch to delay loading the - linkcollector in build environments which have no network - and no useful set of certificates ------------------------------------------------------------------- Sun Jun 30 18:45:16 UTC 2024 - Dirk Müller diff --git a/python-pip.spec b/python-pip.spec index 0007f78..a1f5f58 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -46,8 +46,6 @@ Patch0: pip-shipped-requests-cabundle.patch # PATCH-FIX-UPSTREAM distutils-reproducible-compile.patch gh#python/cpython#8057 mcepl@suse.com # To get reproducible builds, byte_compile() of distutils.util now sorts filenames. Patch1: distutils-reproducible-compile.patch -# PATCH-FIX-OPENSUSE: delay loading requests and ca-certificates to avoid build cycles -Patch2: on-demand-linkcollector.patch BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module setuptools >= 40.8.0} # The rpm python-wheel build is bootstrap friendly since 0.42 From 9554f80c4dd5ff86c26c705354e1353327c3fb26740af5af34a6e4b262d2119d Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 12 Aug 2024 17:17:37 +0000 Subject: [PATCH 07/12] - add disable-ssl-context-in-buildenv.patch: treat missing ca-certificates as "ssl not available" for buildenvs OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pip?expand=0&rev=128 --- disable-ssl-context-in-buildenv.patch | 13 +++++++++++++ python-pip.changes | 2 ++ python-pip.spec | 2 ++ 3 files changed, 17 insertions(+) create mode 100644 disable-ssl-context-in-buildenv.patch diff --git a/disable-ssl-context-in-buildenv.patch b/disable-ssl-context-in-buildenv.patch new file mode 100644 index 0000000..ddc9884 --- /dev/null +++ b/disable-ssl-context-in-buildenv.patch @@ -0,0 +1,13 @@ +Index: pip-24.2/src/pip/_vendor/requests/adapters.py +=================================================================== +--- pip-24.2.orig/src/pip/_vendor/requests/adapters.py ++++ pip-24.2/src/pip/_vendor/requests/adapters.py +@@ -81,7 +81,7 @@ try: + _preloaded_ssl_context.load_verify_locations( + extract_zipped_paths(DEFAULT_CA_BUNDLE_PATH) + ) +-except ImportError: ++except ImportError, FileNotFoundError: + # Bypass default SSLContext creation when Python + # interpreter isn't built with the ssl module. + _preloaded_ssl_context = None diff --git a/python-pip.changes b/python-pip.changes index dbae277..596c62f 100644 --- a/python-pip.changes +++ b/python-pip.changes @@ -97,6 +97,8 @@ Mon Aug 12 16:49:06 UTC 2024 - Dirk Müller --ignore-conflicts. * Fix finding hardlink targets in tar files with an ignored top-level directory. +- add disable-ssl-context-in-buildenv.patch: treat missing + ca-certificates as "ssl not available" for buildenvs ------------------------------------------------------------------- Sun Jun 30 18:45:16 UTC 2024 - Dirk Müller diff --git a/python-pip.spec b/python-pip.spec index a1f5f58..40f7ff3 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -46,6 +46,8 @@ Patch0: pip-shipped-requests-cabundle.patch # PATCH-FIX-UPSTREAM distutils-reproducible-compile.patch gh#python/cpython#8057 mcepl@suse.com # To get reproducible builds, byte_compile() of distutils.util now sorts filenames. Patch1: distutils-reproducible-compile.patch +# PATCH-FIX-OPENSUSE: deal missing ca-certificates as "ssl not available" +Patch2: disable-ssl-context-in-buildenv.patch BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module setuptools >= 40.8.0} # The rpm python-wheel build is bootstrap friendly since 0.42 From a89ced27d91e225b0da968a6ca88a52ad34a7ba8a3d12507946682594eb3e888 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 12 Aug 2024 17:20:57 +0000 Subject: [PATCH 08/12] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pip?expand=0&rev=129 --- disable-ssl-context-in-buildenv.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/disable-ssl-context-in-buildenv.patch b/disable-ssl-context-in-buildenv.patch index ddc9884..c5a950c 100644 --- a/disable-ssl-context-in-buildenv.patch +++ b/disable-ssl-context-in-buildenv.patch @@ -7,7 +7,7 @@ Index: pip-24.2/src/pip/_vendor/requests/adapters.py extract_zipped_paths(DEFAULT_CA_BUNDLE_PATH) ) -except ImportError: -+except ImportError, FileNotFoundError: ++except (ImportError, FileNotFoundError): # Bypass default SSLContext creation when Python # interpreter isn't built with the ssl module. _preloaded_ssl_context = None From 4f42c31eca5ddb02c08c85f956b856284fe47351334cb91f72800e309bf4ab0c Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 12 Aug 2024 20:12:13 +0000 Subject: [PATCH 09/12] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pip?expand=0&rev=130 --- disable-ssl-context-in-buildenv.patch | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/disable-ssl-context-in-buildenv.patch b/disable-ssl-context-in-buildenv.patch index c5a950c..918c0bc 100644 --- a/disable-ssl-context-in-buildenv.patch +++ b/disable-ssl-context-in-buildenv.patch @@ -11,3 +11,20 @@ Index: pip-24.2/src/pip/_vendor/requests/adapters.py # Bypass default SSLContext creation when Python # interpreter isn't built with the ssl module. _preloaded_ssl_context = None +Index: pip-24.2/src/pip/_internal/cli/index_command.py +=================================================================== +--- pip-24.2.orig/src/pip/_internal/cli/index_command.py ++++ pip-24.2/src/pip/_internal/cli/index_command.py +@@ -43,7 +43,11 @@ def _create_truststore_ssl_context() -> + return None + + ctx = truststore.SSLContext(ssl.PROTOCOL_TLS_CLIENT) +- ctx.load_verify_locations(certifi.where()) ++ try: ++ ctx.load_verify_locations(certifi.where()) ++ except FileNotFoundError: ++ logger.warning("Disabling truststore because of missing certificates") ++ return None + return ctx + + From 585a5beab1dff8dea81b076c9079dca938991a792b0061c4345fbd0ba83d5b67 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 13 Aug 2024 06:23:20 +0000 Subject: [PATCH 10/12] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pip?expand=0&rev=131 --- python-pip.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python-pip.spec b/python-pip.spec index 40f7ff3..84423e5 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -54,8 +54,9 @@ BuildRequires: %{python_module setuptools >= 40.8.0} BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros >= 20210929 -Requires: ca-certificates-mozilla +Requires: ca-certificates Requires: coreutils +Recommends: ca-certificates-mozilla BuildArch: noarch %if %{with libalternatives} BuildRequires: alts @@ -78,6 +79,7 @@ BuildRequires: %{python_module pytest} BuildRequires: %{python_module scripttest} BuildRequires: %{python_module setuptools-wheel} BuildRequires: %{python_module virtualenv >= 1.10} +BuildRequires: ca-certificates-mozilla BuildRequires: git-core %endif %python_subpackages From e94c85d3c770c9ef363008b3687a3907f1249f319da7ce70b7ad9b99731f6910 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 13 Aug 2024 06:23:28 +0000 Subject: [PATCH 11/12] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pip?expand=0&rev=132 --- python-pip.spec | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/python-pip.spec b/python-pip.spec index 84423e5..e702f0a 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -29,7 +29,6 @@ %else %bcond_with libalternatives %endif - # in order to avoid rewriting for subpackage generator %define mypython python %{?sle15_python_module_pythons} @@ -66,13 +65,13 @@ Requires(post): update-alternatives Requires(postun): update-alternatives %endif %if %{with test} -# Test requirements: -BuildRequires: %{python_module pip = %{version}} BuildRequires: %{python_module PyYAML} BuildRequires: %{python_module Werkzeug} BuildRequires: %{python_module cryptography} BuildRequires: %{python_module freezegun} BuildRequires: %{python_module installer} +# Test requirements: +BuildRequires: %{python_module pip = %{version}} BuildRequires: %{python_module pretend} BuildRequires: %{python_module pytest-xdist} BuildRequires: %{python_module pytest} @@ -91,7 +90,7 @@ pip-installable as well. %package wheel Summary: The pip wheel for custom tests and install requirements -Requires: %mypython(abi) = %python_version +Requires: %{mypython(abi)} = %{python_version} %description wheel This packages provides the pip wheel as separate file for cases where @@ -135,7 +134,7 @@ install -D -m 0644 -t %{buildroot}%{$python_sitelib}/../wheels dist/*.whl } %{python_expand # Fix shebang path for "pip3.XX" binaries -sed -i "1s|#\!.*python.*|#\!/usr/bin/$python|" %{buildroot}%{_bindir}/pip%{$python_bin_suffix} +sed -i "1s|#\!.*python.*|#\!%{_bindir}/$python|" %{buildroot}%{_bindir}/pip%{$python_bin_suffix} } %python_clone -a %{buildroot}%{_bindir}/pip From 8c2752d74c2ff13b0aca12de4f03eb988cc78438bee6cb8b458526f32c6cafba Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 13 Aug 2024 07:03:31 +0000 Subject: [PATCH 12/12] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pip?expand=0&rev=133 --- python-pip.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pip.spec b/python-pip.spec index e702f0a..1ebdb73 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -90,7 +90,7 @@ pip-installable as well. %package wheel Summary: The pip wheel for custom tests and install requirements -Requires: %{mypython(abi)} = %{python_version} +Requires: %mypython(abi) = %python_version %description wheel This packages provides the pip wheel as separate file for cases where