From e70801ec26bf13b0769434fc098f9e9659796927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 3 Sep 2019 15:38:08 +0200 Subject: [PATCH] Use wheels from ensurepip/_bundled dir if it is there This allows virtualenv to install pip < 19.2 on Python 3.4 once we update pip. --- python-virtualenv.spec | 6 +++++- rpm-wheels.patch | 16 ++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/python-virtualenv.spec b/python-virtualenv.spec index 25efecf..83cfcab 100644 --- a/python-virtualenv.spec +++ b/python-virtualenv.spec @@ -1,6 +1,6 @@ Name: python-virtualenv Version: 16.7.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Tool to create isolated Python environments License: MIT @@ -140,6 +140,10 @@ rm -r tmp_path %changelog +* Tue Sep 03 2019 Miro HronĨok - 16.7.3-2 +- Prefer wheels bundled in Python's ensurepip module over the RPM built ones +- This allows continuing support for Python 3.4 in Fedora 32+ + * Wed Aug 21 2019 Charalampos Stratakis - 16.7.3-1 - Update to 16.7.3 (#1742034) diff --git a/rpm-wheels.patch b/rpm-wheels.patch index 79d86bf..36cc22b 100644 --- a/rpm-wheels.patch +++ b/rpm-wheels.patch @@ -1,16 +1,24 @@ diff --git a/virtualenv.py b/virtualenv.py -index 3ccbed6..504efc8 100755 +index 8f05739..cd10e9f 100755 --- a/virtualenv.py +++ b/virtualenv.py -@@ -473,7 +473,10 @@ def virtualenv_support_dirs(): +@@ -476,7 +476,18 @@ def virtualenv_support_dirs(): # normal filesystem installation if os.path.isdir(join(HERE, "virtualenv_support")): - yield [join(HERE, "virtualenv_support")] ++ dirs = [join(HERE, "virtualenv_support")] + if os.path.isdir("/usr/share/python-wheels"): -+ yield ["/usr/share/python-wheels", join(HERE, "virtualenv_support")] ++ dirs.insert(0, "/usr/share/python-wheels") ++ try: ++ import ensurepip ++ ensurepip_path = os.path.join(ensurepip.__path__[0], "_bundled") ++ except (ImportError, AttributeError, IndexError): ++ pass + else: -+ yield [join(HERE, "virtualenv_support")] ++ if os.path.isdir(ensurepip_path): ++ dirs.insert(0, ensurepip_path) ++ yield dirs elif IS_ZIPAPP: tmpdir = tempfile.mkdtemp() try: