Skip to content

Commit fe0fb94

Browse files
authored
Merge branch '3.12' into issue-2423
2 parents f1b739c + a65f03e commit fe0fb94

File tree

6 files changed

+97
-103
lines changed

6 files changed

+97
-103
lines changed

.github/workflows/main.yml

+1-9
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
diff -Naur TRANSLATORS <(LANG=es python scripts/sort.py < TRANSLATORS)
7878
- name: Powrap
7979
if: steps.po-files-to-check.outputs.any_po_files_to_check == 'true'
80-
run: powrap --check --quiet ${{ steps.po-files-to-check.outputs.po_files_to_check }}
80+
run: powrap --diff --check --quiet ${{ steps.po-files-to-check.outputs.po_files_to_check }}
8181
- name: Sphinx lint
8282
if: steps.po-files-to-check.outputs.any_po_files_to_check == 'true'
8383
run: sphinx-lint ${{ steps.po-files-to-check.outputs.po_files_to_check }}
@@ -88,13 +88,5 @@ jobs:
8888
# Construcción de la documentación
8989
- name: Construir documentación
9090
run: |
91-
# FIXME: Relative paths for includes in 'cpython'
92-
sed -i -e 's|.. include:: ../includes/wasm-notavail.rst|.. include:: ../../../../includes/wasm-notavail.rst|g' cpython/Doc/**/*.rst
93-
sed -i -e 's|.. include:: ../distutils/_setuptools_disclaimer.rst|.. include:: ../../../../distutils/_setuptools_disclaimer.rst|g' cpython/Doc/**/*.rst
94-
sed -i -e 's|.. include:: ./_setuptools_disclaimer.rst|.. include:: ../../../_setuptools_disclaimer.rst|g' cpython/Doc/**/*.rst
95-
sed -i -e 's|.. include:: token-list.inc|.. include:: ../../../token-list.inc|g' cpython/Doc/**/*.rst
96-
sed -i -e 's|.. include:: ../../using/venv-create.inc|.. include:: ../using/venv-create.inc|g' cpython/Doc/**/*.rst
97-
sed -i -e 's|.. include:: ../../../using/venv-create.inc|.. include:: ../../using/venv-create.inc|g' cpython/Doc/**/*.rst
98-
sed -i -e 's|.. include:: /using/venv-create.inc|.. include:: ../../../../using/venv-create.inc|g' cpython/Doc/**/*.rst
9991
# Normal build
10092
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

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
2-
- repo: https://github.com/JulienPalard/powrap
3-
rev: v0.4.0
2+
- repo: https://git.afpy.org/AFPy/powrap
3+
rev: v1.0.2
44
hooks:
55
- id: powrap
66
- repo: local

Makefile

+6-12
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ OUTPUT_DOCTREE := $(CPYTHON_WORKDIR)/Doc/build/doctree
2020
OUTPUT_HTML := $(CPYTHON_WORKDIR)/Doc/build/html
2121
LOCALE_DIR := $(CPYTHON_WORKDIR)/locale
2222
POSPELL_TMP_DIR := .pospell
23+
SPHINX_JOBS := auto
2324

2425

2526
.PHONY: help
@@ -38,22 +39,15 @@ help:
3839
# before this. If passing SPHINXERRORHANDLING='', warnings will not be
3940
# treated as errors, which is good to skip simple Sphinx syntax mistakes.
4041
.PHONY: build
41-
build: setup
42-
# FIXME: Relative paths for includes in 'cpython'
43-
# See more about this at https://github.com/python/python-docs-es/issues/1844
44-
sed -i -e 's|.. include:: ../includes/wasm-notavail.rst|.. include:: ../../../../includes/wasm-notavail.rst|g' cpython/Doc/**/*.rst
45-
sed -i -e 's|.. include:: ../distutils/_setuptools_disclaimer.rst|.. include:: ../../../../distutils/_setuptools_disclaimer.rst|g' cpython/Doc/**/*.rst
46-
sed -i -e 's|.. include:: ./_setuptools_disclaimer.rst|.. include:: ../../../_setuptools_disclaimer.rst|g' cpython/Doc/**/*.rst
47-
sed -i -e 's|.. include:: token-list.inc|.. include:: ../../../token-list.inc|g' cpython/Doc/**/*.rst
48-
sed -i -e 's|.. include:: ../../using/venv-create.inc|.. include:: ../using/venv-create.inc|g' cpython/Doc/**/*.rst
49-
sed -i -e 's|.. include:: ../../../using/venv-create.inc|.. include:: ../../using/venv-create.inc|g' cpython/Doc/**/*.rst
50-
sed -i -e 's|.. include:: /using/venv-create.inc|.. include:: ../../../../using/venv-create.inc|g' cpython/Doc/**/*.rst
42+
build: setup do_build
43+
44+
.PHONY: do_build
45+
do_build:
5146
# Normal build
52-
PYTHONWARNINGS=ignore::FutureWarning,ignore::RuntimeWarning $(VENV)/bin/sphinx-build -j auto -W --keep-going -b html -d $(OUTPUT_DOCTREE) -D language=$(LANGUAGE) . $(OUTPUT_HTML) && \
47+
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) && \
5348
echo "Success! Open file://`pwd`/$(OUTPUT_HTML)/index.html, " \
5449
"or run 'make serve' to see them in http://localhost:8000";
5550

56-
5751
# setup: After running "venv" target, prepare that virtual environment with
5852
# a local clone of cpython repository and the translation files.
5953
# If the directories exists, only update the cpython repository and

conf.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
import sys
1717
import os
1818
import time
19+
from pathlib import Path
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
if os.environ.get('SPHINX_GETTEXT') is None:
7274
# Override all the files from ``.overrides`` directory
73-
from pathlib import Path
7475
overrides_paths = Path('.overrides')
7576

7677
for path in overrides_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)