-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
35 lines (27 loc) · 1.07 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
.PHONY: install-poetry .clean test test-mutation docs-build docs-serve
GIT_SHA = $(shell git rev-parse --short HEAD)
PACKAGE_VERSION = $(shell poetry version -s | cut -d+ -f1)
.install-poetry:
@echo "---- 👷 Installing build dependencies ----"
deactivate > /dev/null 2>&1 || true
poetry -V || pip install -U poetry
touch .install-poetry
install-poetry: .install-poetry
.init: .install-poetry
@echo "---- 📦 Building package ----"
rm -rf .venv
poetry install -E asyncpg -E aiosqlite
git init .
touch .init
.clean:
rm -rf .init .mypy_cache .pytest_cache
poetry -V || rm -rf .install-poetry
init: .clean .init
poetry run pre-commit install --install-hooks
@echo ---- 🔧 Re-initialized project ----
lint: .init
@echo ---- ⏳ Running linters ----
@(poetry run pre-commit run --all-files && echo "---- ✅ Linting passed ----" && exit 0|| echo "---- ❌ Linting failed ----" && exit 1)
test: .init
@echo ---- ⏳ Running tests ----
@(poetry run pytest -v --cov --cov-report term && echo "---- ✅ Tests passed ----" && exit 0 || echo "---- ❌ Tests failed ----" && exit 1)