Skip to content

Commit c393555

Browse files
Add support for musl wheels
1 parent ea776a2 commit c393555

File tree

3 files changed

+44
-43
lines changed

3 files changed

+44
-43
lines changed

CONTRIBUTING.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Here's a brief check list for releasing a new version:
5454
CI build takes a while. These wheels are not automatically uploaded,
5555
but there's ``./bin/download-windows-wheels`` script that downloads built
5656
wheels. Then upload them with ``twine``.
57-
- Run ``./bin/build-manylinux-wheels`` to build linux wheels and upload them to
57+
- Run ``./bin/build-linux-wheels`` to build linux wheels and upload them to
5858
PyPI (takes ~5 minutes).
5959
- The `docs website`__ also has to be updated.
6060
It's currently a static website deployed on GitHub Pages.

bin/build-linux-wheels

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/env python3
2+
"""Script for building 'manylinux' & 'musllinux' wheels for libsass.
3+
4+
Run me after putting the source distribution on pypi.
5+
6+
See: https://www.python.org/dev/peps/pep-0513/
7+
"""
8+
import os
9+
import pipes
10+
import subprocess
11+
import tempfile
12+
13+
14+
def check_call(*cmd):
15+
print(
16+
'build-linux-wheels>> ' +
17+
' '.join(pipes.quote(part) for part in cmd),
18+
)
19+
subprocess.check_call(cmd)
20+
21+
22+
def main():
23+
os.makedirs('dist', exist_ok=True)
24+
for platform in ('manylinux1', 'musllinux_1_1'):
25+
with tempfile.TemporaryDirectory() as work:
26+
pip = '/opt/python/cp37-cp37m/bin/pip'
27+
check_call(
28+
'docker', 'run', '-ti',
29+
# Use this so the files are not owned by root
30+
'--user', f'{os.getuid()}:{os.getgid()}',
31+
# We'll do building in /work and copy results to /dist
32+
'-v', f'{work}:/work:rw',
33+
'-v', '{}:/dist:rw'.format(os.path.abspath('dist')),
34+
f'quay.io/pypa/{platform}_x86_64:latest',
35+
'bash', '-exc',
36+
'{} wheel --verbose --wheel-dir /work --no-deps libsass && '
37+
'auditwheel repair --wheel-dir /dist /work/*.whl'.format(pip),
38+
)
39+
return 0
40+
41+
42+
if __name__ == '__main__':
43+
raise SystemExit(main())

bin/build-manylinux-wheels

-42
This file was deleted.

0 commit comments

Comments
 (0)