Skip to content

docs: add CONTRIBUTING.md and trims the AGENTS.md file using pointers #1951

docs: add CONTRIBUTING.md and trims the AGENTS.md file using pointers

docs: add CONTRIBUTING.md and trims the AGENTS.md file using pointers #1951

# Configuration to test CPU and GPU installations with uv.
#
# torch is a required dependency in [project.dependencies]. The CPU/GPU variant
# is selected at install time via extras defined in pyproject.toml:
#
# uv sync --extra cpu --group dev # CPU runners
# uv sync --extra gpu --group dev # GPU runners (CUDA 13.0, default)
# uv sync --extra gpu-cu128 --group dev # GPU runners (CUDA 12.8)
#
# The extras route torch to the correct PyTorch index via [tool.uv.sources]
# and [[tool.uv.index]] in pyproject.toml.
#
# We only run uv in CI: pip cannot do extras-based index routing and resolving
# the right CPU/GPU torch wheel with pip is brittle. The pip install path is
# still documented in the README for users who prefer it.
#
# Hosts used to run the tests:
# - ubuntu-latest for CPU: these are on github
# - cirun-aws-runner--${{ github.run_id }} for GPU: these are on AWS,
# orchestrated by cirun.io
name: CPU+GPU testing
on: [push, pull_request, workflow_dispatch]
jobs:
tests:
runs-on: ${{ matrix.runner }}
strategy:
matrix:
device: [cpu, gpu]
include:
- device: cpu
runner: ubuntu-latest
- device: gpu
runner: "cirun-aws-runner--${{ github.run_id }}"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v6
with:
python-version: 3.13
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install with uv
run: |
uv sync --extra ${{ matrix.device }} --group dev --locked
echo "$PWD/.venv/bin" >> $GITHUB_PATH
- name: Print torch version
run: |
python -c "import torch; print(torch.__version__)"
- name: Check torch variant is cpu
if: matrix.device == 'cpu'
run: |
python -c "import torch; assert torch.__version__.endswith('+cpu')"
- name: Check torch variant is cu130
if: matrix.device == 'gpu'
run: |
python -c "import torch; assert torch.__version__.endswith('+cu130')"
- name: Load cache data
uses: actions/cache/restore@v4
with:
path: tests/datastore_examples/npyfilesmeps/meps_example_reduced.v0.3.0.tar.gz
key: ${{ runner.os }}-meps-reduced-example-data-v0.3.0
restore-keys: |
${{ runner.os }}-meps-reduced-example-data-v0.3.0
- name: Run tests
run: |
pytest -vv -s --doctest-modules
- name: Upload test figures
uses: actions/upload-artifact@v4
with:
name: test-figures-${{ matrix.device }}
path: tests/test_outputs/
if-no-files-found: warn
retention-days: 30
- name: Save cache data
uses: actions/cache/save@v4
with:
path: tests/datastore_examples/npyfilesmeps/meps_example_reduced.v0.3.0.tar.gz
key: ${{ runner.os }}-meps-reduced-example-data-v0.3.0