-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
42 lines (33 loc) · 982 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
ifeq (run,$(firstword $(MAKECMDGOALS)))
# use the rest as arguments for "run"
RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
# ...and turn them into do-nothing targets
$(eval $(RUN_ARGS):;@:)
endif
.PHONY: all build run test
# code quality
all: black typehint lint
black:
uv run isort --multi-line 3 --profile black src/ tests/
uv run black --target-version py311 src/ tests/
typehint:
uv run mypy --ignore-missing-imports src/ tests/
lint:
uv run pylint src/
# check
check: all
# test
test:
PYTHONPATH=src/ uv run coverage run -m --source=stacosys pytest tests
uv run coverage report
# build
build:
# https://stackoverflow.com/questions/24347450/how-do-you-add-additional-files-to-a-wheel
rm -rf build/* dist/* *.egg-info
uv build --wheel --out-dir dist
docker build -t kianby/stacosys .
#docker login -u kianby
#docker push docker.io/kianby/stacosys:latest
# run
run:
PYTHONPATH=src/ uv run python src/stacosys/run.py $(RUN_ARGS)