Skip to content

Commit 2665d4c

Browse files
authored
Fix building and testing issues (#467)
* update manifest to include new binaries * correct manifest syntax * make path explicit in build job * remove explicit path * add env variable * another attempt * remove old conditional * try 14.0 * debugging run * more debugging ideas * fix debug steps * adjust debug * change env var before build wntr * env var before python * fix macos setting * try forcing platform name * fix syntax * add testing step to install import * add upper bound to plotly requirement * checkout and install requirements.txt for wntr wheel test * test only one file since others break * checkout tests folder for testing * remove wheel testing. difficult to get working * another testing attempt. * another testing attempt. * Remove test wheels, still buggy. * Try including testing data in wheel * attempt to set working directory * another attempt * fix libomp issue * remove demos from wheel testing * remove files and tests for demos/examples
1 parent 719e015 commit 2665d4c

File tree

3 files changed

+40
-10
lines changed

3 files changed

+40
-10
lines changed

.github/workflows/build_tests.yml

+34-5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ jobs:
2121
os: [windows-latest, macOS-13, macos-latest, ubuntu-latest]
2222
fail-fast: false
2323
steps:
24+
- name: Macos debug and set deployment target variable
25+
if: ${{ matrix.os == 'macOS-13'}}
26+
run: |
27+
xcodebuild -version
28+
echo $MACOSX_DEPLOYMENT_TARGET
29+
export MACOSX_DEPLOYMENT_TARGET=13.0
30+
echo $MACOSX_DEPLOYMENT_TARGET
2431
- uses: actions/checkout@v4
2532
- name: Set up Python
2633
uses: actions/setup-python@v5
@@ -31,10 +38,16 @@ jobs:
3138
python --version
3239
python -m pip install --upgrade pip
3340
pip install wheel
34-
pip install -r requirements.txt
35-
- name: Build wheel
41+
pip install -r requirements.txt
42+
- name: Build macOS-13 # Special case due to unresolved wheel naming bug.
43+
if: ${{ matrix.os == 'macOS-13'}}
44+
run: |
45+
python setup.py bdist_wheel --plat-name macosx-13.0-universal2 --verbose
46+
ls dist/*
47+
- name: Build all other OS
48+
if: ${{ matrix.os != 'macOS-13'}}
3649
run: |
37-
python setup.py bdist_wheel
50+
python setup.py bdist_wheel --verbose
3851
ls dist/*
3952
- name: Save wheel
4053
uses: actions/upload-artifact@v4
@@ -64,10 +77,26 @@ jobs:
6477
python -m pip install --upgrade pip
6578
pip install wheel "numpy>=1.2.1,<2.0" scipy networkx pandas matplotlib setuptools
6679
pip install --no-index --pre --find-links=. wntr
67-
- name: Usage of wntr
80+
- name: Import wntr
6881
run: |
6982
python -c "import wntr"
70-
83+
- name: Checkout requirements.txt
84+
uses: actions/checkout@v4
85+
with:
86+
sparse-checkout: |
87+
requirements.txt
88+
wntr/tests/
89+
examples/
90+
wntr/epanet/libepanet/darwin-formula/libomp.rb
91+
sparse-checkout-cone-mode: false
92+
fetch-depth: 1
93+
- if: ${{ matrix.os == 'macos-latest' || matrix.os == 'macOS-13'}}
94+
run: |
95+
brew reinstall --build-from-source --formula wntr/epanet/libepanet/darwin-formula/libomp.rb
96+
- name: Test wntr
97+
run: |
98+
pip install -r requirements.txt
99+
pytest wntr/tests/ --ignore=wntr/tests/test_demos.py --ignore=wntr/tests/test_examples.py
71100
pytest_coverage:
72101
runs-on: ${{ matrix.os }}
73102
strategy:

MANIFEST.in

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
include README.md
22
include LICENSE.md
3-
include wntr/epanet/Darwin/*
4-
include wntr/epanet/Linux/*
5-
include wntr/epanet/Windows/*
3+
include wntr/epanet/libepanet/darwin-arm/*
4+
include wntr/epanet/libepanet/darwin-formula/*
5+
include wntr/epanet/libepanet/darwin-x64/*
6+
include wntr/epanet/libepanet/linux-x64/*
7+
include wntr/epanet/libepanet/windows-x64/*
68
include wntr/sim/aml/evaluator*
79
include wntr/sim/aml/numpy.i
810
include wntr/sim/network_isolation/network_isolation*
911
include wntr/sim/network_isolation/numpy.i
1012
include wntr/tests/networks_for_testing/*.inp
1113
include wntr/library/msx/*.json
1214
include wntr/library/msx/*.msx
13-
include wntr/epanet/libepanet/darwin-formula/libomp.rb

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ matplotlib
77
setuptools
88

99
# Optional
10-
plotly
10+
plotly<6.0
1111
folium
1212
utm
1313
openpyxl

0 commit comments

Comments
 (0)