-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
106 lines (84 loc) · 2.43 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
.PHONY: build
build:
cargo build
.PHONY: pydep
pydep:
pip install -r pymoose/requirements/base.txt -r pymoose/requirements/dev.txt
.PHONY: pydep-upgrade
pydep-upgrade:
pip install -U pip-tools
CUSTOM_COMPILE_COMMAND="make pydep-upgrade" pip-compile --output-file=pymoose/requirements/base.txt pymoose/requirements/base.in
CUSTOM_COMPILE_COMMAND="make pydep-upgrade" pip-compile --output-file=pymoose/requirements/dev.txt pymoose/requirements/dev.in
pip install -r pymoose/requirements/base.txt -r pymoose/requirements/dev.txt
.PHONY: pylib
pylib:
cd pymoose && maturin develop
.PHONY: install
install: pydep pylib
.PHONY: fmt
fmt:
cargo fmt
cd pymoose && isort .
cd pymoose && black .
cd benchmarks/pymoose && isort .
cd benchmarks/pymoose && black .
.PHONY: lint
lint:
cargo fmt --all -- --check
cargo clippy --all-targets -- -D warnings --no-deps
cd pymoose && flake8 .
.PHONY: test
test:
cargo test
pytest -m "not slow" ./pymoose
.PHONY: test-long
test-long: test
pytest -m "slow" ./pymoose
.PHONY: audit
audit:
cargo audit
.PHONY: deny
deny:
cargo deny check
.PHONY: test-ci
test-ci: test
.PHONY: clean
clean:
cargo clean
find ./ -depth -type d -name '__pycache__' -prune -print -exec rm -rf {} +
rm -rf ./pymoose/.pytest_cache
.PHONY: ci-ready
ci-ready: fmt lint test-ci
.PHONY: ci-clean-check
ci-clean-check: clean ci-ready
.PHONY: release
release: ci-ready
cargo release --workspace --no-publish --execute
# PyMoose Docs
.PHONY: install-docs
install-docs:
pip install -r pymoose/docs/requirements.txt
# extra deps for onnx inference notebook
pip install onnxmltools==1.11.0 scikit-learn==1.0.2 skl2onnx==1.11.2
.PHONY: docs-clean
docs-clean:
find pymoose/docs/source -name "*.moose" -exec rm {} \+
find pymoose/docs/source -name "*.ipynb" -exec rm {} \+
find pymoose/docs/source -name "*.md" -exec rm {} \+
find pymoose/docs/source/_static -name "*.png" -exec rm {} \+
cd pymoose/docs && \
make clean && \
cd ../../
.PHONY: docs-prep
docs-prep:
cp README.md pymoose/docs/source/moose-readme.md && \
cp tutorials/README.md pymoose/docs/source/tutorial-readme.md && \
cp tutorials/scientific-computing-multiple-players.ipynb pymoose/docs/source/ && \
cp tutorials/ml-inference-with-onnx.ipynb pymoose/docs/source/ && \
cp tutorials/interfacing-moose-with-pymoose.ipynb pymoose/docs/source/ && \
cp -r tutorials/_static/ pymoose/docs/source/
.PHONY: docs
docs: docs-prep
cd pymoose/docs && \
make html && \
cd ../../