From c426db6470dde4ec4c7bbf155caf115143c0385d Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Sat, 29 Oct 2022 12:14:23 +0200 Subject: [PATCH 1/2] Use a variable for the Python version Closes #1846 --- .overrides/CONTRIBUTING.rst | 4 ++-- .overrides/faq.rst | 6 +++--- .overrides/progress.rst | 2 +- .overrides/upgrade-python-version.rst | 4 ++++ conf.py | 9 +++++++++ 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.overrides/CONTRIBUTING.rst b/.overrides/CONTRIBUTING.rst index 263222d160..cf0e594102 100644 --- a/.overrides/CONTRIBUTING.rst +++ b/.overrides/CONTRIBUTING.rst @@ -67,11 +67,11 @@ Antes de comenzar #. Selecciona un :ref:`archivo para traducir `. -#. Verifica que estás en la rama principal del repositorio, **3.11** (esto es muy +#. Verifica que estás en la rama principal del repositorio, **|pythonversion|** (esto es muy importante para evitar crear una nueva rama a partir de una traducción anterior):: - git checkout 3.11 + git checkout |pythonversion| #. Crea una rama nueva en base al artículo en el que vayas a trabajar. Por ejemplo, si vas a trabajar en el archivo ``library/glosario.po``, usa un nombre diff --git a/.overrides/faq.rst b/.overrides/faq.rst index 71d653c1b7..551e5d985a 100644 --- a/.overrides/faq.rst +++ b/.overrides/faq.rst @@ -204,9 +204,9 @@ repositorio principal de la traducción). Se hace de la siguiente manera:: Luego nos vamos a nuestra rama local, confirmamos e impactamos esos cambios:: - git checkout 3.11 - git merge upstream/3.11 - git push origin 3.11 + git checkout |pythonversion| + git merge upstream/|pythonversion| + git push origin |pythonversion| ¡Eso es todo! diff --git a/.overrides/progress.rst b/.overrides/progress.rst index b4fdb9fbf9..dd4c7ce90c 100644 --- a/.overrides/progress.rst +++ b/.overrides/progress.rst @@ -10,7 +10,7 @@ y otras estadísticas. .. note:: - Estas listas se actualiza automáticamente cuando Pull Requests se *mergean* a la rama ``3.11``. + Estas listas se actualiza automáticamente cuando Pull Requests se *mergean* a la rama ``|pythonversion|``. En progreso diff --git a/.overrides/upgrade-python-version.rst b/.overrides/upgrade-python-version.rst index aef9fdcfba..66d0e0d9d3 100644 --- a/.overrides/upgrade-python-version.rst +++ b/.overrides/upgrade-python-version.rst @@ -1,5 +1,9 @@ :orphan: +.. No uso |pythonversion| "replace" acá porque esta página documenta + la actualización puntual de una versión a otra y no quiero que se actualice + automaticamente cuando cambiamos la variable en ``conf.py`` + How to update to a new Python version ===================================== diff --git a/conf.py b/conf.py index 6d5a7fdb0a..326166871c 100644 --- a/conf.py +++ b/conf.py @@ -32,6 +32,15 @@ from patchlevel import get_header_version_info version, release = get_header_version_info(os.path.abspath('cpython/Doc')) +_rst_epilog = """ +.. |pythonversion| replace:: 3.11 +""" + +if 'rst_epilog' in globals(): + rst_epilog += _rst_epilog +else: + rst_epilog = _rst_epilog + project = 'Python en Español' year = time.strftime("%Y") copyright = f'2001-{year}, Python Software Foundation' From a141cac9a134e3195ed87ac6a98fe3a07e986b53 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Sat, 29 Oct 2022 12:18:22 +0200 Subject: [PATCH 2/2] Minor comments in conf.py --- conf.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/conf.py b/conf.py index 326166871c..2eafd65ffe 100644 --- a/conf.py +++ b/conf.py @@ -58,7 +58,8 @@ # Extend settings from upstream _exclude_patterns = [ - # This file is not included and it's not marked as :orphan: + # These file is not included and it's not marked as :orphan: + # These files are used in ".. include::" directives 'distutils/_setuptools_disclaimer.rst', 'includes/wasm-notavail.rst', ] @@ -67,10 +68,12 @@ else: exclude_patterns = _exclude_patterns +# Extra extensions for our own documentation site _extensions = [ 'sphinx_tabs.tabs', 'sphinxemoji.sphinxemoji', ] + if 'extensions' in globals(): extensions += _extensions else: @@ -85,10 +88,12 @@ for path in overrides_paths.glob('**/*.*'): if path.name == 'README.rst' and path.parent == '.overrides': continue + # Skip the files in the .overrides/logo directory # to avoid ln issues. if str(path.parent).endswith("logo"): continue + destroot = str(path.parent).replace('.overrides', '').lstrip('/') outputdir = Path('cpython/Doc') / destroot / path.name os.system(f'ln -nfs `pwd`/{path.parent}/{path.name} {outputdir}')