Skip to content

Commit af06ed2

Browse files
authored
Merge pull request #281 from PowerGridModel/feature/musllinux-1.2
Build musllinux 1.2 in the pipeline
2 parents 490d8ce + f68c319 commit af06ed2

File tree

3 files changed

+51
-9
lines changed

3 files changed

+51
-9
lines changed

.github/workflows/main.yml

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,51 @@ jobs:
224224
- name: Test
225225
run: pytest
226226

227+
# TODO, remove this after official musllinux 1.2 image is there
228+
build-musllinux:
229+
runs-on: ubuntu-latest
230+
needs: [aquire-python-version-build-sdist]
231+
container: python:3.9-alpine3.17
232+
233+
steps:
234+
- uses: actions/checkout@v3
235+
236+
- uses: actions/download-artifact@v3
237+
with:
238+
name: version
239+
path: .
240+
241+
- name: Install dependency
242+
run: |
243+
apk update
244+
apk add gcc g++
245+
pip install build auditwheel patchelf
246+
247+
- name: Build
248+
env:
249+
CC: gcc
250+
CXX: g++
251+
run: |
252+
python -m build --wheel .
253+
auditwheel show dist/*
254+
auditwheel repair dist/*
255+
ls -al wheelhouse/
256+
257+
- name: Test
258+
run: |
259+
pip install wheelhouse/*
260+
pip install pytest pytest-cov
261+
pytest
262+
263+
- name: Keep wheel files
264+
uses: actions/upload-artifact@v3
265+
with:
266+
name: wheelhouse
267+
path: ./wheelhouse/*.whl
268+
227269
publish-wheels:
228-
needs: [build-cpp-test-linux, build-cpp-test-windows, build-cpp-test-macos, build-and-test-python, build-and-test-conda]
270+
# TODO remove build-musllinux after official musllinux 1.2 image is there
271+
needs: [build-cpp-test-linux, build-cpp-test-windows, build-cpp-test-macos, build-and-test-python, build-and-test-conda, build-musllinux]
229272
runs-on: ubuntu-latest
230273
permissions:
231274
contents: write

pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,12 @@ test-command = "pytest {package}/tests"
105105
# PyPy
106106
# musllinux when python < 3.9
107107
# musllinux in aarch64
108-
skip = ["pp*", "cp38-musllinux*", "*-musllinux_aarch64"]
108+
109+
# we disable musllinux in cibuildwheel because there is not support for musllinux 1.2 yet
110+
# we build separately at this moment
111+
skip = ["pp*", "*musllinux*"]
112+
# TODO restore this
113+
# skip = ["pp*", "cp38-musllinux*", "*-musllinux_aarch64"]
109114

110115
[tool.cibuildwheel.linux]
111116
archs = ["x86_64", "aarch64"]

setup.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import os
66
import platform
77
import shutil
8-
import sys
98
from itertools import chain
109
from pathlib import Path
1110
from typing import List
@@ -166,15 +165,10 @@ def generate_build_ext(pkg_dir: Path, pkg_name: str):
166165
else:
167166
# flags for Linux and Mac
168167
cflags += [
168+
"-std=c++20",
169169
"-O3",
170170
"-fvisibility=hidden",
171171
]
172-
# add c++20 or c++2a flag depending on gcc version
173-
# TODO remove this if musllinux upgrade to newer gcc version
174-
if "GCC 9." in sys.version:
175-
cflags += ["-std=c++2a"]
176-
else:
177-
cflags += ["-std=c++20"]
178172
lflags += ["-lpthread", "-O3"]
179173
# extra flag for Mac
180174
if platform.system() == "Darwin":

0 commit comments

Comments
 (0)