tree: support physical root across APIs #240
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: CI | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| jobs: | |
| test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - python-version: "3.10" | |
| profile: core | |
| extras: dev | |
| - python-version: "3.11" | |
| profile: core | |
| extras: dev | |
| - python-version: "3.12" | |
| profile: core | |
| extras: dev | |
| - python-version: "3.12" | |
| profile: extended | |
| extras: dev,test-extended | |
| - python-version: "3.12" | |
| profile: vmc | |
| extras: dev,vmc | |
| runs-on: ubuntu-latest | |
| env: | |
| NUMBA_CACHE_DIR: /tmp/numba_cache_pepsy | |
| NUMBA_DISABLE_CACHING: "1" | |
| PYTHONPYCACHEPREFIX: /tmp/pycache_pepsy | |
| MPLCONFIGDIR: /tmp/mplconfig_pepsy | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install package (${{ matrix.profile }}) | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[${{ matrix.extras }}]" | |
| - name: Validate source syntax | |
| run: python -m compileall -q -f src tests | |
| - name: Check Python lint | |
| run: | | |
| python -m pyflakes src/pepsy tests | |
| python -m ruff check src/pepsy tests | |
| - name: Run tests with coverage | |
| if: matrix.python-version == '3.12' && matrix.profile == 'core' | |
| run: pytest -q --cov=pepsy --cov-report=term-missing | |
| - name: Run extended tests with coverage | |
| if: matrix.profile == 'extended' | |
| run: pytest -q -o addopts="" --cov=pepsy --cov-report=term-missing --cov-fail-under=60 | |
| - name: Run tests | |
| if: matrix.profile == 'vmc' || (matrix.profile == 'core' && matrix.python-version != '3.12') | |
| run: pytest -q -o addopts="" | |
| typecheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install type-check dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev]" | |
| - name: Run focused type checks | |
| run: python -m mypy src/pepsy/tensors/validation.py src/pepsy/vmc/api.py | |
| package: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Build distributions | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev]" | |
| python -m build --sdist --wheel | |
| python -m twine check dist/* | |
| version="$(python -c "import pathlib, tomllib; print(tomllib.loads(pathlib.Path('pyproject.toml').read_text())['project']['version'])")" | |
| echo "Built Pepsy version: ${version}" | |
| - name: Smoke test wheel installation | |
| run: | | |
| smoke_dir="$(mktemp -d)" | |
| python -m venv "$smoke_dir/venv" | |
| "$smoke_dir/venv/bin/pip" install --no-deps dist/*.whl | |
| expected_version="$(python -c "import pathlib, tomllib; print(tomllib.loads(pathlib.Path('pyproject.toml').read_text())['project']['version'])")" | |
| EXPECTED_VERSION="$expected_version" "$smoke_dir/venv/bin/python" -c \ | |
| "import importlib.metadata as md, os, pepsy; expected=os.environ['EXPECTED_VERSION']; actual=md.version('pepsy'); assert pepsy.__version__ == actual == expected; assert hasattr(pepsy, 'experimental')" |