Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/test-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ jobs:
test -f src/test_ml_project/data/datamodule.py
test -d tests

- name: Verify pixi non-PyG platforms
if: matrix.package-manager == 'pixi'
working-directory: /tmp/test-project
run: |
grep -F 'platforms = ["linux-64", "osx-arm64"]' pyproject.toml

- name: Verify dependencies (uv)
if: matrix.package-manager == 'uv'
working-directory: /tmp/test-project
Expand Down Expand Up @@ -108,3 +114,59 @@ jobs:
pixi run ruff check . || true
pixi run ruff format --check . || true
pixi run pytest tests/ || true

test-pyg-pixi-generation:
name: Test Pixi PyG Generation
runs-on: ubuntu-latest

steps:
- name: Checkout template
uses: actions/checkout@v4

- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh

- name: Add uv to PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Install pixi
run: curl -fsSL https://pixi.sh/install.sh | bash

- name: Add pixi to PATH
run: echo "$HOME/.pixi/bin" >> $GITHUB_PATH

- name: Generate pixi project with PyG enabled
run: |
uvx copier copy --trust \
--data project_name="test-pyg-project" \
--data package_name="test_pyg_project" \
--data description="Test PyG project" \
--data author_name="Test Author" \
--data author_email="test@example.com" \
--data python_version="3.11" \
--data package_manager="pixi" \
--data pytorch_cuda_preset="pytorch-2.8.0-cuda-12.6" \
--data use_ruff=true \
--data use_ty=true \
--data use_pytest=true \
--data use_torchvision=true \
--data use_torchaudio=false \
--data use_lightning=true \
--data lightning_version="2.4" \
--data use_hydra=true \
--data hydra_version="1.3" \
--data use_pytorch_geometric=true \
--data logger_choice="tensorboard" \
. /tmp/test-pyg-project

- name: Verify pixi PyG template output
working-directory: /tmp/test-pyg-project
run: |
grep -F 'platforms = ["linux-64"]' pyproject.toml
grep -F '[tool.pixi.feature.pyg.pypi-options]' pyproject.toml
grep -F 'index-url = "https://pypi.org/simple"' pyproject.toml
grep -F 'find-links = [{ url = "https://data.pyg.org/whl/torch-2.8.0+cu126.html" }]' pyproject.toml

- name: Verify dependencies (pixi PyG)
working-directory: /tmp/test-pyg-project
run: pixi install
13 changes: 12 additions & 1 deletion pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ explicit = true
name = "pytorch-geometric"
url = "https://data.pyg.org/whl/torch-{{ pytorch_version }}+cu{{ cuda_version | replace('.', '') }}.html"
explicit = true

[tool.uv.sources]
torch-scatter = { index = "pytorch-geometric" }
torch-sparse = { index = "pytorch-geometric" }
torch-cluster = { index = "pytorch-geometric" }
{% endif -%}

# ============================================================================
Expand Down Expand Up @@ -167,7 +172,7 @@ name = "{{ project_name }}"
version = "0.1.0"
description = "{{ description }}"
channels = ["nvidia", "pytorch", "conda-forge"]
platforms = ["linux-64", "osx-arm64"]
platforms = [{% if use_pytorch_geometric %}"linux-64"{% else %}"linux-64", "osx-arm64"{% endif %}]

# System requirements for CUDA-enabled training
# Note: These are advisory and only enforced on platforms where CUDA is available
Expand Down Expand Up @@ -245,6 +250,12 @@ torch-geometric = "*"
torch-scatter = "*"
torch-sparse = "*"
torch-cluster = "*"

# pixi resolves PyPI packages via pypi-options; find-links makes pre-built
# wheels discoverable from the PyG wheel server instead of building from source
[tool.pixi.feature.pyg.pypi-options]
index-url = "https://pypi.org/simple"
find-links = [{ url = "https://data.pyg.org/whl/torch-{{ pytorch_version }}+cu{{ cuda_version | replace('.', '') }}.html" }]
{% endif -%}

# ============================================================================
Expand Down
Loading