2021-09-10 13:46:47 +02:00
|
|
|
all: lint
|
|
|
|
|
|
|
|
include ../tools/python.mk
|
|
|
|
|
2022-07-27 12:44:18 +02:00
|
|
|
PIP_INSTALL := \
|
|
|
|
--editable ../shared \
|
2023-02-26 23:24:29 +01:00
|
|
|
--editable .[dev,sentry]
|
2022-06-28 21:01:57 +02:00
|
|
|
PYLINT_ARG := libretime_api
|
|
|
|
MYPY_ARG := libretime_api
|
2022-07-25 21:20:45 +02:00
|
|
|
BANDIT_ARG := --exclude '*/tests/*' libretime_api || true
|
2021-09-10 13:46:47 +02:00
|
|
|
|
2022-12-07 11:29:21 +01:00
|
|
|
export DJANGO_SETTINGS_MODULE=libretime_api.settings.testing
|
|
|
|
|
2021-09-13 14:43:18 +02:00
|
|
|
format: .format
|
2022-02-14 17:53:18 +01:00
|
|
|
lint: .format-check .pylint .mypy .bandit
|
2022-12-07 11:42:16 +01:00
|
|
|
test: .pytest
|
|
|
|
test-coverage: .coverage
|
2021-09-10 13:46:47 +02:00
|
|
|
clean: .clean
|
2021-10-18 14:17:34 +02:00
|
|
|
|
2022-06-17 17:07:44 +02:00
|
|
|
SCHEMA_FILE ?= schema.yml
|
2022-04-08 15:38:58 +02:00
|
|
|
schema: $(VENV)
|
2022-12-07 11:29:21 +01:00
|
|
|
$(VENV)/bin/libretime-api spectacular --file $(SCHEMA_FILE)
|
2022-06-17 17:07:44 +02:00
|
|
|
if command -v npx > /dev/null; then npx prettier --write $(SCHEMA_FILE); fi
|
2022-06-28 11:37:31 +02:00
|
|
|
|
|
|
|
schema-foreach-commit:
|
|
|
|
git rebase main -x "$(MAKE) -C api schema"
|