Skip to content

Commit 7fab378

Browse files
authored
Merge pull request #142 from pyswmm/dev-wheel-build
Dev wheel build
2 parents 2dd627c + a620d26 commit 7fab378

File tree

4 files changed

+26
-23
lines changed

4 files changed

+26
-23
lines changed

.github/workflows/build_wheel.yml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,32 @@ jobs:
2222

2323
steps:
2424
- name: Checkout repo
25-
uses: actions/checkout@v3
26-
with:
27-
submodules: true
25+
uses: actions/checkout@v5
2826

2927
- name: Install Python
30-
uses: actions/setup-python@v4
28+
uses: actions/setup-python@v5
3129
with:
32-
python-version: 3.10
30+
python-version: '3.10'
3331

3432
- name: Build wheel
3533
run: |
3634
pip install wheel
3735
python setup.py bdist_wheel
38-
- uses: actions/upload-artifact@v4
36+
37+
- name: Upload wheel artifact
38+
uses: actions/upload-artifact@v4
3939
with:
40+
name: nrtest-swmm-wheel
4041
path: nrtest-swmm/dist/*.whl
41-
42-
42+
4343

4444
build_wheels:
4545
runs-on: ${{ matrix.os }}
4646
strategy:
4747
fail-fast: false
4848
matrix:
4949
os: [ubuntu-latest, windows-latest, macos-latest]
50-
pyver: [cp39, cp310, cp311, cp312]
50+
pyver: [cp39, cp310, cp311, cp312, cp313]
5151

5252
steps:
5353
- name: Checkout repo
@@ -60,6 +60,7 @@ jobs:
6060
with:
6161
package-dir: ./swmm-toolkit
6262
env:
63+
MACOSX_DEPLOYMENT_TARGET: "11.0"
6364
CIBW_TEST_COMMAND: "pytest {package}/tests"
6465
CIBW_BEFORE_TEST: pip install -r {package}/test-requirements.txt
6566
# mac needs ninja to build
@@ -70,31 +71,31 @@ jobs:
7071
# configure cibuildwheel to build native archs ('auto'), and some emulated ones
7172
CIBW_ARCHS_LINUX: x86_64
7273
CIBW_ARCHS_WINDOWS: AMD64
73-
CIBW_ARCHS_MACOS: x86_64
74+
CIBW_ARCHS_MACOS: x86_64 arm64
7475
# only build current supported python: https://devguide.python.org/versions/
7576
# don't build pypy or musllinux to save build time. TODO: find a good way to support those archs
7677
CIBW_BUILD: ${{matrix.pyver}}-*
77-
CIBW_SKIP: cp36-* cp37-* pp* *-musllinux*
78+
CIBW_SKIP: cp38-* pp* *-musllinux*
7879
# Will avoid testing on emulated architectures
7980
# Skip trying to test arm64 builds on Intel Macs
80-
CIBW_TEST_SKIP: "*-*linux_{aarch64,ppc64le,s390x} *-macosx_arm64 *-macosx_universal2:arm64"
81+
CIBW_TEST_SKIP: "*-*linux_{aarch64,ppc64le,s390x} *-macosx_universal2:arm64"
8182
CIBW_BUILD_VERBOSITY: 1
8283

8384
- uses: actions/upload-artifact@v4
8485
with:
86+
name: wheels-${{ matrix.os }}-${{ matrix.pyver }}
8587
path: ./wheelhouse/*.whl
8688

8789
build_cross_wheels:
88-
runs-on: ${{ matrix.os }}
90+
runs-on: ubuntu-latest
8991
strategy:
9092
fail-fast: false
9193
matrix:
92-
os: [ubuntu-latest,macos-12]
93-
pyver: [cp38, cp39, cp310, cp311, cp312]
94+
pyver: [cp39, cp310, cp311, cp312, cp313]
9495

9596
steps:
9697
- name: Checkout repo
97-
uses: actions/checkout@v3
98+
uses: actions/checkout@v5
9899
with:
99100
submodules: true
100101

@@ -114,13 +115,13 @@ jobs:
114115
CIBW_BEFORE_BUILD_LINUX: rm -f $(which swig) && rm -f $(which swig4.0)
115116
# configure cibuildwheel to build native archs ('auto'), and some emulated ones
116117
CIBW_ARCHS_LINUX: aarch64
117-
CIBW_ARCHS_MACOS: arm64
118118
# only build current supported python: https://devguide.python.org/versions/
119119
# don't build pypy or musllinux to save build time. TODO: find a good way to support those archs
120120
CIBW_BUILD: ${{matrix.pyver}}-*
121-
CIBW_SKIP: cp36-* cp37-* cp-*38 pp* *-musllinux*
121+
CIBW_SKIP: cp-*38 pp* *-musllinux*
122122
CIBW_BUILD_VERBOSITY: 1
123123

124124
- uses: actions/upload-artifact@v4
125125
with:
126+
name: wheels-linux-aarch64-${{ matrix.pyver }}
126127
path: ./wheelhouse/*.whl

.github/workflows/unit_test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ jobs:
4444
python-version: "3.10"
4545

4646
- name: Build wheel in virtual env
47+
env:
48+
MACOSX_DEPLOYMENT_TARGET: "11.0"
4749
run: |
4850
python -m venv --clear ./build-env
4951
${{matrix.activate}}

swmm-toolkit/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def run(self):
8888
cmake_args = ["-GVisual Studio 17 2022","-Ax64"]
8989

9090
elif platform_system == "Darwin":
91-
cmake_args = ["-GXcode","-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=11.0"]
91+
cmake_args = ["-GXcode"]
9292

9393
else:
9494
cmake_args = ["-GUnix Makefiles"]

swmm-toolkit/test-requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22

33

4-
pytest == 7.1.1
5-
numpy == 1.21.6; python_version == "3.7"
6-
numpy == 1.24.4; python_version < "3.12"
7-
numpy == 1.26.2; python_version >= "3.12"
4+
pytest == 8.4.1
5+
numpy == 2.0.2; python_version < "3.10"
6+
numpy == 2.2.6; python_version == "3.10.*"
7+
numpy == 2.3.2; python_version >= "3.11"
88
aenum == 3.1.11

0 commit comments

Comments
 (0)