-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Snakefile
86 lines (68 loc) · 1.73 KB
/
Snakefile
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
from glob import iglob
from snek5000.util.archive import tar_name, archive
rule env_export:
shell:
"""
conda env export -f environment.yml
sed -i '/^prefix/d' environment.yml
sed -i '/snek5000/d' environment.yml
"""
rule env_update:
shell:
"conda env update --file environment.yml"
rule develop:
shell:
"pip install -e .[dev]"
rule docs:
input:
"src/",
shell:
'cd docs && SPHINXOPTS="-W" make html'
rule docs_clean:
shell:
'cd docs && SPHINXOPTS="-W" make cleanall'
rule ctags:
input:
nek5000="lib/Nek5000/core",
abl="src/abl",
snek5000="src/snek5000",
output:
".tags",
params:
excludes=" ".join(
(
f"--exclude={pattern}"
for pattern in (
".snakemake",
"__pycache__",
"obj",
"logs",
"*.tar.gz",
"*.f?????",
)
)
),
shell:
"""
ctags -f {output} --language-force=Fortran -R {input.nek5000}
ctags -f {output} {params.excludes} --append --language-force=Fortran -R {input.abl}
ctags -f {output} {params.excludes} --append -R {input.snek5000}
"""
rule watch:
params:
per_second=5,
rules="docs ctags",
shell:
"nohup watch -n {params.per_second} snakemake {params.rules} 2>&1 > /tmp/watch.log&"
rule release:
shell:
"""
rm -rf build dist
python setup.py sdist
twine check dist/*
"""
rule testpypi:
shell:
"""
twine upload --repository testpypi dist/*
"""