generated from telekom/reuse-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (33 loc) · 1.04 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
36
37
38
# SPDX-FileCopyrightText: 2024 Deutsche Telekom AG
#
# SPDX-License-Identifier: CC0-1.0
.PHONY: install test clean
SRC_DIR = ./wurzel
TEST_DIR= ./tests
VENV = .venv
UV?=$(VENV)/bin/uv
PY=$(VENV)/bin/python
PIP?=$(VENV)/bin/pip
build: install
$(PY) -m build .
$(VENV)/touchfile: pyproject.toml $(UV)
$(UV) --no-progress pip install -r pyproject.toml --all-extras
$(UV) --no-progress pip install -r DIRECT_REQUIREMENTS.txt
@touch $(VENV)/touchfile
$(PY):
python3.11 -m venv $(VENV)
$(UV): $(PY)
$(PIP) install uv
install: $(VENV)/touchfile
$(VENV)/bin/pre-commit install -f --hook-type pre-commit
test: install
$(UV) run pytest $(TEST_DIR) --cov-branch --cov-report term --cov-report html:reports --cov-fail-under=90 --cov=$(SRC_DIR)
lint: install reuse-lint
$(UV) run pylint $(SRC_DIR)
clean:
@rm -rf __pycache__ ${SRC_DIR}/*.egg-info **/__pycache__ .pytest_cache
@rm -rf .coverage reports dist
documentation:
sphinx-apidoc -o ./docs . -f && cd docs && make html && cd .. && firefox ./docs/build/html/index.html
reuse-lint:
$(UV) run reuse lint