diff --git a/.github/workflows/pr-ci.yml b/.github/workflows/pr-ci.yml index e417af3..c5f6010 100644 --- a/.github/workflows/pr-ci.yml +++ b/.github/workflows/pr-ci.yml @@ -12,10 +12,9 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.12"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: setup-pixi - uses: prefix-dev/setup-pixi@v0.8.3 + uses: prefix-dev/setup-pixi@v0.9.6 - name: Run tests run: pixi run test diff --git a/template/.github/workflows/pr-ci.yml b/template/.github/workflows/pr-ci.yml index 0e17ea4..18c5f00 100644 --- a/template/.github/workflows/pr-ci.yml +++ b/template/.github/workflows/pr-ci.yml @@ -13,11 +13,10 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.12"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Setup pixi - uses: prefix-dev/setup-pixi@v0.8.3 + uses: prefix-dev/setup-pixi@v0.9.6 - name: Run integration tests id: tests run: pixi run test-integration @@ -30,7 +29,7 @@ jobs: continue-on-error: true - name: Save integration logs if: ${{ always() }} - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: integration-test-logs-${{ matrix.os }} path: tests/integration/resources/module/logs diff --git a/template/tests/integration_test.py b/template/tests/integration_test.py index e20dba3..c56b086 100644 --- a/template/tests/integration_test.py +++ b/template/tests/integration_test.py @@ -4,8 +4,8 @@ Contents may be updated in future template updates. """ -import json import subprocess +import tomllib from pathlib import Path import pytest @@ -13,22 +13,13 @@ @pytest.fixture(scope="module") -def pixi_environments(module_path) -> dict: - """Pixi environments defined for this project.""" - process = subprocess.run( - ["pixi", "info", "--json"], - check=True, - cwd=module_path, - capture_output=True, - text=True, - ) - return { - environment["name"]: environment - for environment in json.loads(process.stdout)["environments_info"] - } +def pixi_platforms(module_path) -> list[str]: + """Pixi platforms defined for this project.""" + with (module_path / "pixi.toml").open("rb") as pixi_config: + return tomllib.load(pixi_config)["workspace"]["platforms"] -def test_snakemake_environments(module_path, pixi_environments, tmp_path): +def test_snakemake_environments(module_path, pixi_platforms, tmp_path): """All Snakemake environment files should be based on pixi counterparts.""" env_dir = module_path / "workflow/envs" env_files = sorted(env_dir.glob("*.yaml")) @@ -47,7 +38,7 @@ def test_snakemake_environments(module_path, pixi_environments, tmp_path): generated_yaml = output_dir / env_file.name assert generated_yaml.read_text() == env_file.read_text() - for platform in pixi_environments[env_name]["platforms"]: + for platform in pixi_platforms: pin_file = env_dir / f"{env_name}.{platform}.pin.txt" assert pin_file.exists(), f"{env_name} has no conda pins for {platform}"