Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 35 additions & 9 deletions .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:
python-version: "3.10"
- name: Build wheel
run: |
pip install wheel
python setup.py bdist_wheel
pip install wheel
python setup.py bdist_wheel

- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
Expand All @@ -52,8 +52,8 @@ jobs:
python-version: "3.12"
- name: Build sdist
run: |
pip install build
python -m build --sdist --outdir ./dist
pip install build
python -m build --sdist --outdir ./dist
- name: Upload sdist artifact
uses: actions/upload-artifact@v4
with:
Expand All @@ -65,12 +65,19 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-latest]
os:
[
ubuntu-latest,
ubuntu-24.04-arm,
windows-latest,
macos-13,
macos-latest,
]
steps:
- name: Checkout repo
uses: actions/checkout@v5
with:
submodules: true
submodules: true
- name: Build wheels
uses: pypa/cibuildwheel@v3.1.4
with:
Expand Down Expand Up @@ -106,11 +113,30 @@ jobs:
path: dist
pattern: swmm-toolkit-*dist*
merge-multiple: true

- name: Upload consolidated archive
uses: actions/upload-artifact@v4
with:
name: swmm_toolkit_dist
path: ./dist/*


publish_toolkit:
name: Publish Python 🐍 distribution 📦 to PyPI
needs:
- merge_wheels
# only publish to PyPI on tag pushes
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/swmm-toolkit
permissions:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v5
with:
name: swmm_toolkit_dist
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 1 addition & 1 deletion swmm-toolkit/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["swig", "scikit-build-core>=0.4.3"]
requires = ["swig>=4.4.0", "scikit-build-core>=0.4.3"]
build-backend = "scikit_build_core.build"

[project]
Expand Down
6 changes: 3 additions & 3 deletions swmm-toolkit/src/swmm/toolkit/output.i
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,19 @@ and return a (possibly) different pointer */
/* INSERTS CUSTOM EXCEPTION HANDLING IN WRAPPER */
%exception SMO_init
{
$function
$action
}

%exception SMO_close
{
$function
$action
}

%exception
{
char *err_msg;
SMO_clearError(arg1);
$function
$action
if (SMO_checkError(arg1, &err_msg))
{
PyErr_SetString(PyExc_Exception, err_msg);
Expand Down
8 changes: 4 additions & 4 deletions swmm-toolkit/src/swmm/toolkit/solver.i
Original file line number Diff line number Diff line change
Expand Up @@ -190,23 +190,23 @@
/* INSERTS CUSTOM EXCEPTION HANDLING IN WRAPPER */
%exception swmm_getSemVersion
{
$function
$action
}

%exception swmm_getBuildId
{
$function
$action
}

%exception swmm_getVersion
{
$function
$action
}

/* INSERTS CUSTOM EXCEPTION HANDLING IN WRAPPER */
%exception
{
$function
$action
if (result > 0) {
char* errorMsg = NULL;
int errorCode = 0;
Expand Down