Skip to content

Commit 8210aa9

Browse files
authored
Merge pull request #9 from meelgroup/fix-python-builds
Trying to fix python builds
2 parents f3dd9be + 7d0d791 commit 8210aa9

File tree

2 files changed

+46
-31
lines changed

2 files changed

+46
-31
lines changed

.github/workflows/newpython.yml

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,45 @@ jobs:
1515

1616
steps:
1717
- uses: actions/checkout@v4
18-
- uses: actions/setup-python@v3
1918

20-
- name: Install cibuildwheel
21-
run: python -m pip install cibuildwheel
19+
- name: Set up Python
20+
uses: actions/setup-python@v3
2221

23-
- name: Build wheels
24-
uses: pypa/cibuildwheel@d04cacbc9866d432033b1d09142936e6a0e2121a #v2.23.2
25-
env:
26-
CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-*"
27-
CIBW_ARCHS: auto64
28-
CIBW_SKIP: "*-win32 *-manylinux_i686"
29-
with:
30-
output-dir: wheelhouse
22+
- name: Install dependencies
23+
run: python -m pip install --upgrade pip twine flake8
24+
25+
- name: Build wheels (Linux)
26+
if: matrix.os == 'ubuntu-latest'
27+
run: |
28+
for PYVER in cp310-cp310 cp311-cp311 cp312-cp312 cp313-cp313; do
29+
docker run --rm -v ${{ github.workspace }}:/io quay.io/pypa/manylinux2014_x86_64 \
30+
/opt/python/${PYVER}/bin/pip install cython numpy build
31+
docker run --rm -v ${{ github.workspace }}:/io quay.io/pypa/manylinux2014_x86_64 \
32+
/opt/python/${PYVER}/bin/python -m build --wheel --outdir /io/wheelhouse/
33+
done
34+
35+
- name: Build wheels (Windows)
36+
if: matrix.os == 'windows-2022'
37+
run: |
38+
pip install cython numpy build
39+
python -m build --wheel --outdir wheelhouse/
3140
32-
- name: Get wheel filename
33-
id: wheel-name
41+
- name: Get wheel filenames
42+
id: wheel-names
3443
run: |
35-
WHEEL_NAME=$(ls ./wheelhouse/pycmsgen-*.whl | xargs -n 1 basename)
36-
echo "wheel_name=${WHEEL_NAME}" >> $GITHUB_OUTPUT
44+
ls ./wheelhouse/pycmsgen-*.whl | xargs -n 1 basename > wheel_names.txt
45+
echo "wheel_names<<EOF" >> $GITHUB_OUTPUT
46+
cat wheel_names.txt >> $GITHUB_OUTPUT
47+
echo "EOF" >> $GITHUB_OUTPUT
3748
3849
- uses: actions/upload-artifact@v4
3950
with:
4051
path: ./wheelhouse/pycmsgen-*.whl
41-
name: cmsgen-${{ matrix.os }}_${{ steps.wheel-name.outputs.wheel-name }}
52+
name: cmsgen-${{ matrix.os }}
4253

4354
- name: Install twine
4455
run: python -m pip install twine
56+
4557
- name: Publish wheels to PyPI
4658
env:
4759
TWINE_USERNAME: "__token__"

.github/workflows/python-tarball-build.yml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,36 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v4
13+
1314
- name: Set up Python
1415
uses: actions/setup-python@v3
16+
1517
- name: Install dependencies
1618
run: |
1719
python -m pip install --upgrade pip
1820
pip install twine flake8
21+
1922
- name: Install pypa/build
20-
run: >-
21-
python -m
22-
pip install
23-
build
24-
--user
23+
run: |
24+
python -m pip install build --user
25+
2526
- name: Build a source tarball
26-
run: >-
27-
python -m
28-
build
29-
--sdist
30-
--outdir dist/
27+
run: |
28+
python -m build --sdist --outdir dist/
29+
3130
- name: Build manylinux Python wheels
32-
uses: RalfG/python-wheels-manylinux-build
33-
with:
34-
build-requirements: 'cython numpy'
31+
run: |
32+
docker run --rm -v ${{ github.workspace }}:/io quay.io/pypa/manylinux2014_x86_64 \
33+
/opt/python/cp311-cp311/bin/pip install cython numpy
34+
docker run --rm -v ${{ github.workspace }}:/io quay.io/pypa/manylinux2014_x86_64 \
35+
/opt/python/cp311-cp311/bin/python -m build --wheel --outdir /io/dist/
36+
3537
- name: Upload Artifacts
3638
uses: actions/upload-artifact@v4
3739
with:
38-
name: python-wheel-artifact
39-
path: dist/*
40+
name: python-wheel-artifact
41+
path: dist/*
42+
4043
- name: Publish tarball to PyPI
4144
env:
4245
TWINE_USERNAME: "__token__"

0 commit comments

Comments
 (0)