name: tests on: push: pull_request: jobs: test: runs-on: ubuntu-latest strategy: fail-fast: false matrix: python-version: ["3.9", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: pip install -r requirements.txt "pytest>=7" - name: Run tests run: pytest -q # Tests run against a synthetic fixture; tests requiring the large # Hugging Face-hosted .hdf5 files skip automatically when those files are absent. # The job above never installs torch, so conftest.py skips the whole magnet/ package. This job # installs the CPU inference stack and actually imports + tests magnet/, catching packaging and API # regressions (e.g. a clean-install `import magnet` failure). The weights-gated inference tests still # skip here (checkpoints are not in the repo); everything else runs. model: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: "3.12" - name: Install the CPU inference stack run: | pip install torch==2.5.0 --index-url https://download.pytorch.org/whl/cpu pip install -r magnet/requirements.txt pip install --no-deps ./magnet pip install "pytest>=7" - name: Run the magnet package tests run: pytest magnet/ -q