Skip to content

Commit

Permalink
Actualiza a sphinx-autorun >= 2.0.0 (#3355)
Browse files Browse the repository at this point in the history
Esta última versión incluye dos correcciones importantes: 1) la
extensión ahora declara que sphinx puede llevar a cabo la lectura de los
archivos .rst en paralelo
(WhyNotHugo/sphinx-autorun#63), y 2) elimina
unos RuntimeWarnings producto de un mal uso de la opción bufsize al
crear objetos Popen
(WhyNotHugo/sphinx-autorun#65).

El primero de los problemas conllevaba a que nosotros tuviéramos que
realizar manualmente el registro del plug-in, en vez de simplemente
declararlo en "extensions". El segundo problema nos llevó a fijar un
filtro con PYTHONWARNINGS con el cual se ignoraban todos los
RuntimeWarning. Con esta última versión de sphinx-autorun, ambas
soluciones parches ya no son necesarias.

Signed-off-by: Rodrigo Tobar <[email protected]>
  • Loading branch information
rtobar authored Jan 2, 2025
1 parent 1c21578 commit a3b0146
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 23 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,4 @@ jobs:
# Construcción de la documentación
- name: Construir documentación
run: |
# Normal build
PYTHONWARNINGS=ignore::FutureWarning,ignore::RuntimeWarning sphinx-build -j auto -W --keep-going -b html -d cpython/Doc/_build/doctree -D language=es . cpython/Doc/_build/html
sphinx-build -j auto -W --keep-going -b html -d cpython/Doc/_build/doctree -D language=es . cpython/Doc/_build/html
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ build: setup do_build
.PHONY: do_build
do_build:
# Normal build
PYTHONWARNINGS=ignore::FutureWarning,ignore::RuntimeWarning $(VENV)/bin/sphinx-build -j $(SPHINX_JOBS) -W --keep-going -b html -d $(OUTPUT_DOCTREE) -D language=$(LANGUAGE) . $(OUTPUT_HTML) && \
$(VENV)/bin/sphinx-build -j $(SPHINX_JOBS) -W --keep-going -b html -d $(OUTPUT_DOCTREE) -D language=$(LANGUAGE) . $(OUTPUT_HTML) && \
echo "Success! Open file://`pwd`/$(OUTPUT_HTML)/index.html, " \
"or run 'make serve' to see them in http://localhost:8000";

Expand Down
20 changes: 1 addition & 19 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
exclude_patterns = _exclude_patterns

_extensions = [
'sphinx_autorun',
'sphinx_tabs.tabs',
'sphinxemoji.sphinxemoji',
]
Expand Down Expand Up @@ -126,22 +127,3 @@ def add_contributing_banner(app, doctree):
app.srcdir = Path(os.getcwd() + '/cpython/Doc')

app.connect('doctree-read', add_contributing_banner)

# Import the sphinx-autorun manually to avoid this warning
# TODO: Remove this code and use just ``extensions.append('sphinx_autorun')`` when
# that issue gets fixed
# See https://github.com/WhyNotHugo/sphinx-autorun/issues/17

# WARNING: the sphinx_autorun extension does not declare if it is safe for
# parallel reading, assuming it isn't - please ask the extension author to
# check and make it explicit
# WARNING: doing serial read
from sphinx_autorun import RunBlock, AutoRun
app.add_directive('runblock', RunBlock)
app.connect('builder-inited', AutoRun.builder_init)
app.add_config_value('autorun_languages', AutoRun.config, 'env')
return {
'version': '0.1',
'parallel_read_safe': True,
'parallel_write_safe': True,
}
2 changes: 1 addition & 1 deletion requirements-own.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pre-commit
Pygments>=2.17.0
PyICU
setuptools
sphinx-autorun
sphinx-autorun>=2.0.0
sphinxemoji
sphinx-intl>=2.3.0
sphinx-lint==0.7.0
Expand Down

0 comments on commit a3b0146

Please sign in to comment.