forked from lenskit/lkpy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
81 lines (66 loc) · 2.13 KB
/
Copy pathjustfile
File metadata and controls
81 lines (66 loc) · 2.13 KB
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
CACHEDIR_TAG := "Signature: 8a477f597d28d172789f06886806bc55"
BIBTEX_URL := "http://127.0.0.1:23119/better-bibtex/export/collection?/4/9JMHQD9K.bibtex"
export PYTHONPATH := justfile_directory() / "src"
# list available recipes
default:
@just -l
# intiialize output directories
init-dirs:
#!/bin/bash
set -euo pipefail
for dir in build output; do
mkdir -p $dir
if [ ! -f $dir/CACHEDIR.TAG ]; then
echo "{{CACHEDIR_TAG}}" >$dir/CACHEDIR.TAG
fi
done
# clean the output directories
clean:
# check that git is clean — we can't clean with uncommitted changes
test -z "$(git status -u --porcelain)"
# start removing files
rm -rf build dist output target
rm -rf *.lprof *.profraw *.prof *.log
git clean -xf docs src
# print the LensKit version
version:
python utils/version-tool.py
# write the version to CI outputs
ci-version:
python utils/version-tool.py --github
# build the source distribution
build-sdist: init-dirs
python utils/version-tool.py --run uv build --sdist
# build packages for the current platform
build-dist: init-dirs
python utils/version-tool.py --run uv build
# build the accelerator in-place
build-accel profile="dev": init-dirs
maturin develop --profile="{{profile}}"
# build Conda packages
build-conda: build-sdist
#!/bin/bash
set -euo pipefail
export LK_PACKAGE_VERSION="$(python utils/version-tool.py -q)"
# python path will confuse conda-build, yeet
export PYTHONPATH=
flags=
if [ ! -z "$CI" ]; then
flags="--noarch-build-platform linux-64"
fi
rattler-build build --recipe conda --output-dir dist/conda $flags
# run the tests
test slow="yes" +args='tests': build-accel
pytest {{ if slow == "yes" {""} else {"-m 'not slow'"} }} {{args}}
# build the documentation
docs: init-dirs
sphinx-build docs build/doc
# auto-build and preview documentation
preview-docs: init-dirs
sphinx-autobuild --watch src docs build/doc
# update the BibTeX file
update-bibtex:
curl -fo docs/lenskit.bib "{{BIBTEX_URL}}"
# update the source file headers
update-headers:
python utils/update-headers.py