From bc1bc41255ad0ccda3e4a64eddc4a2042757bfc1 Mon Sep 17 00:00:00 2001 From: Ivan Ruiz Manuel <72193617+irm-codebase@users.noreply.github.com> Date: Fri, 3 Jul 2026 12:40:05 +0200 Subject: [PATCH] Make export work on windows --- template/pixi.toml.jinja | 16 ++++++++++------ tests/template_test.py | 11 ++++++++++- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/template/pixi.toml.jinja b/template/pixi.toml.jinja index 80fdab3..64f4a12 100644 --- a/template/pixi.toml.jinja +++ b/template/pixi.toml.jinja @@ -44,10 +44,14 @@ cmd = "pixi workspace export conda-environment --environment '{{ env }}' '{{ out [tasks._export-snakemake-pin] description = "Export one Pixi environment/platform as a Snakemake-compatible pin file" -args = ["env", "platform", { arg = "outdir", default = "workflow/envs" }] -cmd = """ -set -e -pixi workspace export conda-explicit-spec --environment '{{ env }}' --platform '{{ platform }}' '{{ outdir }}' -mv '{{ outdir }}/{{ env }}_{{ platform }}_conda_spec.txt' '{{ outdir }}/{{ env }}.{{ platform }}.pin.txt' -""" +args = ["env", "platform", "outdir"] +depends-on = [ + { task = "_export-conda-explicit-spec", args = ["{{ env }}", "{{ platform }}", "{{ outdir }}"] }, +] +cmd = "mv '{{ outdir }}/{{ env }}_{{ platform }}_conda_spec.txt' '{{ outdir }}/{{ env }}.{{ platform }}.pin.txt'" + +[tasks._export-conda-explicit-spec] +description = "Export one Pixi environment/platform as an explicit conda spec file" +args = ["env", "platform", "outdir"] +cmd = "pixi workspace export conda-explicit-spec --environment '{{ env }}' --platform '{{ platform }}' '{{ outdir }}'" {% endraw %} diff --git a/tests/template_test.py b/tests/template_test.py index c499056..67b502b 100644 --- a/tests/template_test.py +++ b/tests/template_test.py @@ -45,12 +45,21 @@ def pixi_built(self, template_project): ) return template_project - def test_pytest(self, pixi_built): + def test_task_test_integration(self, pixi_built): """The template's tests should pass by default.""" assert subprocess.run( "pixi run test-integration", shell=True, check=True, cwd=pixi_built ) + def test_task_export_snakemake_env(self, pixi_built): + """The template's export task should work as expected.""" + assert subprocess.run( + "pixi run export-snakemake-env module", + shell=True, + check=True, + cwd=pixi_built, + ) + def test_linting(self, pixi_built): """The generated project should result in perfect snakemake linting.""" assert subprocess.run(