Skip to content

Commit d272afa

Browse files
Merge pull request #1082 from julien-tierny/ci
[CI] Re-enable python tests for MacOS
2 parents 1e9a425 + 922ff7a commit d272afa

File tree

5 files changed

+85
-49
lines changed

5 files changed

+85
-49
lines changed

.github/actions/test-ttk-unix/action.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,14 @@ runs:
2525
- name: Test Python example
2626
shell: bash
2727
run: |
28-
if [ "${{ matrix.os }}" != "macos-13" ] && [ "${{ matrix.os }}" != "macos-14" ] && [ "${{ matrix.os }}" != "macos-15" ]; then
29-
cd $GITHUB_WORKSPACE/examples/python
30-
python3 example.py ../data/inputData.vtu
31-
fi
28+
cd $GITHUB_WORKSPACE/examples/python
29+
python3 example.py ../data/inputData.vtu
3230
3331
- name: Test pvpython example
3432
shell: bash
3533
run: |
36-
if [ "${{ matrix.os }}" != "macos-13" ] && [ "${{ matrix.os }}" != "macos-14" ] && [ "${{ matrix.os }}" != "macos-15" ]; then
37-
cd $GITHUB_WORKSPACE/examples/pvpython
38-
pvpython example.py ../data/inputData.vtu
39-
fi
34+
cd $GITHUB_WORKSPACE/examples/pvpython
35+
pvpython example.py ../data/inputData.vtu
4036
4137
- name: Test standalone
4238
shell: bash

.github/workflows/package.yml

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -188,20 +188,23 @@ jobs:
188188
- uses: actions/checkout@v4
189189
name: Checkout TTK source code
190190

191-
- name: Remove hosted Python
192-
run: |
193-
sudo rm -rf /Library/Frameworks/Python.framework/
194-
sudo rm -rf /usr/local/Frameworks/Python.framework/
191+
- uses: actions/setup-python@v5
192+
with:
193+
python-version: '3.12'
195194

196195
- name: Install macOS dependencies
197196
run: |
198197
# ParaView dependencies
199-
brew reinstall python
200198
brew install --cask xquartz
201199
brew install llvm mesa glew qt@5 ninja
202200
# TTK dependencies
203201
brew install boost eigen graphviz spectra sqlite zlib numpy qhull
204202
203+
- name: Install and setup sccache
204+
uses: f3d-app/sccache-setup-action@v1
205+
with:
206+
key: macos-0
207+
205208
- name: Install optional dependencies
206209
uses: ./.github/actions/install-deps-unix
207210

@@ -210,7 +213,11 @@ jobs:
210213
wget https://github.com/${{ env.PV_REPO }}/releases/download/${{ env.PV_TAG }}/ttk-paraview-${{ env.PV_TAG }}-${{ matrix.os }}.tar.gz
211214
tar xzf ttk-paraview-${{ env.PV_TAG }}-${{ matrix.os }}.tar.gz
212215
sudo cp -r ttk-paraview/* /usr/local
216+
# pvpython does not embed the correct PYTHONPATH
217+
echo "PYTHONPATH=/usr/local/lib/python3.12/site-packages:$PYTHONPATH" >> $GITHUB_ENV
213218
pvpython -m pip install --break-system-packages scikit-learn
219+
# pvpython is expecting a vtkpython executable at this path
220+
sudo ln -s /usr/local/bin/pvpython /Library/Frameworks/Python.framework/Versions/3.12/vtkpython
214221
215222
- name: Set compilers as environment variables
216223
run: |
@@ -224,8 +231,6 @@ jobs:
224231
cmake \
225232
-DCMAKE_BUILD_TYPE=Release \
226233
-DQt5_DIR=$(brew --prefix qt@5)/lib/cmake/Qt5 \
227-
-DPython3_FIND_STRATEGY=LOCATION \
228-
-DPython3_ROOT_DIR=$(brew --prefix python) \
229234
-DTTK_BUILD_PARAVIEW_PLUGINS=TRUE \
230235
-DTTK_BUILD_VTK_WRAPPERS=TRUE \
231236
-DTTK_BUILD_STANDALONE_APPS=TRUE \
@@ -267,25 +272,30 @@ jobs:
267272
- uses: actions/checkout@v4
268273
name: Checkout TTK source code
269274

270-
- name: Remove hosted Python
271-
run: |
272-
sudo rm -rf /Library/Frameworks/Python.framework
273-
sudo rm -rf /usr/local/Frameworks/Python.framework
275+
- uses: actions/setup-python@v5
276+
with:
277+
python-version: '3.12'
274278

275279
- name: Install macOS dependencies
276280
run: |
277281
# ParaView dependencies
278-
brew reinstall python
279282
brew install --cask xquartz
280283
brew install llvm mesa glew qt@5 ninja
281284
# TTK dependencies
282285
brew install boost eigen graphviz spectra sqlite zlib numpy qhull
283286
287+
- name: Install and setup sccache
288+
uses: f3d-app/sccache-setup-action@v1
289+
with:
290+
key: macos-0
291+
292+
- name: Install optional dependencies
293+
uses: ./.github/actions/install-deps-unix
294+
284295
- name: Fetch TTK-ParaView
285296
run: |
286297
wget -O ttk-paraview.tar.gz https://github.com/${{ env.PV_REPO }}/releases/download/${{ env.PV_TAG }}/ttk-paraview-${{ env.PV_TAG }}-${{ matrix.os }}.tar.gz
287298
288-
289299
- name: Fetch TTK .tar.gz artifact
290300
uses: actions/[email protected]
291301
with:
@@ -305,7 +315,9 @@ jobs:
305315
echo "CXX=$(brew --prefix llvm)/bin/clang++" >> $GITHUB_ENV
306316
echo "CMAKE_PREFIX_PATH=$(brew --prefix qt@5)/lib/cmake:$CMAKE_PREFIX_PATH" >> $GITHUB_ENV
307317
# pvpython does not embed the correct PYTHONPATH
308-
echo "PYTHONPATH=/usr/local/lib/python3.13/site-packages:$PYTHONPATH" >> $GITHUB_ENV
318+
echo "PYTHONPATH=/usr/local/lib/python3.12/site-packages:$PYTHONPATH" >> $GITHUB_ENV
319+
# pvpython is expecting a vtkpython executable at this path
320+
sudo ln -s /usr/local/bin/pvpython /Library/Frameworks/Python.framework/Versions/3.12/vtkpython
309321
310322
- name: Run TTK tests
311323
uses: ./.github/actions/test-ttk-unix
@@ -326,7 +338,7 @@ jobs:
326338
# remove examples which fill up the memory
327339
rm python/topologicalOptimization_darkSky.py
328340
# some cases fail only with version 12
329-
if [[ "${{ matrix.os }}" == "macos-12" ]]; then
341+
if [[ "${{ matrix.os }}" == "macos-13" ]]; then
330342
rm python/contourTreeAlignment.py
331343
rm python/geometryApproximation.py
332344
rm python/harmonicSkeleton.py

.github/workflows/test.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -280,14 +280,13 @@ jobs:
280280
- uses: actions/checkout@v4
281281
name: Checkout TTK source code
282282

283-
- name: Remove hosted Python
284-
run: |
285-
sudo rm -rf /Library/Frameworks/Python.framework/
286-
sudo rm -rf /usr/local/Frameworks/Python.framework/
283+
- uses: actions/setup-python@v5
284+
with:
285+
python-version: '3.12'
286+
287287
- name: Install macOS dependencies
288288
run: |
289289
# ParaView dependencies
290-
brew reinstall python
291290
brew install --cask xquartz
292291
brew install llvm ninja open-mpi
293292
# TTK dependencies
@@ -310,7 +309,11 @@ jobs:
310309
run: |
311310
tar xzf ttk-paraview-headless.tar.gz
312311
sudo cp -r ttk-paraview/* /usr/local
312+
# pvpython does not embed the correct PYTHONPATH
313+
echo "PYTHONPATH=/usr/local/lib/python3.12/site-packages:$PYTHONPATH" >> $GITHUB_ENV
313314
pvpython -m pip install --break-system-packages scikit-learn
315+
# pvpython is expecting a vtkpython executable at this path
316+
sudo ln -s /usr/local/bin/pvpython /Library/Frameworks/Python.framework/Versions/3.12/vtkpython
314317
315318
- name: Set compilers as environment variables
316319
run: |
@@ -349,11 +352,6 @@ jobs:
349352
shell: bash
350353
run: sccache --show-stats
351354

352-
- name: Set PYTHONPATH for macOS pvpython
353-
run: |
354-
# pvpython does not embed the correct PYTHONPATH
355-
echo "PYTHONPATH=/usr/local/lib/python3.13/site-packages:$PYTHONPATH" >> $GITHUB_ENV
356-
357355
- name: Run TTK tests
358356
uses: ./.github/actions/test-ttk-unix
359357

@@ -365,7 +363,6 @@ jobs:
365363
name: Checkout ttk-data
366364

367365
- name: Run ttk-data states [NOT ENFORCED]
368-
if: false
369366
id: validate
370367
continue-on-error: true
371368
run: |
@@ -374,6 +371,8 @@ jobs:
374371
rm ttk-data/states/nestedTrackingFromOverlap.py
375372
# remove examples which fill up the memory
376373
rm ttk-data/states/topologicalOptimization_darkSky.pvsm
374+
# remove examples that take too long to render under mac
375+
rm ttk-data/states/persistentGenerators_householdAnalysis.pvsm
377376
cd ttk-data/tests
378377
mkdir output_screenshots
379378
pvpython -u validate.py || (tar zcf screenshots.tar.gz output_screenshots && false)
@@ -384,12 +383,11 @@ jobs:
384383
if: steps.validate.outcome == 'failure'
385384
uses: actions/upload-artifact@v4
386385
with:
387-
name: screenshots-macOS.tar.gz
386+
name: screenshots-${{ matrix.os }}.tar.gz
388387
path: ttk-data/tests/screenshots.tar.gz
389388
retention-days: 10
390389

391-
- name: Run ttk-data Python scripts [TEMPORARILY NOT ENFORCED]
392-
continue-on-error: true
390+
- name: Run ttk-data Python scripts
393391
run: |
394392
cd ttk-data
395393
# remove buggy example

paraview/patch/headless.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,15 @@ jobs:
8080
- uses: actions/checkout@v4
8181
name: Checkout TTK-ParaView source code
8282

83-
- name: Remove hosted Python
84-
run: |
85-
sudo rm -rf /Library/Frameworks/Python.framework/
86-
sudo rm -rf /usr/local/Frameworks/Python.framework/
83+
- uses: actions/setup-python@v5
84+
with:
85+
python-version: '3.12'
8786

8887
- name: Install macOS dependencies
8988
run: |
9089
# ParaView dependencies
91-
brew reinstall python
9290
brew install --cask xquartz
93-
brew install ninja
91+
brew install ninja open-mpi
9492
9593
- name: Create & configure ParaView build directory
9694
run: |
@@ -112,6 +110,22 @@ jobs:
112110
cd build
113111
cpack -G TGZ
114112
113+
- name: Install ParaView
114+
run: |
115+
cd build
116+
sudo cmake --build . --target install
117+
# pvpython does not embed the correct PYTHONPATH
118+
echo "PYTHONPATH=/usr/local/lib/python3.12/site-packages:$PYTHONPATH" >> $GITHUB_ENV
119+
120+
- name: Test Python imports
121+
run: |
122+
python3 -m vtk
123+
python3 -m paraview.simple
124+
pvpython -m vtk
125+
pvpython -m paraview.simple
126+
env:
127+
DYLD_LIBRARY_PATH: /usr/local/lib
128+
115129
- name: Upload compressed binaries
116130
uses: actions/upload-artifact@v4
117131
with:

paraview/patch/package.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,20 @@ jobs:
7676
strategy:
7777
matrix:
7878
os: [macos-13, macos-14, macos-15]
79+
env:
80+
CCACHE_DIR: /Users/runner/work/ttk/.ccache
81+
CCACHE_MAXSIZE: 200M
7982
steps:
8083
- uses: actions/checkout@v4
8184
name: Checkout TTK-ParaView source code
8285

83-
- name: Remove hosted Python
84-
run: |
85-
sudo rm -rf /Library/Frameworks/Python.framework/
86-
sudo rm -rf /usr/local/Frameworks/Python.framework
86+
- uses: actions/setup-python@v5
87+
with:
88+
python-version: '3.12'
8789

8890
- name: Install macOS dependencies
8991
run: |
9092
# ParaView dependencies
91-
brew reinstall python
9293
brew install --cask xquartz
9394
brew install mesa glew qt@5 ninja
9495
@@ -98,7 +99,6 @@ jobs:
9899
cmake \
99100
-DCMAKE_BUILD_TYPE=Release \
100101
-DQt5_DIR=$(brew --prefix qt@5)/lib/cmake/Qt5 \
101-
-DPython3_ROOT_DIR=$(brew --prefix python) \
102102
-GNinja \
103103
$GITHUB_WORKSPACE
104104
@@ -112,6 +112,22 @@ jobs:
112112
cd build
113113
cpack -G TGZ
114114
115+
- name: Install ParaView
116+
run: |
117+
cd build
118+
sudo cmake --build . --target install
119+
# pvpython does not embed the correct PYTHONPATH
120+
echo "PYTHONPATH=/usr/local/lib/python3.12/site-packages:$PYTHONPATH" >> $GITHUB_ENV
121+
122+
- name: Test Python imports
123+
run: |
124+
python3 -m vtk
125+
python3 -m paraview.simple
126+
pvpython -m vtk
127+
pvpython -m paraview.simple
128+
env:
129+
DYLD_LIBRARY_PATH: /usr/local/lib
130+
115131
- name: Upload compressed binaries
116132
uses: actions/upload-artifact@v4
117133
with:

0 commit comments

Comments
 (0)