Skip to content
This repository was archived by the owner on Jun 27, 2025. It is now read-only.

Commit 68b4377

Browse files
committed
Reorganize build process.
1 parent 49c37da commit 68b4377

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed

tasks.py

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,41 +38,44 @@ def build(context):
3838
context.run(f"{executable} -m pip install --upgrade pip", echo=True)
3939
context.run(f"pip install -r requirements.txt", echo=True)
4040
context.run(
41-
f"{executable} setup.py develop sdist bdist_wheel",
41+
f"{executable} setup.py develop sdist",
4242
env={"CPPFLAGS": "-Werror -Wno-deprecated-declarations"},
4343
replace_env=False,
4444
)
45-
46-
WHEELS = glob("dist/*.whl")
47-
assert WHEELS, "No wheels in dist!"
48-
print("Before:", *WHEELS, sep="\n - ")
4945
if platform == "linux":
5046
from sys import abiflags
47+
5148
for so in glob("*.so"):
5249
context.run(
5350
f"patchelf --remove-needed libpython{get_python_version()}{abiflags}.so.1.0 {so}",
5451
echo=True,
5552
)
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":
5758
# We're typically eligible for manylinux1... or at least manylinux2010.
5859
# This will remove the wheel if it was unchanged... but that will cause
5960
# our assert to fail later, which is what we want!
6061
for wheel in WHEELS:
62+
context.run(f"auditwheel show {wheel}", echo=True)
6163
context.run(f"auditwheel repair {wheel} -w dist", echo=True)
6264
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.
7679
FIXED = glob("dist/*.whl")
7780
print("After:", *FIXED, sep="\n - ")
7881
assert len(WHEELS) == len(FIXED), "We gained or lost a wheel!"

0 commit comments

Comments
 (0)