mirror of
https://framagit.org/framasoft/framaspace/argos.git
synced 2025-04-28 09:52:38 +02:00
42 lines
1.2 KiB
Makefile
42 lines
1.2 KiB
Makefile
.DEFAULT_GOAL := help
|
|
RED=\033[0;31m
|
|
GREEN=\033[0;32m
|
|
ORANGE=\033[0;33m
|
|
BLUE=\033[0;34m
|
|
NC=\033[0m # No Color
|
|
|
|
venv: ## Create the venv
|
|
python3 -m venv venv
|
|
install: venv ## Install the project locally
|
|
venv/bin/pip install -e ".[dev,docs]"
|
|
docs: cog ## Build the docs
|
|
venv/bin/sphinx-build docs public
|
|
cog: ## Run cog, to integrate the CLI options to the docs.
|
|
venv/bin/cog -r docs/*.md
|
|
tests: install ## Run the tests
|
|
venv/bin/pytest
|
|
djlint: install
|
|
venv/bin/djlint --ignore=H030,H031 --lint argos/server/templates/*html
|
|
|
|
help:
|
|
@python3 -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
|
|
|
|
# See https://daniel.feldroy.com/posts/autodocumenting-makefiles
|
|
define PRINT_HELP_PYSCRIPT # start of Python section
|
|
import re, sys
|
|
|
|
output = []
|
|
# Loop through the lines in this file
|
|
for line in sys.stdin:
|
|
# if the line has a command and a comment start with
|
|
# two pound signs, add it to the output
|
|
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
|
|
if match:
|
|
target, help = match.groups()
|
|
output.append("\033[36m%-25s\033[0m %s" % (target, help))
|
|
# Sort the output in alphanumeric order
|
|
output.sort()
|
|
# Print the help result
|
|
print('\n'.join(output))
|
|
endef
|
|
export PRINT_HELP_PYSCRIPT # End of python section
|