Repository navigation
build: the distribution is named datalab-capsule, like the other Data… #36
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, develop, "feature/**", "fix/**"] | |
| pull_request: | |
| branches: [main, develop] | |
| workflow_dispatch: | |
| workflow_call: | |
| jobs: | |
| cpython: | |
| name: CPython ${{ matrix.python-version }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.9", "3.12", "3.14"] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v7 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -e ".[test,dev,registry]" | |
| - name: Check that no application package is installed | |
| run: | | |
| python -c "import importlib.util as u, sys; found=[n for n in ('datalab','sigima','sigimax','guidata','qtpy') if u.find_spec(n)]; sys.exit(f'Unexpected packages: {found}' if found else 0)" | |
| - name: Lint with Ruff | |
| run: | | |
| ruff format --check . | |
| ruff check --output-format=github . | |
| - name: Test with pytest | |
| run: pytest -v | |
| pyodide: | |
| name: Pyodide 0.26.4 (Node) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v7 | |
| with: | |
| python-version: "3.12" | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22" | |
| - name: Build wheel | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip wheel . --no-deps -w dist | |
| - name: Run golden vectors and pytest in Pyodide | |
| working-directory: tests/pyodide | |
| run: | | |
| npm install --no-audit --no-fund | |
| node run_pyodide.mjs "$(ls ../../dist/*.whl)" | |
| clean-env: | |
| name: Capsule CLI in a clean environment | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v7 | |
| with: | |
| python-version: "3.12" | |
| - name: Build a wheel and capsules from the reference workspaces | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip wheel . --no-deps -w dist | |
| python -m venv /tmp/build-env | |
| /tmp/build-env/bin/pip install -q "$(ls dist/*.whl)[hdf5]" | |
| for edition in desktop web; do | |
| /tmp/build-env/bin/python examples/workspace_to_capsule.py \ | |
| "tests/fixtures/workspaces/${edition}_chain.h5" "/tmp/${edition}.dlcapsule" | |
| done | |
| - name: Validate and inspect without NumPy, h5py or any application | |
| run: | | |
| python -m venv /tmp/clean-env | |
| /tmp/clean-env/bin/pip install -q "$(ls dist/*.whl)" | |
| /tmp/clean-env/bin/python -c "import importlib.util as u, sys; found=[n for n in ('numpy','h5py','datalab','sigima','qtpy') if u.find_spec(n)]; sys.exit(f'Unexpected packages: {found}' if found else 0)" | |
| cd /tmp | |
| for edition in desktop web; do | |
| /tmp/clean-env/bin/workspace-capsule validate "${edition}.dlcapsule" | |
| /tmp/clean-env/bin/workspace-capsule inspect "${edition}.dlcapsule" | |
| /tmp/clean-env/bin/workspace-capsule inspect "${edition}.dlcapsule" --json > /dev/null | |
| done |