-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevenv.nix
83 lines (71 loc) · 1.6 KB
/
devenv.nix
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
{
pkgs,
lib,
config,
inputs,
...
}: {
packages = [
pkgs.jujutsu
pkgs.antora
pkgs.kramdown-asciidoc
];
languages.python = {
enable = true;
uv.enable = true;
version = "3.10";
uv.sync.enable = true;
};
starship.enable = true;
tasks = {
"testing:pytest" = {
exec = "${pkgs.uv}/bin/uv run pytest";
before = ["devenv:enterTest"];
};
"testing:mypy" = {
exec = "${pkgs.uv}/bin/uv run mypy";
before = ["devenv:enterTest"];
};
"build:package" = {
exec = "${pkgs.uv}/bin/uv build";
before = ["build:all"];
};
"build:docs" = let
out_dir = "docs/modules/api/pages";
nav_file = "docs/modules/nav.adoc";
pkg_name = "pysciidoc";
in {
exec = ''
${pkgs.kramdown-asciidoc}/bin/kramdoc README.md -o docs/modules/ROOT/pages/jjreadme.adoc
${pkgs.uv}/bin/uv run pysciidoc --api-output-dir ${out_dir} --nav-file ${nav_file} ${pkg_name}
${pkgs.antora}/bin/antora docs/antora-playbook.yml
'';
before = ["build:all"];
};
"clean:dist" = {
exec = ''
if [ -d dist ]; then
rm -r dist
fi
'';
before = ["clean:all"];
};
"clean:docs" = let
out_dir = "docs/modules/api/pages";
nav_file = "docs/modules/nav.adoc";
in
{
exec = ''
if [ -d ${out_dir} ]; then
rm -r ${out_dir}
fi
if [ -e ${nav_file} ]; then
rm ${nav_file}
fi
'';
before = ["clean:all" "build:docs"];
};
"build:all" = {};
"clean:all" = {};
};
}