-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
72 lines (56 loc) · 1.92 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
.DEFAULT_GOAL := help
SHELL := /bin/bash #bash | sh
DATE = $(shell date +%Y-%m-%dT%H:%M:%S)
PIP_ACCEL_CACHE ?= ${CURDIR}/cache/pip-accel
APP_VERSION_FILE = app/version.py
GIT_BRANCH ?= $(shell git symbolic-ref --short HEAD 2> /dev/null || echo "detached")
GIT_COMMIT ?= $(shell git rev-parse HEAD 2> /dev/null || echo "")
.PHONY: help
help:
@cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z_-]+:.*?## .*$$' | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: generate-version-file
generate-version-file: ## Generates the app version file
printf "__commit_sha__ = \"${GIT_COMMIT}\"\n__time__ = \"${DATE}\"\n" > ${APP_VERSION_FILE}
.PHONY: test
test:
./scripts/run_tests.sh
.PHONY: babel-test
test-translations: babel
poetry run pybabel extract -F babel.cfg -k _l -o /tmp/messages.po . && poetry run po2csv /tmp/messages.po /tmp/messages.csv
rm /tmp/messages.po
python scripts/test-translations.py /tmp/messages.csv
rm /tmp/messages.csv
.PHONY: babel
babel:
python scripts/generate_en_translations.py
poetry run csv2po app/translations/csv/en.csv app/translations/en/LC_MESSAGES/messages.po
poetry run csv2po app/translations/csv/fr.csv app/translations/fr/LC_MESSAGES/messages.po
poetry run pybabel compile -d app/translations
.PHONY: search-csv
search-csv:
python scripts/search_csv.py
.PHONY: freeze-requirements
freeze-requirements:
poetry lock --no-update
.PHONY: test-requirements
test-requirements:
poetry check --lock
.PHONY: coverage
coverage: venv ## Create coverage report
. venv/bin/activate && coveralls
.PHONY: run-dev
run-dev:
poetry run flask run -p 6012 --host=localhost
.PHONY: run-gunicorn
run-gunicorn:
PORT=6012 poetry run gunicorn -c gunicorn_config.py application
.PHONY: format
format:
ruff check --fix .
ruff check
ruff format .
mypy ./
npx prettier --write app/assets/javascripts app/assets/stylesheets tests_cypress/cypress/e2e
.PHONY: tailwind
tailwind:
npm run tailwind