stacosys/Makefile

47 lines
1.1 KiB
Makefile
Raw Normal View History

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
2022-11-20 16:38:58 +01:00
.PHONY: all build run test
# code quality
all: black typehint lint
2022-11-19 20:40:15 +01:00
black:
uv run isort --multi-line 3 --profile black src/ tests/
uv run black --target-version py311 src/ tests/
2022-11-19 20:40:15 +01:00
typehint:
uv run mypy --ignore-missing-imports src/ tests/
2022-11-19 20:40:15 +01:00
lint:
uv run pylint src/
2023-11-19 15:35:56 +01:00
# check
check: all
# test
test:
2025-04-05 17:53:10 +02:00
PYTHONPATH=src/ uv run coverage run -m --source=stacosys pytest --junitxml=junit.xml tests
uv run genbadge tests -i junit.xml
uv run coverage xml
uv run genbadge coverage -i coverage.xml
# build
build:
2024-12-09 17:18:23 +01:00
# https://stackoverflow.com/questions/24347450/how-do-you-add-additional-files-to-a-wheel
rm -rf build/* dist/* *.egg-info
2025-03-28 20:34:45 +01:00
uv sync
uv build --wheel --out-dir dist
2025-03-28 20:34:45 +01:00
docker build -t source.madyanne.fr/yax/stacosys .
publish:
2025-03-28 20:34:45 +01:00
docker push source.madyanne.fr/yax/stacosys
2022-11-19 20:40:15 +01:00
# run
run:
2025-03-28 20:34:45 +01:00
PYTHONPATH=src/ uv run python src/stacosys/run.py $(RUN_ARGS)