-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
31 lines (22 loc) · 1.08 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
### HOUSEKEEPING TARGETS ###
.PHONY: help clean
help: ## Show the help message
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-9s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
clean: ## Clean up
@rm -rf .venv build dist pis.egg-info coverage.xml .coverage .pytest_cache .ruff_cache .git/hooks/pre-commit
### DEVELOPMENT TARGETS ###
.git/hooks/pre-commit:
@ln -s $(shell pwd)/pre-commit.githook .git/hooks/pre-commit
@chmod +x .git/hooks/pre-commit
@echo pre-commit hook installed
.venv/bin/pytest: # If we have pytest, it means we have installed dev dependencies
@uv sync --all-extras --dev --quiet
@echo dev dependencies installed
dev: .venv/bin/pytest .git/hooks/pre-commit ## Install development dependencies and pre-commit hook
test: .venv/bin/pytest ## Run the tests
@uv run pytest
coverage: .venv/bin/pytest ## Generate and show coverage reports
@uv run coverage run -m pytest -qq; uv run coverage xml; uv run coverage report -m
### MAIN TARGETS ###
run: ## Runs the step specified by `step` argument
@[ -n "$(step)" ] && uv run pis -s $(step) || uv run pis -h