| 
1 |  | -.PHONY: init lint check_lint test uml html cleandocs doctest  | 
 | 1 | +#################################################################################  | 
 | 2 | +# GLOBALS                                                                       #  | 
 | 3 | +#################################################################################  | 
2 | 4 | 
 
  | 
3 |  | -init:  | 
 | 5 | +PACKAGE_DIR = causalpy  | 
 | 6 | + | 
 | 7 | +#################################################################################  | 
 | 8 | +# COMMANDS                                                                      #  | 
 | 9 | +#################################################################################  | 
 | 10 | + | 
 | 11 | +.PHONY: init lint check_lint test uml html cleandocs doctest help  | 
 | 12 | + | 
 | 13 | +init: ## Install the package in editable mode  | 
4 | 14 | 	python -m pip install -e . --no-deps  | 
5 | 15 | 
 
  | 
6 |  | -lint:  | 
 | 16 | +lint: ## Run ruff linter and formatter  | 
7 | 17 | 	ruff check --fix .  | 
8 | 18 | 	ruff format .  | 
9 | 19 | 
 
  | 
10 |  | -check_lint:  | 
 | 20 | +check_lint: ## Check code formatting and linting without making changes  | 
11 | 21 | 	ruff check .  | 
12 | 22 | 	ruff format --diff --check .  | 
13 | 23 | 	interrogate .  | 
14 | 24 | 
 
  | 
15 |  | -doctest:  | 
 | 25 | +doctest: ## Run doctests for the causalpy module  | 
16 | 26 | 	python -m pytest --doctest-modules --ignore=causalpy/tests/ causalpy/ --config-file=causalpy/tests/conftest.py  | 
17 | 27 | 
 
  | 
18 |  | -test:  | 
 | 28 | +test: ## Run all tests with pytest  | 
19 | 29 | 	python -m pytest  | 
20 | 30 | 
 
  | 
21 |  | -uml:  | 
 | 31 | +uml: ## Generate UML diagrams from code  | 
22 | 32 | 	pyreverse -o png causalpy --output-directory docs/source/_static --ignore tests  | 
23 | 33 | 
 
  | 
24 |  | -# Docs build commands  | 
25 |  | - | 
26 |  | -html:  | 
 | 34 | +html: ## Build HTML documentation with Sphinx  | 
27 | 35 | 	sphinx-build -b html docs/source docs/_build  | 
28 | 36 | 
 
  | 
29 |  | -cleandocs:  | 
 | 37 | +cleandocs: ## Clean the documentation build directories  | 
30 | 38 | 	rm -rf docs/_build  | 
31 | 39 | 	rm -rf docs/source/api/generated  | 
 | 40 | + | 
 | 41 | + | 
 | 42 | +#################################################################################  | 
 | 43 | +# Self Documenting Commands                                                     #  | 
 | 44 | +#################################################################################  | 
 | 45 | + | 
 | 46 | +.DEFAULT_GOAL := help  | 
 | 47 | + | 
 | 48 | +help: ## Show this help message  | 
 | 49 | +	@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \  | 
 | 50 | +	awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'  | 
0 commit comments