From 247c8bdd937781d94afdfae44b8c383876bfcded Mon Sep 17 00:00:00 2001 From: nishide-dev Date: Thu, 23 Apr 2026 16:05:34 +0900 Subject: [PATCH 1/4] fix: resolve PyG package indexes for pixi and uv Limit pixi PyG generation to linux-64 and add uv source configuration so PyG wheels resolve from the correct indexes. --- pyproject.toml.jinja | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pyproject.toml.jinja b/pyproject.toml.jinja index 8378aab..1e8259e 100755 --- a/pyproject.toml.jinja +++ b/pyproject.toml.jinja @@ -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 -%} # ============================================================================ @@ -167,7 +172,7 @@ name = "{{ project_name }}" version = "0.1.0" description = "{{ description }}" channels = ["nvidia", "pytorch", "conda-forge"] -platforms = ["linux-64", "osx-arm64"] +platforms = ["linux-64"] # System requirements for CUDA-enabled training # Note: These are advisory and only enforced on platforms where CUDA is available @@ -245,6 +250,11 @@ torch-geometric = "*" torch-scatter = "*" torch-sparse = "*" torch-cluster = "*" + +# pixi uses uv internally for PyPI resolution; find-links makes pre-built +# wheels discoverable from the PyG wheel server instead of building from source +[tool.uv] +find-links = ["https://data.pyg.org/whl/torch-{{ pytorch_version }}+cu{{ cuda_version | replace('.', '') }}.html"] {% endif -%} # ============================================================================ From bd2590e9a4ac995d6e240bb0461483ac57b78bc2 Mon Sep 17 00:00:00 2001 From: nishide-dev Date: Thu, 23 Apr 2026 16:19:26 +0900 Subject: [PATCH 2/4] fix: preserve macOS pixi support outside PyG Keep osx-arm64 support for non-PyG pixi projects and add CI coverage for both the non-PyG and PyG pixi template branches. --- .github/workflows/test-template.yml | 60 +++++++++++++++++++++++++++++ pyproject.toml.jinja | 2 +- 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-template.yml b/.github/workflows/test-template.yml index 5a7d395..6864eb0 100755 --- a/.github/workflows/test-template.yml +++ b/.github/workflows/test-template.yml @@ -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 'platforms = ["linux-64", "osx-arm64"]' pyproject.toml + - name: Verify dependencies (uv) if: matrix.package-manager == 'uv' working-directory: /tmp/test-project @@ -108,3 +114,57 @@ 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 'platforms = ["linux-64"]' pyproject.toml + grep 'find-links = ["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 diff --git a/pyproject.toml.jinja b/pyproject.toml.jinja index 1e8259e..ef0e28a 100755 --- a/pyproject.toml.jinja +++ b/pyproject.toml.jinja @@ -172,7 +172,7 @@ name = "{{ project_name }}" version = "0.1.0" description = "{{ description }}" channels = ["nvidia", "pytorch", "conda-forge"] -platforms = ["linux-64"] +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 From d782b1776429cd0e8bd21ec2e9b0663c194ac068 Mon Sep 17 00:00:00 2001 From: nishide-dev Date: Thu, 23 Apr 2026 16:28:13 +0900 Subject: [PATCH 3/4] fix: use pixi pypi-options for PyG wheel links Switch the pixi PyG template to pixi-specific pypi-options and fix the workflow grep checks to match the rendered output reliably. --- .github/workflows/test-template.yml | 7 ++++--- pyproject.toml.jinja | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-template.yml b/.github/workflows/test-template.yml index 6864eb0..d499e73 100755 --- a/.github/workflows/test-template.yml +++ b/.github/workflows/test-template.yml @@ -79,7 +79,7 @@ jobs: if: matrix.package-manager == 'pixi' working-directory: /tmp/test-project run: | - grep 'platforms = ["linux-64", "osx-arm64"]' pyproject.toml + grep -F 'platforms = ["linux-64", "osx-arm64"]' pyproject.toml - name: Verify dependencies (uv) if: matrix.package-manager == 'uv' @@ -162,8 +162,9 @@ jobs: - name: Verify pixi PyG template output working-directory: /tmp/test-pyg-project run: | - grep 'platforms = ["linux-64"]' pyproject.toml - grep 'find-links = ["https://data.pyg.org/whl/torch-2.8.0+cu126.html"]' pyproject.toml + grep -F 'platforms = ["linux-64"]' pyproject.toml + grep -F '[tool.pixi.pypi-options]' 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 diff --git a/pyproject.toml.jinja b/pyproject.toml.jinja index ef0e28a..8727921 100755 --- a/pyproject.toml.jinja +++ b/pyproject.toml.jinja @@ -251,10 +251,10 @@ torch-scatter = "*" torch-sparse = "*" torch-cluster = "*" -# pixi uses uv internally for PyPI resolution; find-links makes pre-built +# 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.uv] -find-links = ["https://data.pyg.org/whl/torch-{{ pytorch_version }}+cu{{ cuda_version | replace('.', '') }}.html"] +[tool.pixi.pypi-options] +find-links = [{ url = "https://data.pyg.org/whl/torch-{{ pytorch_version }}+cu{{ cuda_version | replace('.', '') }}.html" }] {% endif -%} # ============================================================================ From e405e432af74e73b031b41c9497f63f213d32b76 Mon Sep 17 00:00:00 2001 From: nishide-dev Date: Thu, 23 Apr 2026 16:41:28 +0900 Subject: [PATCH 4/4] fix: scope pixi PyG package resolution to the feature Use feature-scoped pixi pypi-options with an explicit PyPI index so the PyG wheel links supplement, rather than replace, normal package resolution. --- .github/workflows/test-template.yml | 3 ++- pyproject.toml.jinja | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-template.yml b/.github/workflows/test-template.yml index d499e73..fe03466 100755 --- a/.github/workflows/test-template.yml +++ b/.github/workflows/test-template.yml @@ -163,7 +163,8 @@ jobs: working-directory: /tmp/test-pyg-project run: | grep -F 'platforms = ["linux-64"]' pyproject.toml - grep -F '[tool.pixi.pypi-options]' 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) diff --git a/pyproject.toml.jinja b/pyproject.toml.jinja index 8727921..b2b8c64 100755 --- a/pyproject.toml.jinja +++ b/pyproject.toml.jinja @@ -253,7 +253,8 @@ 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.pypi-options] +[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 -%}