port matrix-ops-bot to uv and nix flake module

This commit is contained in:
Abel Luck 2026-03-05 15:55:47 +01:00
parent c13d5fc536
commit 3a042155af
17 changed files with 2402 additions and 3476 deletions

View file

@ -1,32 +1,22 @@
POETRY ?= poetry run
UV ?= uv
UV_RUN ?= $(UV) run
SRC := ops_bot
TESTS := tests
SHELL := $(shell which bash)
APP_VERSION := $(shell git rev-parse --short HEAD)
DOCKER ?= docker
docker-build:
DOCKER_BUILDKIT=1 $(DOCKER) build -f Dockerfile \
--build-arg=$(APP_VERSION) \
-t matrix-ops-bot:latest \
.
fmt:
$(POETRY) black $(SRC)
$(POETRY) black $(TESTS)
$(POETRY) isort --profile black $(SRC)
$(POETRY) isort --profile black $(TESTS)
$(UV_RUN) black $(SRC)
$(UV_RUN) black $(TESTS)
$(UV_RUN) isort --profile black $(SRC)
$(UV_RUN) isort --profile black $(TESTS)
lint:
$(POETRY) flake8 $(SRC)
$(POETRY) bandit --silent --recursive $(SRC)
$(UV_RUN) flake8 $(SRC)
$(UV_RUN) bandit --silent --recursive $(SRC)
types:
$(POETRY) mypy $(SRC)
$(UV_RUN) mypy $(SRC)
test:
$(POETRY) pytest $(TESTS)
freeze:
poetry export --without dev --format=requirements.txt --output requirements.frozen.txt
$(UV_RUN) pytest $(TESTS)
check:
$(MAKE) fmt