-
Notifications
You must be signed in to change notification settings - Fork 396
sed
en Makefile y GitHub Action
#1844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Pensamos que podríamos utilizar esta instrucción para resolver esto, pero no sabemos que vaya a funcionar: https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-include_patterns También hablamos de buscar una forma de modificar la directiva |
La directiva
(de https://docutils.sourceforge.io/docs/ref/rst/directives.html#including-an-external-document-fragment) Esto me hizo un poco de ruido hoy... |
I think this is a bug in
It seems it's not able to handle relative paths when changing the |
Applying this patch I was able to make the build to work without using sed at all: ▶ diff -u misc.py misc.modified.py
--- misc.py 2022-10-29 11:56:49.081491920 +0200
+++ misc.modified.py 2022-10-29 11:56:28.425004994 +0200
@@ -64,6 +64,13 @@
path = os.path.normpath(os.path.join(source_dir, path))
path = utils.relative_path(None, path)
path = nodes.reprunicode(path)
+
+ # Fix these ".. include::" directives in the worst way
+ # NOTE: "cpython/Doc" is the "app.srcdir" and it's duplicated in the resulting ``path``
+ # TODO: see https://github.com/python/python-docs-es/issues/1844
+ # 'cpython/Doc/library/cpython/Doc/using/venv-create.inc'
+ path = 'cpython/Doc/' + path.split('cpython/Doc/')[-1]
+
encoding = self.options.get(
'encoding', self.state.document.settings.input_encoding)
e_handler=self.state.document.settings.input_encoding_error_handler Now, I'm not 100% who is responsible from this problem. Is it how Sphinx passes the |
I'd say: "Now that the problem is documented and we barely know why this is happening, I'm fine keeping these not-so-good We could try to research a little more about this and try to figure it out if it's a problem in Sphinx and/or Docutils so we can report it to them. The next steps here would be to create a small example project that changes the However, _this does not affect python-docs-es at all. So, we can decide to not keep researching about this and focus in moving forward since this only affect our own build and does not have any impact in the official build system. |
Este issue lleva un tiempo sin actualizaciones. ¿Estás trabajando todavía?\nSi necesitas ayuda 🆘 no dudes en contactarnos en nuestro grupo de Telegram. |
We currently need to replace the include:: directives in the cpython documentation source files to fix an issue that sphinx/docutils have with relative source files after changing the app.srcdir in our conf.py. Instead of doing this, let's define the app.srcdir property as an absolute path. This removes the issue altogether, yielding a correct build without the need to modify the documentation source files. This change seems to have the nice side effect that successive builds are not incremental rather than starting from scratch. Edit: additionally, we now define sphinx's `app.srcdir` as a Path, which seems to be a requirement at least in 8.1.3, which is what we''l use for building the 3.13 docs. See sphinx-doc/sphinx#13018. Closes #1844 --------- Signed-off-by: Rodrigo Tobar <[email protected]>
Durante la actualización a 3.11 tuvimos problemas con unos
.. include::
de Sphinx que usan path relativos para incluir archivos. No supimos como solucionarlo correctamente y lo que hicimos fue agrear unossed
para actualizar los paths correctamente.Esta solución no es limpia, pero no tuvimos una mejor forma de resolverlo durante el streaming. Hay que encontrar una solución mejor y actualizar
.github/workflows/main.yml
yMakefile
con la nueva solución.The text was updated successfully, but these errors were encountered: