-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (55 loc) · 1.4 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
DIRS_PYTHON := src
.PHONY: help
help:
@echo "Usage: make <target>"
@echo
@echo "Targets:"
@echo " help This help (default target)"
@echo " deps Install all dependencies"
@echo " format Format source code"
@echo " lint Run lint checks"
@echo " test Run tests"
.PHONY: deps
deps:
poetry install --with dev
.PHONY: format
format: \
format-ruff \
format-isort
.PHONY: format-ruff
format-ruff:
poetry run ruff format --line-length 100 $(DIRS_PYTHON)
.PHONY: format-isort
format-isort:
poetry run isort --profile=black --line-length 100 $(DIRS_PYTHON)
.PHONY: lint
lint: \
lint-ruff \
lint-isort \
lint-mypy
.PHONY: lint-ruff
lint-ruff:
poetry run ruff check --line-length 100 $(DIRS_PYTHON)
.PHONY: lint-isort
lint-isort:
poetry run isort --profile=black --line-length 100 --check-only --diff $(DIRS_PYTHON)
.PHONY: lint-mypy
lint-mypy:
poetry run mypy --check-untyped-defs $(DIRS_PYTHON)
.PHONY: test
test:
poetry run pytest tests/ -v
# .PHONY: dev
# dev:
# poetry run uvicorn src.main:app --reload --host 0.0.0.0 --port 8000
# .PHONY: jupyternotebook
# jupyternotebook:
# pipenv run \
# jupyter notebook
# .PHONY: jupyterlab
# jupyterlab:
# cp src/bench/results_analysis.ipynb tmp.ipynb && \
# PYTHON=. pipenv run \
# jupyter lab \
# --ip=0.0.0.0 --allow-root --NotebookApp.custom_display_url=http://127.0.0.1:8888 \
# tmp.ipynb