@@ -38,41 +38,44 @@ def build(context):
38
38
context .run (f"{ executable } -m pip install --upgrade pip" , echo = True )
39
39
context .run (f"pip install -r requirements.txt" , echo = True )
40
40
context .run (
41
- f"{ executable } setup.py develop sdist bdist_wheel " ,
41
+ f"{ executable } setup.py develop sdist" ,
42
42
env = {"CPPFLAGS" : "-Werror -Wno-deprecated-declarations" },
43
43
replace_env = False ,
44
44
)
45
-
46
- WHEELS = glob ("dist/*.whl" )
47
- assert WHEELS , "No wheels in dist!"
48
- print ("Before:" , * WHEELS , sep = "\n - " )
49
45
if platform == "linux" :
50
46
from sys import abiflags
47
+
51
48
for so in glob ("*.so" ):
52
49
context .run (
53
50
f"patchelf --remove-needed libpython{ get_python_version ()} { abiflags } .so.1.0 { so } " ,
54
51
echo = True ,
55
52
)
56
- context .run (f"{ executable } setup.py bdist_wheel" , echo = True )
53
+ context .run (f"{ executable } setup.py bdist_wheel" , echo = True )
54
+ WHEELS = glob ("dist/*.whl" )
55
+ assert WHEELS , "No wheels in dist!"
56
+ print ("Before:" , * WHEELS , sep = "\n - " )
57
+ if platform == "linux" :
57
58
# We're typically eligible for manylinux1... or at least manylinux2010.
58
59
# This will remove the wheel if it was unchanged... but that will cause
59
60
# our assert to fail later, which is what we want!
60
61
for wheel in WHEELS :
62
+ context .run (f"auditwheel show { wheel } " , echo = True )
61
63
context .run (f"auditwheel repair { wheel } -w dist" , echo = True )
62
64
remove (wheel )
63
- elif platform == "darwin" :
64
- # We lie here, and say our 10.9 64-bit build is a 10.6 32/64-bit one.
65
- # This is because pip is conservative in what wheels it will use, but
66
- # Python installations are EXTREMELY liberal in their macOS support.
67
- # A typical user may be running a 32/64 Python built for 10.6.
68
- # In reality, we shouldn't worry about supporting 32-bit Snow Leopard.
69
- for wheel in WHEELS :
70
- fake = wheel .replace ("macosx_10_9_x86_64" , "macosx_10_6_intel" )
71
- replace (wheel , fake )
72
- assert (
73
- wheel != fake or "TRAVIS" not in environ
74
- ), "We expected a macOS 10.9 x86_64 build!"
75
- # Windows is fine.
65
+ else :
66
+ if platform == "darwin" :
67
+ # We lie here, and say our 10.9 64-bit build is a 10.6 32/64-bit one.
68
+ # This is because pip is conservative in what wheels it will use, but
69
+ # Python installations are EXTREMELY liberal in their macOS support.
70
+ # A typical user may be running a 32/64 Python built for 10.6.
71
+ # In reality, we shouldn't worry about supporting 32-bit Snow Leopard.
72
+ for wheel in WHEELS :
73
+ fake = wheel .replace ("macosx_10_9_x86_64" , "macosx_10_6_intel" )
74
+ replace (wheel , fake )
75
+ assert (
76
+ wheel != fake or "TRAVIS" not in environ
77
+ ), "We expected a macOS 10.9 x86_64 build!"
78
+ # Windows is fine.
76
79
FIXED = glob ("dist/*.whl" )
77
80
print ("After:" , * FIXED , sep = "\n - " )
78
81
assert len (WHEELS ) == len (FIXED ), "We gained or lost a wheel!"
0 commit comments