tailscalesd/Makefile

41 lines
700 B
Makefile
Raw Normal View History

UV ?= uv run
2023-11-05 20:16:47 +01:00
SRC := tailscalesd
TESTS := tests
SHELL := $(shell which bash)
APP_VERSION := $(shell git rev-parse --short HEAD)
2023-11-06 09:13:21 +01:00
DOCKER ?= docker
2023-11-05 20:16:47 +01:00
docker-build:
2023-11-06 09:13:21 +01:00
DOCKER_BUILDKIT=1 $(DOCKER) build -f docker/Dockerfile \
2023-11-05 20:16:47 +01:00
--build-arg=$(APP_VERSION) \
-t tailscalesd:latest \
.
freeze:
uv export --format requirements-txt --no-hashes --no-emit-project > requirements.frozen.txt
2023-11-05 20:16:47 +01:00
fmt:
$(UV) black $(SRC)
$(UV) black $(TESTS)
$(UV) isort --profile black $(SRC)
$(UV) isort --profile black $(TESTS)
2023-11-05 20:16:47 +01:00
check:
$(MAKE) fmt
$(MAKE) lint
$(MAKE) types
$(MAKE) bandit
$(MAKE) test
2023-11-05 20:16:47 +01:00
lint:
$(UV) flake8 $(SRC)
2023-11-05 20:16:47 +01:00
bandit:
$(UV) bandit -r $(SRC)
2023-11-05 20:16:47 +01:00
types:
$(UV) mypy $(SRC)
2023-11-05 20:16:47 +01:00
test:
$(UV) pytest $(TESTS)