Python Tests #3516
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Python Tests | |
| on: | |
| workflow_dispatch: | |
| merge_group: | |
| schedule: | |
| - cron: '48 4 * * *' | |
| jobs: | |
| build: | |
| name: Python Version Matrix | |
| runs-on: ubuntu-24.04 | |
| continue-on-error: ${{ matrix.experimental }} | |
| env: | |
| AMICI_SKIP_CMAKE_TESTS: "TRUE" | |
| AMICI_PARALLEL_COMPILE: "" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - python-version: '3.11' | |
| experimental: false | |
| - python-version: '3.12' | |
| experimental: false | |
| - python-version: '3.13' | |
| experimental: false | |
| - python-version: '3.14' | |
| experimental: false | |
| steps: | |
| - run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV | |
| - run: echo "BNGPATH=${AMICI_DIR}/ThirdParty/BioNetGen-2.7.0" >> $GITHUB_ENV | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 20 | |
| lfs: true | |
| - name: Install apt dependencies | |
| uses: ./.github/actions/install-apt-dependencies | |
| - name: Build BNGL | |
| run: scripts/buildBNGL.sh | |
| - name: Install python package | |
| run: scripts/installAmiciSource.sh | |
| # install pysb before sympy to allow for sympy>=1.12 (https://github.com/pysb/pysb/commit/e83937cb8c74afc9b2fa96595b68464946745f33) | |
| - run: source venv/bin/activate && pip3 install git+https://github.com/pysb/pysb | |
| - run: source venv/bin/activate && pip3 install "sympy>1.12" | |
| - name: Get Pooch Cache Directory | |
| id: get-pooch-cache | |
| run: | | |
| echo "pooch-cache=$(source venv/bin/activate && python -c 'import pooch; print(pooch.os_cache("pooch"))')" >> $GITHUB_ENV | |
| - name: Cache Pooch Directory | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ env.pooch-cache }} | |
| key: ${{ runner.os }}-py${{ matrix.python-version }}-${{ github.job }} | |
| # https://github.com/sbmlteam/python-libsbml/issues/40 | |
| - name: No -Werror | |
| if: matrix.python-version == '3.11' | |
| run: sed -ri "s/ error//" pytest.ini | |
| - name: Python tests | |
| run: | | |
| source venv/bin/activate \ | |
| && python3 -m pytest \ | |
| --durations=10 \ | |
| --ignore-glob=*petab* \ | |
| --ignore-glob=*test_splines.py ${AMICI_DIR}/python/tests |