-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
66 lines (57 loc) · 1.42 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
PROJECT := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
SRC := $(PROJECT)src
TESTS := $(PROJECT)tests
ALL := $(SRC) $(TESTS)
export PYTHONPATH = $(PROJECT):$(PROJECT)/lib:$(SRC)
export PY_COLORS=1
# Update uv.lock with the latest deps
lock:
uv lock --upgrade --no-cache
# Generate requirements.txt from pyproject.toml
requirements:
uv export --frozen --no-hashes --format=requirements-txt -o requirements.txt
# Lint the code
lint:
uv run --frozen --isolated --extra dev \
codespell $(PROJECT) \
--skip $(PROJECT).git \
--skip $(PROJECT).venv \
--skip $(PROJECT)build \
--skip $(PROJECT)lib
uv run --frozen --isolated --extra dev \
ruff check $(ALL)
uv run --frozen --isolated --extra dev \
ruff format --check --diff $(ALL)
# Run static checks
static:
uv run --frozen --isolated --extra dev pyright
# Format the code
fmt:
uv run --frozen --isolated --extra dev \
ruff check --fix-only $(ALL)
uv run --frozen --isolated --extra dev \
ruff format $(ALL)
# Run unit tests
unit:
uv run --frozen --isolated --extra dev \
coverage run \
--source=$(SRC) \
-m pytest \
--tb native \
--verbose \
--capture=no \
$(TESTS)/unit \
$(ARGS)
uv run --frozen --isolated --extra dev \
coverage report
# Run integration tests
integration:
uv run --frozen --isolated --extra dev \
pytest \
--verbose \
--exitfirst \
--capture=no \
--tb native \
--log-cli-level=INFO \
$(TESTS)/integration \
$(ARGS)