-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (32 loc) · 964 Bytes
/
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
VENV_NAME?=.venv
USER_PYTHON ?= python3
VENV_PYTHON=${VENV_NAME}/bin/python
.PHONY = build clean doc format install-python lint prepare-venv
$(VENV_NAME)/bin/python:
make clean && ${USER_PYTHON} -m venv $(VENV_NAME)
build:
cargo build
clean:
rm -rf $(VENV_NAME)
rm -rf .pytest_cache
rm -rf .ruff_cache
rm -rf pyo3_graphster.egg-info
rm -rf target
rm -rf dist
rm -rf pyo3_graphster/*.so
find . -name __pycache__ -type d -exec rm -r {} +
doc:
RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --no-deps --all-features
format: install-python
cargo fmt
${VENV_PYTHON} -m ruff check --select I --fix
${VENV_PYTHON} -m ruff format
install-python: prepare-venv
${VENV_PYTHON} -m pip install --upgrade pip
${VENV_PYTHON} -m pip install -e .\[dev\]
lint:
cargo clippy --all-targets --all-features -- -D warnings
${VENV_PYTHON} -m ruff check
${VENV_PYTHON} -m ruff check --select I
${VENV_PYTHON} -m pyright
prepare-venv: $(VENV_NAME)/bin/python