-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
70 lines (60 loc) · 1.71 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# default target
all: help setup fix lint build test
help:
# Provided as a convience to run commands with uv
# setup - installs the necessary development dependencies.
# fix - fixes code formatting
# lint - lints the code
# build - build the dist
# test - tests the code
setup: src/*
# make setup
uv sync --dev
fix:
# make fix
uv sync
uv run ruff format .
uv run ruff check . --fix
uv run cucu lint --fix features
lint:
# make lint
# lint code
uv run ruff check .
# pre-commit
SKIP=makefile uv run pre-commit run --show-diff-on-failure --from-ref origin/HEAD --to-ref HEAD
# lint .feature files
uv run cucu lint features
ci-lint:
# make ci-lint
# only for use by CI through pre-commit
# lint code
uv run ruff check .
# don't run pre-commit since CI already did
# lint .feature files
uv run cucu lint features
build:
# make build
rm -f dist/*.tar.gz
rm -f dist/*.whl
uv build
test:
# make test
uv run pytest tests
# ℹ️ takes a while to run all cucu features
uv run cucu run features --workers=4 --generate-report
# open HTML report at report/index.html
coverage: src/* tests/*
# make coverage
rm -fr .coverage .coverage.*
# this makes it so all of the underlying `cucu` command calls are run
# with the coverage enabled even when spawned as a separate process for the
# underlying `uv run coverage run` process...
COVERAGE_PROCESS_START=.coveragerc uv run cucu run features --workers 6
uv run coverage run -m pytest
uv run coverage combine .coverage.*
uv run coverage html
uv run coverage xml
uv run coverage report
echo "open HTML coverage report at htmlcov/index.html"
# disable caching for all make targets
.PHONY: all help fix lint ci-lint test build coverage