forked from pulp/pulp-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (38 loc) · 1.33 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
LANGUAGES=de
PLUGINS=$(notdir $(wildcard pulpcore/cli/*))
info:
@echo Pulp CLI
@echo plugins: $(PLUGINS)
black:
isort .
black .
lint:
find . -name '*.sh' -print0 | xargs -0 shellcheck -x
black --diff --check .
isort -c --diff .
flake8
.ci/scripts/check_click_for_mypy.py
mypy
@echo "🙊 Code 🙈 LGTM 🙉 !"
tests/cli.toml:
cp [email protected] $@
@echo "In order to configure the tests to talk to your test server, you might need to edit $@ ."
test: | tests/cli.toml
pytest -v tests
servedocs:
mkdocs serve
site:
mkdocs build
pulpcore/cli/%/locale/messages.pot: pulpcore/cli/%/*.py
xgettext -d $* -o $@ pulpcore/cli/$*/*.py
sed -i 's/charset=CHARSET/charset=UTF-8/g' $@
extract_messages: $(foreach PLUGIN,$(PLUGINS),pulpcore/cli/$(PLUGIN)/locale/messages.pot)
$(foreach LANGUAGE,$(LANGUAGES),pulpcore/cli/%/locale/$(LANGUAGE)/LC_MESSAGES/messages.po): pulpcore/cli/%/locale/messages.pot
[ -e $(@D) ] || mkdir -p $(@D)
[ ! -e $@ ] || msgmerge --update $@ $<
[ -e $@ ] || cp $< $@
%.mo: %.po
msgfmt -o $@ $<
compile_messages: $(foreach LANGUAGE,$(LANGUAGES),$(foreach PLUGIN,$(PLUGINS),pulpcore/cli/$(PLUGIN)/locale/$(LANGUAGE)/LC_MESSAGES/messages.mo))
.PHONY: info black lint test servedocs
.PRECIOUS: $(foreach LANGUAGE,$(LANGUAGES),$(foreach PLUGIN,$(PLUGINS),pulpcore/cli/$(PLUGIN)/locale/$(LANGUAGE)/LC_MESSAGES/messages.po))