-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
76 lines (64 loc) · 1.74 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
# Minimal Makefile for development
# variables
# you can set the first variable from the environment
PYPI_PASSWORD ?=
TESTSDIR = tests
# It is first such that "make" without argument is like "make help".
help:
@echo "[HELP] Makefile commands:"
@echo " * init: initialize venv"
@echo " * init-dev: install dev dependencies"
@echo " * init-lint: install lint dependencies"
@echo " * init-test: install tests dependencies"
@echo " * fastbuild: Fast Build and Tests"
@echo " * lint: Formatting and checking for both Rust and Python"
@echo " * lint-rust: Formatting and checking for Rust"
@echo " * lint-python: Formatting and checking for Python"
@echo " * test: run tests"
.PHONY: help Makefile
init:
@echo "[INFO] initialize venv"
@rm -rf .venv
@uv venv
@uv sync
@uv pip list
init-dev:
@echo "[INFO] Install dev dependencies"
@uv sync --all-groups
@uv pip list
init-lint:
@echo "[INFO] Install lint dependencies"
@uv sync --group lint
@uv pip list
init-test:
@echo "[INFO] Install tests dependencies"
@uv sync --group test
@uv pip list
fastbuild:
@echo "[INFO] Fast Build and Tests"
@echo "[INFO] Delete target directory"
@rm -rf target
@echo "[INFO] Run maturin develop"
@uv run maturin develop
@echo "[INFO] Uninstall rustileo from env"
@uv pip uninstall rustileo
@echo "[INFO] Clean uv cache"
@uv cache clean
@make init-dev
@echo "[INFO] Run test"
@uv run pytest .
lint:
@echo "[INFO] Formatting and checking for both Rust and Python"
@make lint-python
@make lint-rust
lint-rust:
@echo "[INFO] Formatting and checking for Rust"
@cargo fmt
@cargo clippy
lint-python:
@echo "[INFO] Formatting and checking for Python"
@uv run ruff check . --fix
@uv run ruff format .
test:
@echo "[INFO] Run tests"
@uv run pytest .