File: Snakefile

package info (click to toggle)
snakemake 7.32.4-8.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 25,836 kB
  • sloc: python: 32,846; javascript: 1,287; makefile: 247; sh: 163; ansic: 57; lisp: 9
file content (33 lines) | stat: -rw-r--r-- 797 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
def conda_func(wildcards, params):
    env_name = f"{params.name_prefix}-test-env-{wildcards.version}"
    shell(
        f"mamba create -y -n {env_name} -c conda-forge --override-channels ripgrep=={wildcards.version}"
    )
    return env_name


onsuccess:
    shell("conda env remove -y -n foo-test-env-12.1.1")
    shell("conda env remove -y -n foo-test-env-13.0.0")


onerror:
    shell("conda env remove -y -n foo-test-env-12.1.1")
    shell("conda env remove -y -n foo-test-env-13.0.0")


rule all:
    input:
        "test_13.0.0_v.out",
        "test_12.1.1_v.out",


rule a:
    output:
        "test_{version}_v.out",
    params:
        name_prefix="foo",
    conda:
        conda_func
    shell:
        r"rg --version | head -n1 | grep -o 'ripgrep [0-9]*\.[0-9]*\.[0-9]*' > {output}"