forked from pulp/pulp-cli-deb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
64 lines (50 loc) · 2.45 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
LANGUAGES=de
GLUE_PLUGINS=$(notdir $(wildcard pulp-glue-deb/pulp_glue/*))
CLI_PLUGINS=$(notdir $(wildcard pulpcore/cli/*))
info:
@echo Pulp glue
@echo plugins: $(GLUE_PLUGINS)
@echo Pulp CLI
@echo plugins: $(CLI_PLUGINS)
build:
cd pulp-glue-deb; pyproject-build -n
pyproject-build -n
black:
isort .
cd pulp-glue-deb; isort .
black .
lint:
find tests .ci -name '*.sh' -print0 | xargs -0 shellcheck -x
isort -c --diff .
cd pulp-glue-deb; isort -c --diff .
black --diff --check .
flake8
.ci/scripts/check_click_for_mypy.py
MYPYPATH=pulp-glue-deb mypy
cd pulp-glue-deb; 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
python3 -m pytest -v tests pulp-glue-deb/tests
pulp-glue-deb/pulp_glue/%/locale/messages.pot: pulp-glue-deb/pulp_glue/%/*.py
xgettext -d $* -o $@ pulp-glue-deb/pulp_glue/$*/*.py
sed -i 's/charset=CHARSET/charset=UTF-8/g' $@
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 GLUE_PLUGIN,$(GLUE_PLUGINS),pulp-glue-deb/pulp_glue/$(GLUE_PLUGIN)/locale/messages.pot) $(foreach CLI_PLUGIN,$(CLI_PLUGINS),pulpcore/cli/$(CLI_PLUGIN)/locale/messages.pot)
$(foreach LANGUAGE,$(LANGUAGES),pulp-glue-deb/pulp_glue/%/locale/$(LANGUAGE)/LC_MESSAGES/messages.po): pulp-glue-deb/pulp_glue/%/locale/messages.pot
[ -e $(@D) ] || mkdir -p $(@D)
[ ! -e $@ ] || msgmerge --update $@ $<
[ -e $@ ] || cp $< $@
$(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 GLUE_PLUGIN,$(GLUE_PLUGINS),pulp-glue-deb/pulp_glue/$(GLUE_PLUGIN)/locale/$(LANGUAGE)/LC_MESSAGES/messages.mo)) $(foreach LANGUAGE,$(LANGUAGES),$(foreach CLI_PLUGIN,$(CLI_PLUGINS),pulpcore/cli/$(CLI_PLUGIN)/locale/$(LANGUAGE)/LC_MESSAGES/messages.mo))
.PHONY: build info black lint test
.PRECIOUS: $(foreach LANGUAGE,$(LANGUAGES),$(foreach GLUE_PLUGIN,$(GLUE_PLUGINS),pulp-glue-deb/pulp_glue/$(GLUE_PLUGIN)/locale/$(LANGUAGE)/LC_MESSAGES/messages.po)) $(foreach LANGUAGE,$(LANGUAGES),$(foreach CLI_PLUGIN,$(CLI_PLUGINS),pulpcore/cli/$(CLI_PLUGIN)/locale/$(LANGUAGE)/LC_MESSAGES/messages.po))