2023-10-27 15:12:48 +02:00
|
|
|
VERSION=0.`git rev-list --count HEAD`
|
|
|
|
.PHONY: black
|
|
|
|
|
2024-03-02 15:33:49 +01:00
|
|
|
DOCKER_BUILD=docker build
|
|
|
|
|
|
|
|
ifeq ($(shell uname -m), arm64)
|
|
|
|
DOCKER_BUILD=docker buildx build --platform linux/amd64
|
|
|
|
endif
|
|
|
|
|
|
|
|
build:
|
|
|
|
$(DOCKER_BUILD) -t registry.domandoman.xyz/fooder/api -f Dockerfile .
|
|
|
|
|
|
|
|
push:
|
|
|
|
docker push registry.domandoman.xyz/fooder/api
|
2023-10-27 15:12:48 +02:00
|
|
|
|
|
|
|
black:
|
2024-05-20 13:32:47 +02:00
|
|
|
python -m black fooder
|
2023-10-27 15:12:48 +02:00
|
|
|
|
|
|
|
.PHONY: mypy
|
|
|
|
mypy:
|
2024-05-20 13:32:47 +02:00
|
|
|
python -m mypy fooder
|
2023-10-27 15:12:48 +02:00
|
|
|
|
|
|
|
.PHONY: flake
|
|
|
|
flake:
|
2024-05-20 13:32:47 +02:00
|
|
|
python -m flake8 fooder
|
2023-10-27 15:12:48 +02:00
|
|
|
|
|
|
|
.PHONY: lint
|
|
|
|
lint: black mypy flake
|
|
|
|
|
|
|
|
.PHONY: version
|
|
|
|
version:
|
|
|
|
@echo $(VERSION)
|
|
|
|
|
|
|
|
.PHONY: create-venv
|
|
|
|
create-venv:
|
|
|
|
python3 -m venv .venv --prompt="fooderapi-venv" --system-site-packages
|
2024-05-20 13:32:47 +02:00
|
|
|
bash -c "source .venv/bin/activate && pip install -r requirements_local.txt && (echo y | mypy --install-types)"
|
2023-10-27 15:12:48 +02:00
|
|
|
|
|
|
|
.PHONY: test
|
|
|
|
test:
|
|
|
|
./test.sh
|