tuxbot-bot/Makefile

37 lines
1.2 KiB
Makefile
Raw Normal View History

2020-06-07 17:41:34 +02:00
PYTHON = python
VENV = venv
XGETTEXT_FLAGS = --no-wrap --language='python' --keyword=_ --from-code='UTF-8' --msgid-bugs-address='rick@gnous.eu' --width=79 --package-name='Tuxbot-bot'
# Init
main:
$(PYTHON) -m venv --clear $(VENV)
$(VENV)/bin/pip install -U pip setuptools
install:
$(VENV)/bin/pip install .
install-dev:
$(VENV)/bin/pip install -r dev.requirements.txt
update:
2021-01-19 11:16:50 +01:00
$(VENV)/bin/pip install --upgrade --force-reinstall .
update_soft:
$(VENV)/bin/pip install --upgrade .
2020-06-07 17:41:34 +02:00
# Blackify code
reformat:
$(PYTHON) -m black `git ls-files "*.py"` --line-length=79 && $(PYTHON) -m pylint tuxbot
# Translations
xgettext:
for cog in tuxbot/cogs/*/; do \
xgettext `find $$cog -type f -name '*.py'` --output=$$cog/locales/messages.pot $(XGETTEXT_FLAGS); \
done
msginit:
for cog in tuxbot/cogs/*/; do \
msginit --input=$$cog/locales/messages.pot --output=$$cog/locales/fr-FR.po --locale=fr_FR.UTF-8 --no-translator; \
msginit --input=$$cog/locales/messages.pot --output=$$cog/locales/en-US.po --locale=en_US.UTF-8 --no-translator; \
done
msgmerge:
for cog in tuxbot/cogs/*/; do \
msgmerge --update $$cog/locales/fr-FR.po $$cog/locales/messages.pot; \
msgmerge --update $$cog/locales/en-US.po $$cog/locales/messages.pot; \
done