File: wheel-package-error

package info (click to toggle)
python-virtualenv 20.17.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,580 kB
  • sloc: python: 9,952; sh: 149; ansic: 61; csh: 35; makefile: 10
file content (33 lines) | stat: -rw-r--r-- 1,290 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From: Stefano Rivera <stefanor@debian.org>
Date: Tue, 11 Jan 2022 16:45:11 -0400
Subject: Debian: Instruct the user to install the appropriate -whl package

Forwarded: not-needed
---
 src/virtualenv/seed/wheels/embed/__init__.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/virtualenv/seed/wheels/embed/__init__.py b/src/virtualenv/seed/wheels/embed/__init__.py
index dd20664..aef1070 100644
--- a/src/virtualenv/seed/wheels/embed/__init__.py
+++ b/src/virtualenv/seed/wheels/embed/__init__.py
@@ -70,6 +70,19 @@ BUNDLE_SUPPORT = list_available_wheels(BUNDLE_SUPPORT.keys())
 
 
 def get_embed_wheel(distribution, for_py_version):
+    # Debian specific: Point at the appropriate wheel package
+    wheel = BUNDLE_SUPPORT.get(for_py_version, {}).get(distribution)
+    if wheel is None:
+        raise Exception((
+                "Wheel for {} for Python {} is unavailable. "
+                "apt install python{}-{}-whl"
+            ).format(
+                distribution,
+                for_py_version,
+                '2' if for_py_version == '2.7' else '3',
+                distribution,
+            ))
+
     path = BUNDLE_FOLDER / (BUNDLE_SUPPORT.get(for_py_version, {}) or BUNDLE_SUPPORT[MAX]).get(distribution)
     return Wheel.from_path(path)