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

Commit875e5df

Browse files
authored
Remove include:: replacements hack (#2875)
We currently need to replace the include:: directives in the cpythondocumentation source files to fix an issue that sphinx/docutils havewith relative source files after changing the app.srcdir in our conf.py.Instead of doing this, let's define the app.srcdir property as anabsolute path. This removes the issue altogether, yielding a correctbuild without the need to modify the documentation source files.This change seems to have the nice side effect that successive buildsare not incremental rather than starting from scratch.Edit: additionally, we now define sphinx's `app.srcdir` as a Path, whichseems to be a requirement at least in 8.1.3, which is what we''l use forbuilding the 3.13 docs. Seesphinx-doc/sphinx#13018.Closes#1844---------Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
1 parent88c4f4c commit875e5df

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

‎.github/workflows/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,5 @@ jobs:
8888
# Construcción de la documentación
8989
-name:Construir documentación
9090
run:|
91-
make fix_relative_paths
9291
# Normal build
9392
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

‎Makefile

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ help:
3939
# before this. If passing SPHINXERRORHANDLING='', warnings will not be
4040
# treated as errors, which is good to skip simple Sphinx syntax mistakes.
4141
.PHONY: build
42-
build: setupfix_relative_pathsdo_build
42+
build: setup do_build
4343

4444
.PHONY: do_build
4545
do_build:
@@ -48,14 +48,6 @@ do_build:
4848
echo"Success! Open file://`pwd`/$(OUTPUT_HTML)/index.html,"\
4949
"or run 'make serve' to see them in http://localhost:8000";
5050

51-
.PHONY: fix_relative_paths
52-
fix_relative_paths:
53-
# FIXME: Relative paths for includes in 'cpython'
54-
# See more about this at https://github.com/python/python-docs-es/issues/1844
55-
sed -i -e's|.. include:: ../includes/wasm-notavail.rst|.. include:: ../../../../includes/wasm-notavail.rst|g' cpython/Doc/**/*.rst
56-
sed -i -e's|.. include:: token-list.inc|.. include:: ../../../token-list.inc|g' cpython/Doc/library/token.rst
57-
sed -i -e's|.. include:: /using/venv-create.inc|.. include:: ../../../../using/venv-create.inc|g' cpython/Doc/library/venv.rst
58-
5951
# setup: After running "venv" target, prepare that virtual environment with
6052
# a local clone of cpython repository and the translation files.
6153
# If the directories exists, only update the cpython repository and

‎conf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
importsys
1717
importos
1818
importtime
19+
frompathlibimportPath
20+
1921
sys.path.append(os.path.abspath('cpython/Doc/tools/extensions'))
2022
sys.path.append(os.path.abspath('cpython/Doc/includes'))
2123

@@ -70,7 +72,6 @@
7072

7173
ifos.environ.get('SPHINX_GETTEXT')isNone:
7274
# Override all the files from ``.overrides`` directory
73-
frompathlibimportPath
7475
overrides_paths=Path('.overrides')
7576

7677
forpathinoverrides_paths.glob('**/*.*'):
@@ -129,7 +130,7 @@ def add_contributing_banner(app, doctree):
129130
document.insert(0,banner)
130131

131132
# Change the sourcedir programmatically because Read the Docs always call it with `.`
132-
app.srcdir='cpython/Doc'
133+
app.srcdir=Path(os.getcwd()+'/cpython/Doc')
133134

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp