-
Notifications
You must be signed in to change notification settings - Fork 42
/
Makefile
81 lines (61 loc) · 2.83 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
73
74
75
76
77
78
79
80
81
LANGUAGES=de
GLUE_PLUGINS=$(notdir $(wildcard pulp-glue/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; pyproject-build -n
pyproject-build -n
black: format
format:
isort .
cd pulp-glue; isort .
black .
lint:
find tests .ci -name '*.sh' -print0 | xargs -0 shellcheck -x
isort -c --diff .
cd pulp-glue; isort -c --diff .
black --diff --check .
flake8
.ci/scripts/check_click_for_mypy.py
MYPYPATH=pulp-glue mypy
cd pulp-glue; mypy
@echo "🙊 Code 🙈 LGTM 🙉 !"
tests/cli.toml:
cp $@.example $@
@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/tests cookiecutter/pulp_filter_extension.py
livetest: | tests/cli.toml
python3 -m pytest -v tests pulp-glue/tests -m live
unittest:
python3 -m pytest -v tests pulp-glue/tests cookiecutter/pulp_filter_extension.py -m "not live"
unittest_glue:
python3 -m pytest -v pulp-glue/tests -m "not live"
docs:
pulp-docs build
servedocs:
pulp-docs serve -w CHANGES.md -w pulp-glue/pulp_glue -w pulpcore/cli/common/generic.py
pulp-glue/pulp_glue/%/locale/messages.pot: pulp-glue/pulp_glue/%/*.py
xgettext -d $* -o $@ pulp-glue/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/pulp_glue/$(GLUE_PLUGIN)/locale/messages.pot) $(foreach CLI_PLUGIN,$(CLI_PLUGINS),pulpcore/cli/$(CLI_PLUGIN)/locale/messages.pot)
$(foreach LANGUAGE,$(LANGUAGES),pulp-glue/pulp_glue/%/locale/$(LANGUAGE)/LC_MESSAGES/messages.po): pulp-glue/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/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 docs servedocs
.PRECIOUS: $(foreach LANGUAGE,$(LANGUAGES),$(foreach GLUE_PLUGIN,$(GLUE_PLUGINS),pulp-glue/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))