Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 54b9c43

Browse files
jimisolajdavid
authored andcommitted
Add wheel support for musllinux
1 parent d76bb7a commit 54b9c43

3 files changed

Lines changed: 30 additions & 12 deletions

File tree

.github/workflows/wheels.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,7 @@ jobs:
3030

3131
- name: Build wheels
3232
run: python -m cibuildwheel --output-dir wheelhouse
33-
env:
34-
CIBW_BEFORE_ALL: sh build.sh
35-
CIBW_ENVIRONMENT: LIBGIT2_VERSION=1.7.1 LIBSSH2_VERSION=1.11.0 OPENSSL_VERSION=3.1.3 LIBGIT2=/project/ci
36-
CIBW_ENVIRONMENT_MACOS: LIBGIT2_VERSION=1.7.1 LIBSSH2_VERSION=1.11.0 OPENSSL_VERSION=3.1.3 LIBGIT2=/Users/runner/work/pygit2/pygit2/ci
37-
CIBW_SKIP: "*musl* pp3*"
38-
CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux2014"
39-
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
40-
CIBW_REPAIR_WHEEL_COMMAND_LINUX: "LD_LIBRARY_PATH=/project/ci/lib64 auditwheel repair -w {dest_dir} {wheel}"
41-
CIBW_REPAIR_WHEEL_COMMAND_MACOS: "DYLD_LIBRARY_PATH=/Users/runner/work/pygit2/pygit2/ci/lib delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel}"
42-
CIBW_ARCHS_MACOS: universal2
43-
CIBW_ARCHS_LINUX: x86_64 aarch64
44-
33+
4534
- uses: actions/upload-artifact@v3
4635
with:
4736
name: wheels
@@ -65,3 +54,4 @@ jobs:
6554
with:
6655
user: __token__
6756
password: ${{ secrets.PYPI_API_TOKEN }}
57+

build.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ if [ "$CIBUILDWHEEL" = "1" ]; then
7070
else
7171
yum install perl-IPC-Cmd -y
7272
fi
73+
elif [ -f /sbin/apk ]; then
74+
apk add wget
75+
if [ -z "$OPENSSL_VERSION" ]; then
76+
apk add openssl-dev
77+
fi
7378
fi
7479
rm -rf ci
7580
mkdir ci || true

pyproject.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,25 @@
11
[build-system]
22
requires = ["setuptools", "wheel"]
3+
4+
[tool.cibuildwheel]
5+
skip = "pp3*"
6+
7+
archs = ["auto"]
8+
build-frontend = "default"
9+
dependency-versions = "pinned"
10+
environment = {LIBGIT2_VERSION="1.7.1", LIBSSH2_VERSION="1.11.0", OPENSSL_VERSION="3.1.3", LIBGIT2="/project/ci"}
11+
12+
before-all = "sh build.sh"
13+
14+
[tool.cibuildwheel.linux]
15+
repair-wheel-command = "LD_LIBRARY_PATH=/project/ci/lib64 auditwheel repair -w {dest_dir} {wheel}"
16+
archs = ["x86_64", "aarch64"]
17+
18+
[[tool.cibuildwheel.overrides]]
19+
select = "*-musllinux*"
20+
repair-wheel-command = "LD_LIBRARY_PATH=/project/ci/lib auditwheel repair -w {dest_dir} {wheel}"
21+
22+
[tool.cibuildwheel.macos]
23+
environment = {LIBGIT2_VERSION="1.7.1", LIBSSH2_VERSION="1.11.0", OPENSSL_VERSION="3.1.3", LIBGIT2="/Users/runner/work/pygit2/pygit2/ci"}
24+
repair-wheel-command = "DYLD_LIBRARY_PATH=/Users/runner/work/pygit2/pygit2/ci/lib delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel}"
25+
archs = ["universal2"]

0 commit comments

Comments
 (0)