File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -82,8 +82,27 @@ def _clone_cpython_repo(version: str):
8282
8383
8484def _build_gettext ():
85- _call ( "make -C cpython/Doc/ gettext" )
85+ doc_dir = " cpython/Doc"
8686
87+ # Makefile location
88+ makefile = Path (doc_dir ) / "Makefile"
89+
90+ # Lê o Makefile da versão do CPython
91+ with open (makefile ) as f :
92+ contents = f .read ()
93+
94+ # Se o target 'gettext:' existir, usamos a build nova (3.12+)
95+ if "gettext:" in contents :
96+ _call (f"make -C { doc_dir } gettext" )
97+ return
98+
99+ # Para versões mais antigas: criar gettext via Sphinx diretamente
100+ build_dir = Path (doc_dir ) / "build"
101+ build_dir .mkdir (parents = True , exist_ok = True )
102+
103+ _call (
104+ f"sphinx-build -b gettext { doc_dir } { build_dir } /gettext"
105+ )
87106
88107def _create_txconfig ():
89108 _call ("sphinx-intl create-txconfig" )
You can’t perform that action at this time.
0 commit comments