-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (39 loc) · 1.56 KB
/
Makefile
File metadata and controls
50 lines (39 loc) · 1.56 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
.PHONY: clean help test lint isort docs dist upload update-translations compile-translations add-translation
help:
@echo " clean remove unwanted stuff"
@echo " test run the testsuite"
@echo " docs build the documentation"
@echo " lint check the source for style errors"
@echo " isort sort the python imports"
@echo " dist creates distribution packages"
@echo " upload uploads a new version of the wheel package to PyPI"
@echo " update-translations updates the translations"
@echo " compile-translations compiles the translations"
@echo " add-translation adds a new language to the translations"
clean:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -rf {} +
test:
py.test
docs:
$(MAKE) -C docs html
format: ## Sorts the imports and reformats the code
# sort imports / remove unused
ruff check --fix --select I
ruff check --fix
# reformat
ruff format
dist:
uv build
upload:
twine upload dist/{*.tar.gz,*.whl} --skip-existing
update-translations:
pybabel extract -F babel.cfg -k lazy_gettext -o portal/translations/messages.pot .
pybabel update -i portal/translations/messages.pot -d portal/translations/
add-translation:
@read -p "Enter new language shortcode:" lang; \
pybabel init -i portal/translations/messages.pot -d portal/translations/ -l $$lang
compile-translations:
pybabel compile -d portal/translations/