-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathMakefile
More file actions
122 lines (94 loc) · 3.38 KB
/
Makefile
File metadata and controls
122 lines (94 loc) · 3.38 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
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
LANGUAGES=de
GLUE_PLUGINS=$(notdir $(wildcard pulp-glue-deb/src/pulp_glue/*))
CLI_PLUGINS=$(notdir $(wildcard src/pulpcore/cli/*))
.PHONY: info
info:
@echo Pulp glue
@echo plugins: $(GLUE_PLUGINS)
@echo Pulp CLI
@echo plugins: $(CLI_PLUGINS)
.PHONY: build
build:
uv build --all
.PHONY: _format
_format:
ruff format
ruff check --select I --fix
.PHONY: format
format:
uv run --isolated --group lint $(MAKE) _format
.PHONY: _autofix
_autofix:
ruff check --fix
.PHONY: autofix
autofix:
uv lock
uv run --isolated --group lint $(MAKE) _autofix
.PHONY: _lint
_lint:
find tests .ci -name '*.sh' -print0 | xargs -0 shellcheck -x
ruff format --check --diff
ruff check
.ci/scripts/check_cli_dependencies.py
.ci/scripts/check_click_for_mypy.py
mypy
cd pulp-glue-deb; mypy
@echo "🙊 Code 🙈 LGTM 🙉 !"
.PHONY: lint
lint:
uv lock --check
uv run --isolated --group lint $(MAKE) _lint
tests/cli.toml:
cp $@.example $@
@echo "In order to configure the tests to talk to your test server, you might need to edit $@ ."
.PHONY: _test
_test: | tests/cli.toml
pytest -v tests pulp-glue-deb/tests
.PHONY: test
test:
uv run $(MAKE) _test
.PHONY: _livetest
_livetest: | tests/cli.toml
pytest -v tests pulp-glue-deb/tests -m live
.PHONY: livetest
livetest:
uv run $(MAKE) _livetest
.PHONY: _paralleltest
_paralleltest: | tests/cli.toml
pytest -v tests pulp-glue-deb/tests -m live -n 8
.PHONY: paralleltest
paralleltest:
uv run $(MAKE) _paralleltest
.PHONY: _unittest
_unittest:
pytest -v tests pulp-glue-deb/tests -m "not live"
.PHONY: unittest
unittest:
uv run $(MAKE) _unittest
.PHONY: _unittest_glue
_unittest_glue:
pytest -v pulp-glue-deb/tests -m "not live"
.PHONY: unittest_glue
unittest_glue:
uv run $(MAKE) _unittest_glue
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' $@
.PHONY: extract_messages
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 $@ $<
.PHONY: compile_messages
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))
.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))