-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (41 loc) · 1.61 KB
/
Makefile
File metadata and controls
55 lines (41 loc) · 1.61 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
.PHONY: help install lint format type-check test coverage docs docs-serve dist clean check
.DEFAULT_GOAL := help
define PRINT_HELP_PYSCRIPT
import re, sys
for line in sys.stdin:
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
print("%-20s %s" % (target, help))
endef
export PRINT_HELP_PYSCRIPT
help: ## show this help message
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
install: ## install the package and all dev dependencies
poetry install
lint: ## check code style and formatting with ruff
poetry run ruff check .
poetry run ruff format --check .
format: ## auto-fix code style and formatting with ruff
poetry run ruff format .
poetry run ruff check --fix .
type-check: ## run static type checking with mypy
poetry run mypy spectrum_fundamentals tests
test: ## run the test suite with pytest
poetry run pytest
coverage: ## run tests, combine coverage data, and display report
poetry run coverage run -m pytest
poetry run coverage report -i
docs: ## build HTML documentation with sphinx
poetry run sphinx-build docs docs/_build/html
docs-serve: ## build docs and serve locally with live reload
poetry run sphinx-autobuild docs docs/_build/html --open-browser
dist: ## build source and wheel packages
poetry build
clean: ## remove build, test, and documentation artifacts
rm -rf dist/ build/ .eggs/
rm -rf .coverage .coverage.* htmlcov/ .pytest_cache/
rm -rf docs/_build/
find . -type d -name __pycache__ -exec rm -rf {} +
find . -name '*.pyc' -delete
check: lint type-check test ## run all CI checks locally (lint + type-check + test)