-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (36 loc) · 1.09 KB
/
Makefile
File metadata and controls
50 lines (36 loc) · 1.09 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
50
SHELL=/bin/bash
export PYTHONPATH:=${PYTHONPATH}:${PWD}/src
COVERAGE_THRESHOLD ?= 90
REPORT_OUTPUT_DIRECTORY = "reports"
COVERAGE_HTML_DIR = ./${REPORT_OUTPUT_DIRECTORY}/html_coverage
TESTS_HTML_DIR = ./${REPORT_OUTPUT_DIRECTORY}/html_unit_tests
.PHONY: uv
uv: ## Install uv if it's not present.
@command -v uv >/dev/null 2>&1 || curl -LsSf https://astral.sh/uv/install.sh | sh
.PHONY: install
install:
@uv sync --frozen
.PHONY: install-dev
install-dev:
@uv sync --dev
.PHONY: format
format:
@uv run ruff format src/ tests/
.PHONY: lint
lint:
@uv run ruff check src/ tests/
.PHONY: pre-commit
pre-commit:
@uv run pre-commit run --all-files
.PHONY: sort-imports
sort-imports:
@uv run ruff check --fix --select I src/ tests/
.PHONY: coverage
coverage:
@uv run python -m coverage run -m pytest tests --html=${TESTS_HTML_DIR}/html_report.html --self-contained-html
.PHONY: coverage-report-html
coverage-report-html:
@uv run python -m coverage html -d ${COVERAGE_HTML_DIR}
.PHONY: reports
reports: coverage coverage-report-html
@uv run python -m coverage report --fail-under=${COVERAGE_THRESHOLD}