-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (38 loc) · 1.15 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
SRC_PATH = iterpy
MAKEFLAGS = --no-print-directory
# Dependency management
install:
rye sync
quicksync:
rye sync --no-lock
test:
@rye run pytest --cov=$(SRC_PATH) $(SRC_PATH) --cov-report xml:.coverage.xml --cov-report lcov:.coverage.lcov
test-with-coverage:
@echo "––– Testing –––"
@make test
@rye run diff-cover .coverage.xml
@echo "✅✅✅ Tests passed ✅✅✅"
lint: ## Format code
@echo "––– Linting –––"
@rye run ruff format .
@rye run ruff . --fix --unsafe-fixes \
--extend-select F401 \
--extend-select F841
@echo "✅✅✅ Lint ✅✅✅"
types: ## Type-check code
@echo "––– Type-checking –––"
@rye run pyright .
@echo "✅✅✅ Types ✅✅✅"
validate_ci: ## Run all checks
@echo "––– Running all checks –––"
@make lint
@make types
## CI doesn't support local coverage report, so skipping full test
@make test
docker_ci: ## Run all checks in docker
@echo "––– Running all checks in docker –––"
@docker rm -f iterpy || true
@docker build -t iterpy:latest -f Dockerfile .
@docker run iterpy make validate_ci
pr: ## Submit a PR
@rye run lm sync --squash --automerge