Skip to content

Commit 5b43486

Browse files
committed
CI: various updates
- Try installing the resulting wheel on all platforms, and importing `_fastdss`. - Allow building with any NumPy 2.x. - Allow Linux x86 to run the import test. - Testing tweaks to macOS builds.
1 parent e3faceb commit 5b43486

7 files changed

Lines changed: 41 additions & 11 deletions

File tree

.github/workflows/builds.yml

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Builds
33
# TODO: generalize steps
44

55
env:
6-
DSS_CAPI_TAG: '0.15.0b1'
6+
DSS_CAPI_TAG: '0.15.0b2'
77
ARTIFACTS_FOLDER: '${{ github.workspace }}/artifacts'
88

99
on:
@@ -33,7 +33,7 @@ jobs:
3333
conda_subdir: 'linux-64'
3434

3535
- arch: x86
36-
docker_image: 'pmeira/manylinux_wheel_fpc322_i686'
36+
docker_image: 'quay.io/pypa/manylinux_2_34_i686'
3737
dss_extensions_linux32: linux32
3838
gh_image: ubuntu-latest
3939
manylinux-base: 'manylinux2014'
@@ -89,7 +89,7 @@ jobs:
8989
name: 'packages-linux_${{ matrix.arch }}-${{ matrix.manylinux-base }}'
9090
path: '${{ github.workspace }}/artifacts'
9191
- name: Try installing the wheel
92-
if: ${{ matrix.arch != 'x86' }}
92+
continue-on-error: ${{ matrix.arch == 'x86' }}
9393
run: |
9494
docker run -e GITHUB_SHA -e GITHUB_REF -e DSS_CAPI_PATH=/build/dss_capi -v "${PWD}:/build" -w /build $DOCKER_IMAGE ${{ matrix.dss_extensions_linux32}} bash /build/dss_python_backend/ci/test_wheel.sh
9595
@@ -101,6 +101,7 @@ jobs:
101101
DSS_CAPI_PATH: '${{ github.workspace }}/dss_capi'
102102
#SDKROOT: '${{ github.workspace }}/MacOSX10.13.sdk'
103103
PYTHON: python
104+
MACOSX_DEPLOYMENT_TARGET: "11.0"
104105
steps:
105106
- uses: actions/checkout@v3
106107
with:
@@ -137,18 +138,25 @@ jobs:
137138
with:
138139
name: 'packages-darwin_x64'
139140
path: '${{ github.workspace }}/artifacts'
141+
- name: Try installing the wheel
142+
continue-on-error: true
143+
shell: bash
144+
run: |
145+
python -m pip install artifacts/dss_python_backend-*.whl
146+
python -c 'from dss_python_backend import lib, ffi; lib.DSS_NewCircuit(ffi.NULL, b"test123"); assert ffi.string(lib.Circuit_Get_Name(ffi.NULL)) == b"test123"'
147+
python -c 'from dss_python_backend import _fastdss'
140148
141149
build_macos_arm64:
142150
name: 'macOS ARM64'
143151
continue-on-error: false
144-
runs-on: 'macos-latest'
152+
runs-on: 'macos-15'
145153
env:
146154
DSS_CAPI_PATH: '${{ github.workspace }}/dss_capi'
147155
# SDKROOT: '${{ github.workspace }}/MacOSX10.13.sdk'
148156
PYTHON: python
149157
_PYTHON_HOST_PLATFORM: macosx-11.0-arm64
150158
ARCHFLAGS: '-arch arm64'
151-
159+
MACOSX_DEPLOYMENT_TARGET: "11.0"
152160
steps:
153161
- uses: actions/checkout@v3
154162
with:
@@ -185,6 +193,13 @@ jobs:
185193
with:
186194
name: 'packages-darwin_arm64'
187195
path: '${{ github.workspace }}/artifacts'
196+
- name: Try installing the wheel
197+
continue-on-error: true
198+
shell: bash
199+
run: |
200+
python -m pip install artifacts/dss_python_backend-*.whl
201+
python -c 'from dss_python_backend import lib, ffi; lib.DSS_NewCircuit(ffi.NULL, b"test123"); assert ffi.string(lib.Circuit_Get_Name(ffi.NULL)) == b"test123"'
202+
python -c 'from dss_python_backend import _fastdss'
188203
189204
build_win_x64:
190205
name: 'Windows x64'
@@ -219,6 +234,14 @@ jobs:
219234
with:
220235
name: 'packages-win_x64'
221236
path: '${{ github.workspace }}/artifacts'
237+
- name: Try installing the wheel
238+
continue-on-error: true
239+
shell: bash
240+
run: |
241+
python -m pip install artifacts/dss_python_backend-*.whl
242+
python -c "from dss_python_backend import lib, ffi; lib.DSS_NewCircuit(ffi.NULL, b'test123'); assert ffi.string(lib.Circuit_Get_Name(ffi.NULL)) == b'test123'"
243+
python -c "from dss_python_backend import _fastdss"
244+
222245
223246
build_win_x86:
224247
name: 'Windows x86'
@@ -254,6 +277,13 @@ jobs:
254277
with:
255278
name: 'packages-win_x86'
256279
path: '${{ github.workspace }}/artifacts'
280+
- name: Try installing the wheel
281+
continue-on-error: true
282+
shell: bash
283+
run: |
284+
python -m pip install artifacts/dss_python_backend-*.whl
285+
python -c "from dss_python_backend import lib, ffi; lib.DSS_NewCircuit(ffi.NULL, b'test123'); assert ffi.string(lib.Circuit_Get_Name(ffi.NULL)) == b'test123'"
286+
python -c "from dss_python_backend import _fastdss"
257287
258288
merge:
259289
name: 'Merge build artifacts'

ci/build_linux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export PATH=/opt/python/cp311-cp311/bin/:$PATH
33
# export DSS_PYTHON_BACKEND_MANYLINUX=1
44

55
cd dss_python_backend
6-
python3 -m pip install --user --upgrade pip setuptools packaging trove-classifiers cffi wheel numpy==2
6+
python3 -m pip install --user --upgrade pip setuptools packaging trove-classifiers cffi wheel 'numpy>=2,<3'
77
python3 setup.py --quiet bdist_wheel --py-limited-api cp37 --dist-dir="../artifacts_raw"
88
cd ..
99

ci/build_wheel.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
mkdir -p artifacts
22
cd dss_python_backend
3-
$PYTHON -m pip install --upgrade pip setuptools packaging trove-classifiers cffi wheel numpy==2
3+
$PYTHON -m pip install --upgrade pip setuptools packaging trove-classifiers cffi wheel 'numpy>=2,<3'
44
$PYTHON setup.py --quiet bdist_wheel --py-limited-api cp37 --dist-dir=$ARTIFACTS_FOLDER

ci/test_wheel.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
set -e -x
44

55
ORIGINAL_PATH=$PATH
6-
PYTHON_DIRS="cp311-cp311 cp312-cp312"
6+
PYTHON_DIRS="cp312-cp312 cp313-cp313 cp314-cp314"
77

88
for pydir in $PYTHON_DIRS
99
do
1010
echo Installing for CPython $pydir
1111
export PATH=/opt/python/${pydir}/bin/:$ORIGINAL_PATH
1212
python -m pip install artifacts/dss_python_backend-*.whl
1313
python -c 'from dss_python_backend import lib, ffi; lib.DSS_NewCircuit(ffi.NULL, b"test123"); assert ffi.string(lib.Circuit_Get_Name(ffi.NULL)) == b"test123"'
14+
python -c 'from dss_python_backend import _fastdss'
1415
done

dss_python_backend/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,5 @@
5656
# CffiApiUtil so we call it as soon as the DLL/so is loaded.
5757
lib.DSS_Start(ffi.NULL, 0)
5858

59-
__version__ = '0.15.0b1'
59+
__version__ = '0.15.0b2'
6060
__all__ = ['ffi', 'lib', 'loader_lib']

setup.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[metadata]
22
description_file = README.md
3-
license_files = LICENSE
43
url = https://github.com/dss-extensions/dss_python_backend/
54

65
[bdist_wheel]

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181

8282
setup(
8383
version=package_version,
84-
packages=['dss_python_backend'],
84+
packages=['dss_python_backend', 'dss_python_backend/include'],
8585
setup_requires=["cffi>=2.0.0"],
8686
cffi_modules= [
8787
"dss_build.py:ffi_builder_dss",

0 commit comments

Comments
 (0)