Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6f4b68f

Browse files
committed
refactor(make): organize preparation directives
1 parente54aa0a commit6f4b68f

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

‎Makefile

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,17 @@ SPHINX_CONF := $(CPYTHON_CLONE)/Doc/conf.py
4343
LANGUAGE := zh_TW
4444
LC_MESSAGES :=$(CPYTHON_CLONE)/Doc/locales/$(LANGUAGE)/LC_MESSAGES
4545
VENV := ~/.venvs/python-docs-i18n/
46-
PYTHON :=$(shell which python3)
4746
MODE := autobuild-dev-html
4847
JOBS := 4
4948

5049
.PHONY: all
51-
all:$(VENV)/bin/sphinx-build$(VENV)/bin/blurb clone## Automatically build an html local version
52-
mkdir -p$(LC_MESSAGES)
50+
all: prepare_deps## Automatically build an html local version
5351
fordirnamein$$(find. -name'*.po'| xargs -n1 dirname| sort -u| grep -v'^\.$$');do mkdir -p$(LC_MESSAGES)/$$dirname;done
5452
forfilein*.po*/*.po;do ln -f$$file$(LC_MESSAGES)/$$file;done
5553
.$(VENV)/bin/activate;$(MAKE) -C$(CPYTHON_CLONE)/Doc/ SPHINXOPTS='-j$(JOBS) -D locale_dirs=locales -D language=$(LANGUAGE) -D gettext_compact=0'$(MODE)
5654

5755
.PHONY: build
58-
build:$(VENV)/bin/sphinx-build$(VENV)/bin/blurb clone## Automatically build an html local version for a single file
56+
build:prepare_deps## Automatically build an html local version for a single file
5957
@$(eval target=$(filter-out$@,$(MAKECMDGOALS)))
6058
@if [-z$(target) ];then\
6159
echo"\x1B[1;31m""Please provide a file argument.""\x1B[m";\
@@ -80,15 +78,18 @@ build: $(VENV)/bin/sphinx-build $(VENV)/bin/blurb clone ## Automatically build a
8078
help:
8179
@python3 -c"$$PRINT_HELP_PYSCRIPT"<$(MAKEFILE_LIST)
8280

83-
clone:## Clone latest cpython repository to `../cpython/` if it doesn't exist
81+
.PHONY: prepare_deps
82+
prepare_deps:$(VENV)/bin/sphinx-build$(VENV)/bin/blurb upgrade_venv prepare_cpython## Prepare dependencies
83+
84+
.PHONY: prepare_cpython
85+
prepare_cpython:## Prepare CPython clone at `../cpython/`.
8486
git clone --depth 1 --no-single-branch https://github.com/python/cpython.git$(CPYTHON_CLONE)||echo"cpython exists"
85-
cd$(CPYTHON_CLONE)&& git checkout$(VERSION)
87+
cd$(CPYTHON_CLONE)&& git checkout$(VERSION)&& git pull origin$(VERSION)
88+
mkdir -p$(LC_MESSAGES)
8689

8790

8891
$(VENV)/bin/activate:
89-
mkdir -p$(VENV)
90-
$(PYTHON) -m venv$(VENV)
91-
92+
python3 -m venv$(VENV)
9293

9394
$(VENV)/bin/sphinx-build:$(VENV)/bin/activate
9495
.$(VENV)/bin/activate; python3 -m pip install sphinx python-docs-theme
@@ -102,7 +103,7 @@ $(VENV)/bin/blurb: $(VENV)/bin/activate
102103

103104
.PHONY: upgrade_venv
104105
upgrade_venv:$(VENV)/bin/activate## Upgrade the venv that compiles the doc
105-
.$(VENV)/bin/activate; python3 -m pip install --upgrade sphinx python-docs-theme blurb sphinx-lint
106+
@.$(VENV)/bin/activate; python3 -m pip install -q --upgrade sphinx python-docs-theme blurb sphinx-lint
106107

107108

108109
.PHONY: progress
@@ -118,7 +119,7 @@ todo: ## List remaining tasks
118119

119120

120121
.PHONY: merge
121-
merge:upgrade_venv## To merge pot from upstream
122+
merge:prepare_deps## To merge pot from upstream
122123
(cd$(CPYTHON_CLONE)/Doc; rm -f build/NEWS)
123124
(cd$(CPYTHON_CLONE)/Doc;$(VENV)/bin/sphinx-build -Q -b gettext -D gettext_compact=0. locales/pot/)
124125
find$(CPYTHON_CLONE)/Doc/locales/pot/ -name'*.pot'|\

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp