mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-04-30 04:47:28 -07:00
29 lines
1.1 KiB
Diff
29 lines
1.1 KiB
Diff
From 82ccbc4b41acf12298c8471ba46fe783827065da Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
|
|
Date: Sat, 22 Jun 2024 14:28:23 +0200
|
|
Subject: [PATCH] [Gentoo] Use ensurepip wheels instead of local bundle
|
|
|
|
---
|
|
src/virtualenv/seed/wheels/embed/__init__.py | 8 ++++++++
|
|
1 file changed, 8 insertions(+)
|
|
|
|
diff --git a/src/virtualenv/seed/wheels/embed/__init__.py b/src/virtualenv/seed/wheels/embed/__init__.py
|
|
index f9947a11..f4d43134 100644
|
|
--- a/src/virtualenv/seed/wheels/embed/__init__.py
|
|
+++ b/src/virtualenv/seed/wheels/embed/__init__.py
|
|
@@ -44,6 +44,14 @@ MAX = "3.8"
|
|
|
|
|
|
def get_embed_wheel(distribution: str, for_py_version: str) -> Wheel | None:
|
|
+ # Gentoo hack: get wheel from ensurepip directory
|
|
+ import sysconfig
|
|
+ bundle_dir = Path(sysconfig.get_config_var("WHEEL_PKG_DIR"))
|
|
+ try:
|
|
+ return Wheel.from_path(next(bundle_dir.glob(f"{distribution}-*.whl")))
|
|
+ except StopIteration:
|
|
+ return None
|
|
+
|
|
mapping = BUNDLE_SUPPORT.get(for_py_version, {}) or BUNDLE_SUPPORT[MAX]
|
|
wheel_file = mapping.get(distribution)
|
|
if wheel_file is None:
|