-
Notifications
You must be signed in to change notification settings - Fork 97
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (40 loc) · 2.07 KB
/
Makefile
File metadata and controls
56 lines (40 loc) · 2.07 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
#################################################################################
# GLOBALS #
#################################################################################
PACKAGE_DIR = causalpy
#################################################################################
# COMMANDS #
#################################################################################
.PHONY: init setup lint check_lint test uml html cleandocs doctest help
init: ## Install the package in editable mode
python -m pip install -e . --no-deps
setup: ## Set up complete dev environment (run inside CausalPy env, e.g. conda run -n CausalPy make setup)
python -m pip install --no-deps -e .
python -m pip install -e '.[dev,docs,test,lint]'
prek install -f
@echo "Development environment ready!"
lint: ## Run ruff linter and formatter
ruff check --fix .
ruff format .
check_lint: ## Check code formatting and linting without making changes
ruff check .
ruff format --diff --check .
interrogate .
doctest: ## Run doctests for the causalpy module
python -m pytest --doctest-modules --ignore=causalpy/tests/ causalpy/ --config-file=causalpy/tests/conftest.py
test: ## Run all tests with pytest
python -m pytest
uml: ## Generate UML diagrams from code
pyreverse -o png causalpy --output-directory docs/source/_static --ignore tests
html: ## Build HTML documentation with Sphinx
sphinx-build -b html docs/source docs/_build
cleandocs: ## Clean the documentation build directories
rm -rf docs/_build
rm -rf docs/source/api/generated
#################################################################################
# Self Documenting Commands #
#################################################################################
.DEFAULT_GOAL := help
help: ## Show this help message
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'