-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (51 loc) · 1.53 KB
/
Makefile
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
VENV_NAME?=.venv
USER_PYTHON ?= python3
VENV_PYTHON=${VENV_NAME}/bin/python
.PHONY = prepare-venv install install-dev install-tests test lint format clean
.DEFAULT_GOAL = install-dev
prepare-venv: $(VENV_NAME)/bin/python
$(VENV_NAME)/bin/python:
make clean && ${USER_PYTHON} -m venv $(VENV_NAME)
install: prepare-venv
${VENV_PYTHON} -m pip install -U pip
${VENV_PYTHON} -m pip install -e .
install-dev: prepare-venv
${VENV_PYTHON} -m pip install -U pip
${VENV_PYTHON} -m pip install -e .\[dev\]
install-tests: prepare-venv
${VENV_PYTHON} -m pip install -U pip
${VENV_PYTHON} -m pip install -e .\[tests\]
install-docs: prepare-venv
${VENV_PYTHON} -m pip install -U pip
${VENV_PYTHON} -m pip install -e .\[docs\]
build-dev: install-dev
${VENV_PYTHON} -m maturin develop
test: install-tests
${VENV_PYTHON} -m pytest -W error
cargo test
docs: install-docs
$(MAKE) -C docs html
docs-serve: install-docs
$(MAKE) -C docs serve VENV_PYTHON=$(CURDIR)/$(VENV_PYTHON)
docs-clean:
$(MAKE) -C docs clean
lint: install-dev
${VENV_PYTHON} -m ruff check
${VENV_PYTHON} -m ruff check --select I
${VENV_PYTHON} -m pyright
cargo clippy --all-targets --all-features
format: install-dev
${VENV_PYTHON} -m ruff check --select I --fix
${VENV_PYTHON} -m ruff format
cargo fmt
cargo clippy --all-features --fix --allow-staged
clean: docs-clean
rm -rf $(VENV_NAME)
rm -rf .pytest_cache
rm -rf .ruff_cache
rm -rf medmodels.egg-info
rm -rf target
rm -rf dist
rm -f medmodels/*.so
rm -f .vscode/*.log
find . -name __pycache__ -type d -exec rm -r {} +