generated from telekom/reuse-template
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (41 loc) · 1.45 KB
/
Makefile
File metadata and controls
49 lines (41 loc) · 1.45 KB
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
39
40
41
42
43
44
45
46
47
48
49
# SPDX-FileCopyrightText: 2024 Deutsche Telekom AG
#
# SPDX-License-Identifier: CC0-1.0
# Requires uv (https://docs.astral.sh/uv/). First-time: run 'make lock' then 'make install'.
.PHONY: install test clean build lock lint documentation reuse-lint
SRC_DIR = ./wurzel
TEST_DIR = ./tests
VENV = .venv
SHELL := bash
$(VENV)/.venv_created:
@uv venv $(VENV)
@touch $(VENV)/.venv_created
install: $(VENV)/.venv_created
uv sync --all-extras
uv run pre-commit install
build: install
uv build
test: install
@echo "🧪 Running tests..."
@UNAME_S=$$(uname); \
if [ "$$UNAME_S" = "Darwin" ] && [ -n "$$GITHUB_ACTIONS" ]; then \
echo "Running tests on MacOS in GitHub pipeline"; \
echo "Skipping coverage check"; \
uv run pytest $(TEST_DIR) --cov-branch --cov-report term --cov-report html:reports --cov=$(SRC_DIR); \
elif [ "$$UNAME_S" = "Darwin" ]; then \
uv run pytest $(TEST_DIR) --cov-branch --cov-report term --cov-report html:reports --cov-fail-under=90 --cov=$(SRC_DIR); \
else \
uv run pytest $(TEST_DIR) --cov-branch --cov-report term --cov-report html:reports --cov-fail-under=90 --cov=$(SRC_DIR); \
fi
lint: install
@echo "🔍 Running lint checks..."
uv run pre-commit run --all-files
clean:
@echo "🧹 Cleaning up..."
@rm -rf __pycache__ ${SRC_DIR}/*.egg-info **/__pycache__ .pytest_cache
@rm -rf .coverage reports dist $(VENV)
documentation: install
@echo "📚 Serving documentation..."
uv run mkdocs serve
reuse-lint:
uv run reuse lint