forked from roma-glushko/hyx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
66 lines (50 loc) · 1.66 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
SOURCE?=hyx docs/snippets
TESTS?=tests
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
install: ## Install project dependencies
@poetry install
clean: ## Clean temporary files
@echo "🧹 Cleaning temporary files.."
@rm -rf dist
@rm -rf .mypy_cache .pytest_cache .ruff_cache
@rm -rf .coverage htmlcov coverage.xml
@rm -rf .mutmut-cache
@rm -rf site
lint-check: ## Lint source code without modifying it
@echo "🧹 Ruff"
@poetry run ruff $(SOURCE) $(TESTS)
@echo "🧹 Black"
@poetry run black --check $(SOURCE) $(TESTS)
@echo "🧽 MyPy"
@poetry run mypy --pretty $(SOURCE) $(TESTS)
lint: ## Lint source code
@echo "🧹 Ruff"
@poetry run ruff --fix $(SOURCE) $(TESTS)
@echo "🧹 Black"
@poetry run black $(SOURCE) $(TESTS)
@echo "🧹 Ruff"
@ruff --fix $(SOURCE) $(TESTS)
@echo "🧽 MyPy"
@poetry run mypy --pretty $(SOURCE) $(TESTS)
package-build: ## Build the project package
@poetry build
docs-serve: ## Start docs with autoreload
@poetry run mkdocs serve
docs-build: ## Build docs
@poetry run mkdocs build
build: package-build docs-build
test: ## Run tests
@poetry run coverage run -m pytest $(TESTS) $(SOURCE)
test-meta: ## Test robustness of the test suit
@mutmut run
test-meta-results: ## Show weak test cases
@mutmut results
test-cov-xml: ## Run tests
@poetry run coverage run -m pytest $(TESTS) --cov $(SOURCE) --cov-report=xml
test-cov-html: ## Generate test coverage
@poetry run coverage report --show-missing
@poetry run coverage html
test-cov-open: test-cov-html ## Open test coverage in browser
@open htmlcov/index.html