Skip to content

Commit

Permalink
Add support for musl wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
ObserverOfTime committed Jan 7, 2023
1 parent bb8d2d3 commit ca75f7d
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 43 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Here's a brief check list for releasing a new version:
CI build takes a while. These wheels are not automatically uploaded,
but there's ``./bin/download-windows-wheels`` script that downloads built
wheels. Then upload them with ``twine``.
- Run ``./bin/build-manylinux-wheels`` to build linux wheels and upload them to
- Run ``./bin/build-linux-wheels`` to build linux wheels and upload them to
PyPI (takes ~5 minutes).
- The `docs website`__ also has to be updated.
It's currently a static website deployed on GitHub Pages.
Expand Down
43 changes: 43 additions & 0 deletions bin/build-linux-wheels
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/usr/bin/env python3
"""Script for building 'manylinux' & 'musllinux' wheels for libsass.
Run me after putting the source distribution on pypi.
See: https://www.python.org/dev/peps/pep-0513/
"""
import os
import pipes
import subprocess
import tempfile


def check_call(*cmd):
print(
'build-linux-wheels>> ' +
' '.join(pipes.quote(part) for part in cmd),
)
subprocess.check_call(cmd)


def main():
os.makedirs('dist', exist_ok=True)
for platform in ('manylinux1', 'musllinux_1_1'):
with tempfile.TemporaryDirectory() as work:
pip = '/opt/python/cp37-cp37m/bin/pip'
check_call(
'docker', 'run', '-ti',
# Use this so the files are not owned by root
'--user', f'{os.getuid()}:{os.getgid()}',
# We'll do building in /work and copy results to /dist
'-v', f'{work}:/work:rw',
'-v', '{}:/dist:rw'.format(os.path.abspath('dist')),
f'quay.io/pypa/{platform}_x86_64:latest',
'bash', '-exc',
'{} wheel --verbose --wheel-dir /work --no-deps libsass && '
'auditwheel repair --wheel-dir /dist /work/*.whl'.format(pip),
)
return 0


if __name__ == '__main__':
raise SystemExit(main())
42 changes: 0 additions & 42 deletions bin/build-manylinux-wheels

This file was deleted.

0 comments on commit ca75f7d

Please sign in to comment.