Skip to content

Commit 724f0b1

Browse files
committed
[GR-45857] Patch meson-python to get wheel tags compatible with our pip
PullRequest: graalpython/2753
2 parents f263f0d + ed41105 commit 724f0b1

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
diff --git a/mesonpy/_tags.py b/mesonpy/_tags.py
2+
index 7e44eb4..6245cb4 100644
3+
--- a/mesonpy/_tags.py
4+
+++ b/mesonpy/_tags.py
5+
@@ -53,40 +53,7 @@ def _get_cpython_abi() -> str:
6+
7+
8+
def get_abi_tag() -> str:
9+
- # The best solution to obtain the Python ABI is to parse the
10+
- # $SOABI or $EXT_SUFFIX sysconfig variables as defined in PEP-314.
11+
-
12+
- # PyPy reports a $SOABI that does not agree with $EXT_SUFFIX.
13+
- # Using $EXT_SUFFIX will not break when PyPy will fix this.
14+
- # See https://foss.heptapod.net/pypy/pypy/-/issues/3816 and
15+
- # https://github.com/pypa/packaging/pull/607.
16+
- try:
17+
- empty, abi, ext = str(sysconfig.get_config_var('EXT_SUFFIX')).split('.')
18+
- except ValueError as exc:
19+
- # CPython <= 3.8.7 on Windows does not implement PEP3149 and
20+
- # uses '.pyd' as $EXT_SUFFIX, which does not allow to extract
21+
- # the interpreter ABI. Check that the fallback is not hit for
22+
- # any other Python implementation.
23+
- if sys.implementation.name != 'cpython':
24+
- raise NotImplementedError from exc
25+
- return _get_cpython_abi()
26+
-
27+
- # The packaging module initially based his understanding of the
28+
- # $SOABI variable on the inconsistent value reported by PyPy, and
29+
- # did not strip architecture information from it. Therefore the
30+
- # ABI tag for later Python implementations (all the ones not
31+
- # explicitly handled below) contains architecture information too.
32+
- # Unfortunately, fixing this now would break compatibility.
33+
-
34+
- if abi.startswith('cpython'):
35+
- abi = 'cp' + abi.split('-')[1]
36+
- elif abi.startswith('cp'):
37+
- abi = abi.split('-')[0]
38+
- elif abi.startswith('pypy'):
39+
- abi = '_'.join(abi.split('-')[:2])
40+
- elif abi.startswith('graalpy'):
41+
- abi = '_'.join(abi.split('-')[:3])
42+
-
43+
+ abi = sysconfig.get_config_var("SOABI")
44+
return abi.replace('.', '_').replace('-', '_')
45+
46+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[[rules]]
2+
# We revert a bit of wheel tag compuatation logic to be in sync with pip we ship. We might need to remove this when we update pip
3+
patch = 'meson-python.patch'
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
[[rules]]
22
version = '== 1.4.1'
33
patch = 'scipy-1.4.1.patch'
4+
dist-type = 'sdist'
45

56
[[rules]]
67
version = '== 1.7.3'
78
patch = 'scipy-1.7.3.patch'
9+
dist-type = 'sdist'
810

911
[[rules]]
1012
version = '== 1.8.1'
1113
patch = 'scipy-1.8.1.patch'
14+
dist-type = 'sdist'
1215

1316
[[rules]]
1417
version = '== 1.9.3'
1518
patch = 'scipy-1.9.3.patch'
19+
dist-type = 'sdist'
1620

1721
[[rules]]
1822
# pin to 1.10.1
1923
install-priority = 10
2024
version = '== 1.10.1'
2125
patch = 'scipy-1.10.1.patch'
26+
dist-type = 'sdist'

0 commit comments

Comments
 (0)