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
16 changes: 10 additions & 6 deletions template/pixi.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
11 changes: 10 additions & 1 deletion tests/template_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Loading