11name : Notebook Testing
22
3+ env :
4+ PYTHON_VERSION : " 3.13"
5+
36on :
47 push :
58 branches :
@@ -27,10 +30,10 @@ jobs:
2730 runs-on : ubuntu-latest
2831 steps :
2932 - uses : actions/checkout@v5
30- - name : Set up Python 3.9
33+ - name : Set up Python ${{ env.PYTHON_VERSION }}
3134 uses : actions/setup-python@v5
3235 with :
33- python-version : 3.9
36+ python-version : ${{ env.PYTHON_VERSION }}
3437 - name : Install and run black for notebooks
3538 run : |
3639 python -m pip install --upgrade pip
4043 needs : lint
4144 strategy :
4245 matrix :
43- # not using macos-latest because pyenchant doesn't work with the new macos-14 arm64
44- os : [ubuntu-latest, macos-13, windows -latest]
46+ # using macos-13, last available intel architecture. macos-latest is arm64 architecture.
47+ os : [ubuntu-latest, windows-latest, macos -latest, macos-13 ]
4548 inputs : ["00_ or 01_ or 02_ or 03_ or 04_ or 05_", "06_ or 07_ or 08_ or 09_ or 10_"]
4649 runs-on : ${{ matrix.os }}
4750 steps :
@@ -54,10 +57,10 @@ jobs:
5457 key : notebook-data-${{ hashFiles('data/manifest.json') }}
5558 restore-keys : |
5659 notebook-data-${{ hashFiles('data/manifest.json') }}
57- - name : Set up Python 3.9
60+ - name : Set up Python ${{ env.PYTHON_VERSION }}
5861 uses : actions/setup-python@v5
5962 with :
60- python-version : 3.9
63+ python-version : ${{ env.PYTHON_VERSION }}
6164 - name : Install enchant on non windows systems
6265 shell : bash
6366 run : |
7881 if : steps.cache.outputs.cache-hit != 'true'
7982 run : python downloaddata.py data/ data/manifest.json
8083 - name : run the test
84+ shell : bash
8185 env :
8286 SIMPLE_ITK_MEMORY_CONSTRAINED_ENVIRONMENT : 1
83- run : |
87+ run : | # pyenchant has a problem locating libenchant on macOS-ARM64. setting this environment variable resolves the issue
88+ if [ "$RUNNER_OS" == "macOS" ] && [ "${{ matrix.os }}" != "macos-13" ]; then
89+ export PYENCHANT_LIBRARY_PATH=/opt/homebrew/lib/libenchant-2.dylib
90+ fi
8491 pytest -v --tb=short -k "${{matrix.inputs}}" tests/test_notebooks.py::Test_notebooks::test_python_notebook
0 commit comments