forked from lenskit/lkpy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
justfile
84 lines (67 loc) · 2.33 KB
/
justfile
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
PIP := "uv pip"
PACKAGES := "lenskit lenskit-funksvd lenskit-implicit lenskit-hpf"
python := "3.11"
conda_env := "lkpy"
# list the tasks in this project (default)
list-tasks:
just --list
# clean up build artifacts
clean:
rm -rf build dist *.egg-info */dist */build
# build the modules and wheels
build:
for pkg in {{PACKAGES}}; do python -m build -n -o dist $pkg; done
build-sdist:
for pkg in {{PACKAGES}}; do python -m build -n -s -o dist $pkg; done
# install the package
[confirm("this installs package from a wheel, continue [y/N]?")]
install:
{{PIP}} install {{PACKAGES}}
# install the package (editable)
install-editable:
{{PIP}} install {{ prepend('-e ', PACKAGES) }}
# set up for development in non-conda environments
install-dev:
{{PIP}} install -r dev-requirements.txt -e {{ prepend('-e ', PACKAGES) }} --all-extras
# create a conda environment file for development
conda-dev-env-file *components=PACKAGES:
pipx run --no-cache --spec . lk-conda -o environment.yml \
-p {{python}} -e all requirements-dev.txt \
pyproject.toml {{ append('/pyproject.toml', components) }}
# create a conda environment for development
conda-dev-env *components=PACKAGES: (conda-dev-env-file components)
conda env update --prune -n lkpy -f environment.yml
pip install --no-deps -e .
for pkg in {{components}}; do \
echo "installing $pkg"; \
pip install --no-deps -e $pkg; \
done
# run tests with default configuration
test:
python -m pytest
# run fast tests
test-fast:
python -m pytest -m 'not slow'
# run tests matching a keyword query
test-matching query:
python -m pytest -k "{{query}}"
# build documentation
docs:
sphinx-build docs build/doc
# preview documentation with live rebuild
preview-docs:
sphinx-autobuild --watch lenskit docs build/doc
# update the environment file used to install documentation
update-doc-env:
python -m lkdev.conda -o docs/environment.yml \
-e all requirements-doc.txt docs/doc-dep-constraints.yml \
{{ append('/pyproject.toml', PACKAGES) }}
-pre-commit run --files docs/environment.yml
# update source file headers
update-headers:
unbehead
# update GH workflows
update-workflows:
python -m lkdev.ghactions --render test
python -m lkdev.ghactions --render docs
-pre-commit run --files .github/workflows/*.yml