File tree Expand file tree Collapse file tree 2 files changed +1918
-793
lines changed
Expand file tree Collapse file tree 2 files changed +1918
-793
lines changed Original file line number Diff line number Diff line change 3838export PRINT_HELP_PYSCRIPT # End of python section
3939
4040CPYTHON_CLONE := ../cpython
41+ # Pin to match CI (ubuntu-latest = 24.04, gettext 0.21) wrapping behavior
42+ POWRAP_IMAGE := python-docs-zh-tw-powrap
4143VERSION := $(or $(VERSION ) , 3.14)
4244SPHINX_CONF := $(CPYTHON_CLONE ) /Doc/conf.py
4345LANGUAGE := zh_TW
@@ -157,8 +159,20 @@ lint: $(VENV)/bin/sphinx-lint ## Run sphinx-lint
157159 $(VENV ) /bin/sphinx-lint --enable default-role
158160
159161.PHONY : wrap
160- wrap : # # Run powrap on modified po files
161- uvx powrap --modified
162+ wrap : # # Run powrap on po files (pass files or defaults to git modified)
163+ @docker image inspect $(POWRAP_IMAGE ) > /dev/null 2>&1 || \
164+ docker build -q -t $(POWRAP_IMAGE ) - < .powrap.Dockerfile
165+ @args=" $( filter-out $@ ,$( MAKECMDGOALS) ) " ; \
166+ if [ -n " $$ args" ]; then \
167+ files=" $$ args" ; \
168+ else \
169+ files=$$({ git diff --name-only -- '*.po'; git diff --name-only --cached -- '*.po'; } | sort -u | tr '\n' ' ' ) ; \
170+ fi ; \
171+ if [ -n " $$ files" ]; then \
172+ docker run --rm -v $$(pwd ) :/work -w /work $(POWRAP_IMAGE ) powrap $$ files; \
173+ else \
174+ echo " No modified .po files" ; \
175+ fi
162176
163177# This allows us to accept extra arguments (by doing nothing when we get a job that doesn't match, rather than throwing an error)
164178% :
You can’t perform that action at this time.
0 commit comments