Skip to content

Commit 1d99528

Browse files
authored
Merge pull request #152 from pyswmm/feat/update_swig
update swig and fix deprecation
2 parents 011a5ed + 89b1b4a commit 1d99528

File tree

4 files changed

+43
-17
lines changed

4 files changed

+43
-17
lines changed

.github/workflows/build_wheel.yml

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ jobs:
2828
python-version: "3.10"
2929
- name: Build wheel
3030
run: |
31-
pip install wheel
32-
python setup.py bdist_wheel
33-
31+
pip install wheel
32+
python setup.py bdist_wheel
33+
3434
- name: Upload wheel artifact
3535
uses: actions/upload-artifact@v4
3636
with:
@@ -52,8 +52,8 @@ jobs:
5252
python-version: "3.12"
5353
- name: Build sdist
5454
run: |
55-
pip install build
56-
python -m build --sdist --outdir ./dist
55+
pip install build
56+
python -m build --sdist --outdir ./dist
5757
- name: Upload sdist artifact
5858
uses: actions/upload-artifact@v4
5959
with:
@@ -65,12 +65,19 @@ jobs:
6565
strategy:
6666
fail-fast: false
6767
matrix:
68-
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-latest]
68+
os:
69+
[
70+
ubuntu-latest,
71+
ubuntu-24.04-arm,
72+
windows-latest,
73+
macos-13,
74+
macos-latest,
75+
]
6976
steps:
7077
- name: Checkout repo
7178
uses: actions/checkout@v5
7279
with:
73-
submodules: true
80+
submodules: true
7481
- name: Build wheels
7582
uses: pypa/[email protected]
7683
with:
@@ -106,11 +113,30 @@ jobs:
106113
path: dist
107114
pattern: swmm-toolkit-*dist*
108115
merge-multiple: true
109-
116+
110117
- name: Upload consolidated archive
111118
uses: actions/upload-artifact@v4
112119
with:
113120
name: swmm_toolkit_dist
114121
path: ./dist/*
115122

116-
123+
publish_toolkit:
124+
name: Publish Python 🐍 distribution 📦 to PyPI
125+
needs:
126+
- merge_wheels
127+
# only publish to PyPI on tag pushes
128+
if: startsWith(github.ref, 'refs/tags/')
129+
runs-on: ubuntu-latest
130+
environment:
131+
name: pypi
132+
url: https://pypi.org/p/swmm-toolkit
133+
permissions:
134+
id-token: write
135+
steps:
136+
- name: Download all the dists
137+
uses: actions/download-artifact@v5
138+
with:
139+
name: swmm_toolkit_dist
140+
path: dist/
141+
- name: Publish distribution 📦 to PyPI
142+
uses: pypa/gh-action-pypi-publish@release/v1

swmm-toolkit/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["swig", "scikit-build-core>=0.4.3"]
2+
requires = ["swig>=4.4.0", "scikit-build-core>=0.4.3"]
33
build-backend = "scikit_build_core.build"
44

55
[project]

swmm-toolkit/src/swmm/toolkit/output.i

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,19 +124,19 @@ and return a (possibly) different pointer */
124124
/* INSERTS CUSTOM EXCEPTION HANDLING IN WRAPPER */
125125
%exception SMO_init
126126
{
127-
$function
127+
$action
128128
}
129129

130130
%exception SMO_close
131131
{
132-
$function
132+
$action
133133
}
134134

135135
%exception
136136
{
137137
char *err_msg;
138138
SMO_clearError(arg1);
139-
$function
139+
$action
140140
if (SMO_checkError(arg1, &err_msg))
141141
{
142142
PyErr_SetString(PyExc_Exception, err_msg);

swmm-toolkit/src/swmm/toolkit/solver.i

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,23 +190,23 @@
190190
/* INSERTS CUSTOM EXCEPTION HANDLING IN WRAPPER */
191191
%exception swmm_getSemVersion
192192
{
193-
$function
193+
$action
194194
}
195195

196196
%exception swmm_getBuildId
197197
{
198-
$function
198+
$action
199199
}
200200

201201
%exception swmm_getVersion
202202
{
203-
$function
203+
$action
204204
}
205205

206206
/* INSERTS CUSTOM EXCEPTION HANDLING IN WRAPPER */
207207
%exception
208208
{
209-
$function
209+
$action
210210
if (result > 0) {
211211
char* errorMsg = NULL;
212212
int errorCode = 0;

0 commit comments

Comments
 (0)