Rename the cache memory options to name what they bound #71
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: Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python-version: ["3.13", "3.14"] | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| - name: Set up Python ${{ matrix.python-version }} | |
| run: uv python install ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: uv sync --python ${{ matrix.python-version }} --group dev --all-extras | |
| - name: Run tests | |
| if: ${{ !(matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13') }} | |
| run: uv run --all-extras pytest --tb=short -v | |
| - name: Run tests with coverage | |
| if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' | |
| run: uv run --all-extras pytest --tb=short -v --cov=pyphi --cov-report=xml | |
| - name: Upload coverage to Codecov | |
| if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./coverage.xml | |
| fail_ci_if_error: false | |
| test-no-xarray: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| - name: Set up Python 3.13 | |
| run: uv python install 3.13 | |
| - name: Install pyphi without xarray | |
| run: uv sync --python 3.13 --group dev | |
| - name: Run tests | |
| run: uv run pytest test/core/test_factored_tpm.py -v | |
| test-free-threaded: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| - name: Set up free-threaded Python 3.14t | |
| run: uv python install 3.14t | |
| - name: Create free-threaded environment and install | |
| # The dev dependency group is omitted on purpose: graphify's | |
| # tree-sitter-php has no free-threaded wheel. Install the runtime, | |
| # extras, and test tools directly. | |
| run: | | |
| uv venv --python 3.14t .venv-ft | |
| uv pip install --python .venv-ft \ | |
| -e ".[visualize,caching,emd,xarray]" pytest hypothesis | |
| - name: Assert the GIL stays disabled after import | |
| run: | | |
| PYTHON_GIL=0 .venv-ft/bin/python -c \ | |
| "import sys, pyphi; assert sys._is_gil_enabled() is False, 'GIL re-enabled after import pyphi'" | |
| - name: Run tests with the GIL disabled | |
| run: PYTHON_GIL=0 .venv-ft/bin/python -m pytest --tb=short |