-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (55 loc) · 1.45 KB
/
Makefile
File metadata and controls
69 lines (55 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
.DEFAULT_GOAL := all
sources = src/grpcvcr tests
.PHONY: install
install:
uv sync --all-extras
uv run pre-commit install
.PHONY: sync
sync:
uv sync --all-extras
.PHONY: format
format:
uv run ruff format $(sources)
uv run ruff check --fix $(sources)
.PHONY: lint
lint:
uv run ruff format --check $(sources)
uv run ruff check $(sources)
.PHONY: typecheck
typecheck:
uv run pyright
.PHONY: test
test:
uv run pytest tests/ -v --ignore=tests/test_examples.py
.PHONY: test-examples
test-examples:
uv run pytest tests/test_examples.py -v
.PHONY: test-all
test-all:
uv run pytest tests/ -v
.PHONY: testcov
testcov:
uv run pytest tests/ --ignore=tests/test_examples.py -p no:grpcvcr --cov=src/grpcvcr --cov-report=term-missing --cov-report=html
.PHONY: proto
proto:
uv run python -m grpc_tools.protoc \
-Itests/protos \
--python_out=tests/generated \
--grpc_python_out=tests/generated \
tests/protos/*.proto
touch tests/generated/__init__.py
# Fix absolute imports to relative imports for proper package resolution
sed -i '' 's/^import test_service_pb2/from tests.generated import test_service_pb2/' tests/generated/test_service_pb2_grpc.py
.PHONY: docs
docs:
uv run mkdocs build
.PHONY: docs-serve
docs-serve:
uv run mkdocs serve
.PHONY: clean
clean:
rm -rf build dist .eggs *.egg-info
rm -rf .pytest_cache .ruff_cache .mypy_cache .coverage htmlcov site
find . -type d -name __pycache__ -exec rm -rf {} +
.PHONY: all
all: format lint typecheck testcov