forked from nautechsystems/nautilus_trader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
84 lines (60 loc) · 2.08 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
PROJECT?=nautechsystems/nautilus_trader
REGISTRY?=ghcr.io/
IMAGE?=${REGISTRY}${PROJECT}
GIT_TAG:=$(shell git rev-parse --abbrev-ref HEAD)
IMAGE_FULL?=${IMAGE}:${GIT_TAG}
.PHONY: install build clean docs format pre-commit
.PHONY: clippy cargo-build cargo-update cargo-test
.PHONY: update docker-build docker-build-force docker-push
.PHONY: docker-build-jupyter docker-push-jupyter
.PHONY: pytest pytest-coverage
install:
BUILD_MODE=release poetry install --with dev,test --all-extras
install-debug:
BUILD_MODE=debug poetry install --with dev,test --all-extras
install-just-deps:
poetry install --with dev,test --all-extras --no-root
install-just-deps-all:
poetry install --with dev,test,docs --all-extras --no-root
build: nautilus_trader
BUILD_MODE=release poetry run python build.py
build-debug: nautilus_trader
BUILD_MODE=debug poetry run python build.py
clean:
git clean -fxd
docs:
poetry run sphinx-build docs docs/build/html -b html
format:
(cd nautilus_core && cargo fmt)
pre-commit: format
pre-commit run --all-files
ruff:
ruff check . --fix
update:
(cd nautilus_core && cargo update)
poetry update
clippy:
(cd nautilus_core && cargo clippy --all-targets --all-features -- -D warnings -W clippy::pedantic -W clippy::nursery -W clippy::unwrap_used -W clippy::expect_used)
cargo-build:
(cd nautilus_core && cargo build --release --all-features)
cargo-update:
(cd nautilus_core && cargo update)
cargo-test:
(cd nautilus_core && cargo test)
docker-build: clean
docker pull ${IMAGE_FULL} || docker pull ${IMAGE}:develop || true
docker build -f .docker/nautilus_trader.dockerfile --platform linux/x86_64 -t ${IMAGE_FULL} .
docker-build-force:
docker build --no-cache -f .docker/nautilus_trader.dockerfile -t ${IMAGE_FULL} .
docker-push:
docker push ${IMAGE_FULL}
docker-build-jupyter:
docker build --build-arg GIT_TAG=${GIT_TAG} -f .docker/jupyterlab.dockerfile --platform linux/x86_64 -t ${IMAGE}:jupyter .
docker-push-jupyter:
docker push ${IMAGE}:jupyter
pytest:
bash scripts/test.sh
pytest-coverage:
bash scripts/test-coverage.sh
test-examples:
bash scripts/test-examples.sh