Make the patch more EPEL9-like for easier syncs

See 6e2063b0143808db490515a8a8726f5dc3af50f8
This commit is contained in:
Miro Hrončok 2023-02-14 14:41:36 +01:00
parent 693ab6fbe9
commit 88f20d5ea5

View File

@ -1,4 +1,4 @@
From bc989ca9c586db2600a9e7349e54db0945876043 Mon Sep 17 00:00:00 2001 From 0558dbfcd0d89f52aa251481ba41ab4cfa2cb6da Mon Sep 17 00:00:00 2001
From: Lumir Balhar <lbalhar@redhat.com> From: Lumir Balhar <lbalhar@redhat.com>
Date: Thu, 9 Feb 2023 15:13:36 +0100 Date: Thu, 9 Feb 2023 15:13:36 +0100
Subject: [PATCH] RPM wheels Subject: [PATCH] RPM wheels
@ -9,8 +9,8 @@ Subject: [PATCH] RPM wheels
src/virtualenv/seed/embed/pip_invoke.py | 1 + src/virtualenv/seed/embed/pip_invoke.py | 1 +
.../seed/embed/via_app_data/via_app_data.py | 1 + .../seed/embed/via_app_data/via_app_data.py | 1 +
src/virtualenv/seed/wheels/embed/__init__.py | 4 ++++ src/virtualenv/seed/wheels/embed/__init__.py | 4 ++++
src/virtualenv/util/path/_system_wheels.py | 21 +++++++++++++++++++ src/virtualenv/util/path/_system_wheels.py | 22 +++++++++++++++++++
6 files changed, 45 insertions(+), 3 deletions(-) 6 files changed, 46 insertions(+), 3 deletions(-)
create mode 100644 src/virtualenv/util/path/_system_wheels.py create mode 100644 src/virtualenv/util/path/_system_wheels.py
diff --git a/src/virtualenv/run/__init__.py b/src/virtualenv/run/__init__.py diff --git a/src/virtualenv/run/__init__.py b/src/virtualenv/run/__init__.py
@ -30,7 +30,7 @@ index 6d22b71..19d1791 100644
def load_app_data(args, parser, options): def load_app_data(args, parser, options):
diff --git a/src/virtualenv/seed/embed/base_embed.py b/src/virtualenv/seed/embed/base_embed.py diff --git a/src/virtualenv/seed/embed/base_embed.py b/src/virtualenv/seed/embed/base_embed.py
index f29110b..260b1a9 100644 index f29110b..07649c2 100644
--- a/src/virtualenv/seed/embed/base_embed.py --- a/src/virtualenv/seed/embed/base_embed.py
+++ b/src/virtualenv/seed/embed/base_embed.py +++ b/src/virtualenv/seed/embed/base_embed.py
@@ -3,8 +3,9 @@ from pathlib import Path @@ -3,8 +3,9 @@ from pathlib import Path
@ -65,7 +65,7 @@ index f29110b..260b1a9 100644
return result[:-1] + ")" return result[:-1] + ")"
+ def insert_system_wheels_paths(self, creator): + def insert_system_wheels_paths(self, creator):
+ system_wheels_paths = get_system_wheels_paths(creator.interpreter.executable) + system_wheels_paths = get_system_wheels_paths(creator.interpreter)
+ self.extra_search_dir = list(system_wheels_paths) + self.extra_search_dir + self.extra_search_dir = list(system_wheels_paths) + self.extra_search_dir
+ +
@ -113,18 +113,19 @@ index f779e07..db141ae 100644
diff --git a/src/virtualenv/util/path/_system_wheels.py b/src/virtualenv/util/path/_system_wheels.py diff --git a/src/virtualenv/util/path/_system_wheels.py b/src/virtualenv/util/path/_system_wheels.py
new file mode 100644 new file mode 100644
index 0000000..19cf2ca index 0000000..f3fd9b1
--- /dev/null --- /dev/null
+++ b/src/virtualenv/util/path/_system_wheels.py +++ b/src/virtualenv/util/path/_system_wheels.py
@@ -0,0 +1,21 @@ @@ -0,0 +1,22 @@
+from pathlib import Path +from pathlib import Path
+from subprocess import check_output, CalledProcessError +from subprocess import check_output, CalledProcessError
+ +
+ +
+def get_system_wheels_paths(executable): +def get_system_wheels_paths(interpreter):
+ # ensurepip wheels + # ensurepip wheels
+ # We need subprocess here to check ensurepip with the Python we are creating + # We need subprocess here to check ensurepip with the Python we are creating
+ # a new virtual environment for + # a new virtual environment for
+ executable = interpreter.executable
+ try: + try:
+ ensurepip_path = check_output((executable, "-u", "-c", 'import ensurepip; print(ensurepip.__path__[0])'), universal_newlines=True) + ensurepip_path = check_output((executable, "-u", "-c", 'import ensurepip; print(ensurepip.__path__[0])'), universal_newlines=True)
+ ensurepip_path = Path(ensurepip_path.strip()) / "_bundled" + ensurepip_path = Path(ensurepip_path.strip()) / "_bundled"