Skip to content

Commit 4e0de23

Browse files
authored
Update transifex-util.py
1 parent 8926ab2 commit 4e0de23

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

.github/workflows/transifex-util.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,27 @@ def _clone_cpython_repo(version: str):
8282

8383

8484
def _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

88107
def _create_txconfig():
89108
_call("sphinx-intl create-txconfig")

0 commit comments

Comments
 (0)