forked from fvaleye/tracarbon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·44 lines (36 loc) · 1.23 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
.DEFAULT_GOAL := help
.PHONY: setup
setup: ## Setup the requirements
$(info --- 🖥 Setup dependencies ---)
poetry update
.PHONY: format
format: ## Format the code
$(info --- 🐍 Check Python format ---)
poetry run black .
poetry run isort .
.PHONY: check
check: ## Run check
$(info --- 🐍 Check Python ---)
poetry run isort --diff --check-only .
poetry run black --check .
poetry run mypy
.PHONY: unit-test
unit-test: ## Run unit test
$(info --- 🐍 Run Python unit-test ---)
poetry run python -m pytest
.PHONY: check-data
check-data: ## Check data of Tracarbon
$(info --- 📍 Checking data ---)
poetry run python scripts/check_data.py
@echo "👍"
.PHONY: build-documentation
build-documentation: ## Build documentation with Sphinx
$(info --- 📚 Run build of the Sphinx documentation ---)
poetry run sphinx-build -Wn -b html -d ./docs/build/doctrees ./docs/source ./docs/build/html
.PHONY: publish
publish: ## Publish to Pypi
$(info --- 📄 Run Publish to Pypi ---)
poetry publish --build --username "${PYPI_USERNAME}" --password "${PYPI_PASSWORD}"
.PHONY: help
help: ## List the rules
grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'