From f0f6fa0113b6164b2aa78076aa34151ae2d81522409640ed20a89d61e576b488 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 12 Aug 2024 17:08:12 +0000 Subject: [PATCH] - 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