forked from ACCORD-NWP/tactus
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (43 loc) · 1.77 KB
/
Copy pathMakefile
File metadata and controls
52 lines (43 loc) · 1.77 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
.PHONY: help lint lint test doc doc-clean doc-build doc-view pre-push-checks clean
help:
@echo "Available commands:"
@echo " make lint - Run all linters and auto-fix issues"
@echo " make test - Run pytest"
@echo " make doc - Build and view documentation"
@echo " make doc-clean - Clean documentation build artifacts"
@echo " make doc-build - Build documentation"
@echo " make doc-view - View documentation in browser"
@echo " make pre-push-checks - Run all checks before pushing"
@echo " make clean - Clean build artifacts"
# Linting
lint:
@echo "Running linters..."
poetry run pre-commit run --all-files
# Testing
test:
poetry run pytest -n auto --maxprocesses 16
# Documentation
doc-clean:
rm -rf docs/_build/ docs/tactus.rst docs/markdown_docs/config.md
doc-build: doc-clean
poetry run tactus doc config >| docs/markdown_docs/config.md
poetry run python docs/write_output_overview.py docs/markdown_docs/output_overview.md
poetry run sphinx-apidoc tactus -o docs/ --force --no-toc --module-first
poetry run sphinx-build docs docs/_build/
touch docs/_build/.nojekyll
doc-view:
@if [ ! -f docs/_build/index.html ]; then \
$(MAKE) doc-build; \
fi
@poetry run python -c "import webbrowser; webbrowser.open('docs/_build/index.html')"
doc: doc-build doc-view
# Pre-push checks
pre-push-checks: lint doc-clean doc-build test
@echo "All pre-push checks passed!"
# Clean
clean:
rm -rf docs/_build/ docs/tactus.rst docs/markdown_docs/config.md docs/markdown_docs/output_overview.md
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete
rm -rf .pytest_cache .coverage .coverage.xml