Skip to content

Commit 5406d00

Browse files
committed
Updated workflows with latest actions, test on Python 3.14 and mac.
Also greatly simplify wheel building to just rebuild all of the dependencies for each architecture rather than using pre-built binaries.
1 parent 04a370b commit 5406d00

File tree

3 files changed

+38
-144
lines changed

3 files changed

+38
-144
lines changed

.github/workflows/build-docs.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,33 @@ jobs:
1414
- uses: actions/checkout@v4
1515

1616
- name: Set up python
17-
uses: actions/setup-python@v5
17+
uses: actions/setup-python@v6
1818
with:
19-
python-version: 3.12
19+
python-version: 3.14
2020
cache: 'pip'
2121

22-
- name: Set up HDF5
22+
- name: Get latest CMake
23+
uses: lukka/get-cmake@latest
24+
25+
- name: Cache installed
26+
uses: actions/cache@v4
27+
with:
28+
path: installed
29+
key: installed-${{ matrix.os }}-${{ matrix.python-version }}
30+
31+
- name: Set up dependencies
2332
run: |
24-
sudo apt-get update
25-
sudo apt-get install libhdf5-dev
33+
python -m pip install setuptools
34+
python -c "import setup; setup.build_zlib(None); setup.build_libaec(None); setup.build_hdf5(None);"
2635
27-
- name: Install Python dependencies
36+
- name: Install dependencies
2837
run: |
29-
python -m pip install --upgrade pip setuptools
30-
pip install cmake pybind11 numpy assorthead tox
31-
DEPENDENCIES=$(python -c 'from setuptools.config.setupcfg import read_configuration as c; a = c("setup.cfg"); print(" ".join(a["options"]["install_requires"][1:]))')
32-
pip install ${DEPENDENCIES}
33-
DOCDEPENDENCIES=$(python -c 'with open("docs/requirements.txt") as a: available = list(a); print(" ".join(map(lambda x : x.strip(), filter(lambda x : not x.startswith("#"), available))))')
34-
pip install ${DOCDEPENDENCIES}
38+
python -m pip install --upgrade pip
39+
pip install flake8 pytest tox
3540
3641
- name: Build docs
3742
run: |
38-
python setup.py build_ext --inplace
39-
cp build/lib*/dolomite_base/lib_dolomite* src/dolomite_base/
4043
tox -e docs
41-
touch ./docs/_build/html/.nojekyll
4244
4345
- name: GH Pages Deployment
4446
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')

.github/workflows/publish-pypi.yml

Lines changed: 15 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -4,139 +4,31 @@ on:
44
push:
55
tags:
66
- "*"
7-
pull_request:
87

98
jobs:
10-
build_linux_x86_64:
11-
name: Build wheels for linux x86_64
12-
runs-on: ubuntu-latest
13-
steps:
14-
- name: Check out repository
15-
uses: actions/checkout@v4
16-
17-
- name: Build wheels
18-
uses: pypa/cibuildwheel@v2.22.0
19-
env:
20-
CIBW_ARCHS: x86_64
21-
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9"
22-
CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/artifactdb/prebuilt-hdf5/manylinux_x86_64:0.1.1
23-
CIBW_MUSLLINUX_X86_64_IMAGE: ghcr.io/artifactdb/prebuilt-hdf5/musllinux_x86_64:0.1.1
24-
CIBW_SKIP: pp*
25-
26-
- uses: actions/upload-artifact@v4
27-
with:
28-
name: cibw-wheels-ubuntu-x86_64
29-
path: ./wheelhouse/*.whl
30-
31-
build_linux_x86_64_legacy:
32-
name: Build wheels for linux x86_64
33-
runs-on: ubuntu-latest
34-
steps:
35-
- name: Check out repository
36-
uses: actions/checkout@v4
37-
38-
- name: Build wheels
39-
uses: pypa/cibuildwheel@v2.22.0
40-
env:
41-
CIBW_ARCHS: x86_64
42-
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9"
43-
CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/artifactdb/prebuilt-hdf5/manylinux_x86_64_legacy:0.1.2
44-
CIBW_BUILD: "*-manylinux_*"
45-
CIBW_SKIP: pp*
9+
build_wheels:
10+
name: Build wheels
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: ["ubuntu-latest", "macos-latest"]
15+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
4616

47-
- uses: actions/upload-artifact@v4
48-
with:
49-
name: cibw-wheels-ubuntu-x86_64_legacy
50-
path: ./wheelhouse/*.whl
51-
52-
build_macosx_x86_64:
53-
name: Build wheels for macosx x86_64
54-
runs-on: macos-13
5517
steps:
5618
- name: Check out repository
5719
uses: actions/checkout@v4
5820

59-
- name: Grab prebuilt dependencies
60-
run: |
61-
curl -L https://github.com/ArtifactDB/prebuilt-hdf5/releases/download/0.1.1/macosx_x86_64.tar.gz > bundle.tar.gz
62-
tar -xvf bundle.tar.gz
63-
6421
- name: Build wheels
65-
uses: pypa/cibuildwheel@v2.22.0
22+
uses: pypa/cibuildwheel@v3.3.0
6623
env:
67-
CIBW_ARCHS: x86_64
68-
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9"
69-
CIBW_ENVIRONMENT: "MORE_CMAKE_OPTIONS=\"-DCMAKE_INSTALL_PREFIX=$(pwd)/installed -DCMAKE_OSX_ARCHITECTURES=x86_64\""
70-
CIBW_BUILD_VERBOSITY: 3
24+
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.10"
7125
CIBW_SKIP: pp*
72-
MACOSX_DEPLOYMENT_TARGET: 13.7
7326

7427
- uses: actions/upload-artifact@v4
7528
with:
76-
name: cibw-wheels-macos-x86_64
29+
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
7730
path: ./wheelhouse/*.whl
7831

79-
build_macosx_arm64:
80-
name: Build wheels for macosx arm64
81-
runs-on: macos-14
82-
steps:
83-
- name: Check out repository
84-
uses: actions/checkout@v4
85-
86-
- name: Grab prebuilt dependencies
87-
run: |
88-
curl -L https://github.com/ArtifactDB/prebuilt-hdf5/releases/download/0.1.1/macosx_arm64.tar.gz > bundle.tar.gz
89-
tar -xvf bundle.tar.gz
90-
91-
- name: Build wheels
92-
uses: pypa/cibuildwheel@v2.22.0
93-
env:
94-
CIBW_ARCHS: arm64
95-
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9"
96-
CIBW_ENVIRONMENT: "MORE_CMAKE_OPTIONS=\"-DCMAKE_INSTALL_PREFIX=$(pwd)/installed -DCMAKE_OSX_ARCHITECTURES=arm64\""
97-
CIBW_BUILD_VERBOSITY: 3
98-
CIBW_SKIP: pp*
99-
MACOSX_DEPLOYMENT_TARGET: 14.0
100-
101-
- uses: actions/upload-artifact@v4
102-
with:
103-
name: cibw-wheels-maxos_arm64
104-
path: ./wheelhouse/*.whl
105-
106-
# build_windows_x86_64:
107-
# name: Build wheels for windows x86_64
108-
# runs-on: windows-2019
109-
# steps:
110-
# - name: Check out repository
111-
# uses: actions/checkout@v4
112-
#
113-
# - name: Grab prebuilt dependencies
114-
# run: |
115-
# curl -L https://github.com/ArtifactDB/prebuilt-hdf5/releases/download/0.0.4/windows_x86_64.tar.gz > bundle.tar.gz
116-
# tar -xvf bundle.tar.gz
117-
# shell: bash
118-
#
119-
# - name: Store path
120-
# run: |
121-
# $wd = pwd
122-
# echo "INSTALL_DIR=$wd\\installed" >> $env:GITHUB_ENV
123-
# shell: powershell
124-
#
125-
# - name: Build wheels
126-
# uses: pypa/cibuildwheel@v2.22.0
127-
# env:
128-
# CIBW_ARCHS: AMD64
129-
# CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9"
130-
# CIBW_ENVIRONMENT: "MORE_CMAKE_OPTIONS=\"-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}\" VERBOSE=1"
131-
# CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
132-
# CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}"
133-
# CIBW_TEST_EXTRAS: "testing"
134-
# CIBW_TEST_COMMAND: "pytest {package}/tests"
135-
# CIBW_BUILD_VERBOSITY: 3
136-
# - uses: actions/upload-artifact@v3
137-
# with:
138-
# path: ./wheelhouse/*.whl
139-
14032
build_sdist:
14133
name: Build source distribution
14234
runs-on: ubuntu-latest
@@ -154,17 +46,16 @@ jobs:
15446
path: dist/*.tar.gz
15547

15648
upload_pypi:
157-
if: startsWith(github.ref, 'refs/tags/')
158-
needs: [build_linux_x86_64, build_linux_x86_64_legacy, build_macosx_x86_64, build_macosx_arm64, build_sdist]
49+
needs: [build_wheels, build_sdist]
15950
runs-on: ubuntu-latest
51+
permissions:
52+
id-token: write # need this for OIDC
53+
16054
steps:
16155
- uses: actions/download-artifact@v4
16256
with:
16357
pattern: cibw-*
16458
path: dist
16559
merge-multiple: true
16660

167-
- uses: pypa/gh-action-pypi-publish@v1.12.2
168-
with:
169-
user: __token__
170-
password: ${{ secrets.PYPI_PASSWORD }}
61+
- uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/run-tests.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,18 @@ on:
88

99
jobs:
1010
test:
11-
runs-on: ubuntu-latest
11+
runs-on: ${{ matrix.os }}
1212
strategy:
1313
matrix:
14-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
14+
os: ["ubuntu-latest", "macos-latest"]
15+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
1516

1617
name: Python ${{ matrix.python-version }}
1718
steps:
1819
- uses: actions/checkout@v4
1920

2021
- name: Setup Python
21-
uses: actions/setup-python@v5
22+
uses: actions/setup-python@v6
2223
with:
2324
python-version: ${{ matrix.python-version }}
2425
cache: "pip"
@@ -30,12 +31,12 @@ jobs:
3031
uses: actions/cache@v4
3132
with:
3233
path: installed
33-
key: installed-${{ matrix.python-version }}
34+
key: installed-${{ matrix.os }}-${{ matrix.python-version }}
3435

3536
- name: Set up dependencies
3637
run: |
3738
python -m pip install setuptools
38-
python -c "import setup; setup.build_libaec(None); setup.build_hdf5(None);"
39+
python -c "import setup; setup.build_zlib(None); setup.build_libaec(None); setup.build_hdf5(None);"
3940
4041
- name: Test with tox
4142
run: |

0 commit comments

Comments
 (0)