From 9c176a9ce335d0e0007af1c0504dcbcdb68de73c Mon Sep 17 00:00:00 2001 From: adrianliaw Date: Wed, 19 Sep 2018 21:13:29 +0800 Subject: [PATCH 1/5] Doc: Disable smartquotes for ja, fr and zh_TW translations This is a replacement for https://github.com/python/cpython/pull/9337. * Using conf.py to disable smartquotes through Sphinx instead of using docutils.conf * Disable smartquotes for Japanese, French and Traditional Chinese translations See: * Suggesting to use conf.py: https://mail.python.org/pipermail/doc-sig/2018-September/004084.html * Original smartquotes issue in ja translations: https://bugs.python.org/issue31793 * Disabling for ja: https://github.com/python/cpython/pull/4006 * Smartquotes issue in fr: https://github.com/python/python-docs-fr/issues/303 * Smartquotes issue in zh_TW: https://mail.python.org/pipermail/doc-sig/2018-August/004079.html --- Doc/conf.py | 5 +++++ Doc/docutils.conf | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) delete mode 100644 Doc/docutils.conf diff --git a/Doc/conf.py b/Doc/conf.py index 7f720ce3832de2..8890b7850e093c 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -41,6 +41,11 @@ venvdir = os.getenv('VENVDIR', 'venv') exclude_patterns = [venvdir+'/*', 'README.rst'] +# Disable Docutils smartquotes for several translations +smartquotes_excludes = { + 'languages': ['ja', 'fr', 'zh_TW'], 'builders': ['man', 'text'], +} + # Options for HTML output # ----------------------- diff --git a/Doc/docutils.conf b/Doc/docutils.conf deleted file mode 100644 index bda4f5dc2351dc..00000000000000 --- a/Doc/docutils.conf +++ /dev/null @@ -1,2 +0,0 @@ -[restructuredtext parser] -smartquotes-locales: ja: ""'' From aa6185d2fc5b3c2bff8244fae590aae142027d46 Mon Sep 17 00:00:00 2001 From: adrianliaw Date: Wed, 19 Sep 2018 21:40:30 +0800 Subject: [PATCH 2/5] Doc: Require Sphinx 1.7 to build the documentations (translations) Using smartquotes_excludes option in conf.py requires Sphinx 1.6.6 or more. See: http://www.sphinx-doc.org/en/1.7/config.html#confval-smartquotes_excludes --- Doc/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/conf.py b/Doc/conf.py index 8890b7850e093c..29bb1a08da5dab 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -34,8 +34,8 @@ # By default, highlight as Python 3. highlight_language = 'python3' -# Require Sphinx 1.2 for build. -needs_sphinx = '1.2' +# Require Sphinx 1.7 for build. +needs_sphinx = '1.7' # Ignore any .rst files in the venv/ directory. venvdir = os.getenv('VENVDIR', 'venv') From be13af3b76ec1ca5c9ad8ae17ba7f0c9d970b538 Mon Sep 17 00:00:00 2001 From: adrianliaw Date: Thu, 11 Oct 2018 18:33:29 +0800 Subject: [PATCH 3/5] Doc: Bump Sphinx version requirements in .azure-pipelines and .travis.yml to 1.7 Disabling smartquotes in conf.py with Sphinx is available in Sphinx 1.7 thus updating the version requirements for building docs on CI. --- .azure-pipelines/docs-steps.yml | 2 +- .travis.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/docs-steps.yml b/.azure-pipelines/docs-steps.yml index c0404aebdcc5c7..44dd8d9a832a06 100644 --- a/.azure-pipelines/docs-steps.yml +++ b/.azure-pipelines/docs-steps.yml @@ -12,7 +12,7 @@ steps: inputs: versionSpec: '>=3.6' -- script: python -m pip install sphinx~=1.6.1 blurb python-docs-theme +- script: python -m pip install sphinx~=1.7.0 blurb python-docs-theme displayName: 'Install build dependencies' - ${{ if ne(parameters.latex, 'true') }}: diff --git a/.travis.yml b/.travis.yml index d1a6da70e508b3..5b87a29c45a1a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,7 +54,7 @@ matrix: # Sphinx is pinned so that new versions that introduce new warnings won't suddenly cause build failures. # (Updating the version is fine as long as no warnings are raised by doing so.) # The theme used by the docs is stored seperately, so we need to install that as well. - - python -m pip install sphinx~=1.6.1 blurb python-docs-theme + - python -m pip install sphinx~=1.7.0 blurb python-docs-theme script: - make check suspicious html SPHINXOPTS="-q -W -j4" - os: osx From 33a0fd4e01db97a12dd98f2cf29d939ae8fbf482 Mon Sep 17 00:00:00 2001 From: Julien Palard Date: Sat, 3 Nov 2018 21:59:56 +0100 Subject: [PATCH 4/5] Restore removed line in merge. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index c4ba9355683fd1..41c0e0fd6aa18e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,6 +53,7 @@ matrix: - cd Doc # Sphinx is pinned so that new versions that introduce new warnings won't suddenly cause build failures. # (Updating the version is fine as long as no warnings are raised by doing so.) + # The theme used by the docs is stored separately, so we need to install that as well. - python -m pip install sphinx==1.8.1 blurb python-docs-theme script: - make check suspicious html SPHINXOPTS="-q -W -j4" From 89bb4218c10e222a9d77b79677fa5190c63d58b8 Mon Sep 17 00:00:00 2001 From: Julien Palard Date: Sat, 3 Nov 2018 22:01:21 +0100 Subject: [PATCH 5/5] Adding zh_CN while we're at it. --- Doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/conf.py b/Doc/conf.py index 4ed81e992023ef..eb57ee0c93399e 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -50,7 +50,7 @@ # Disable Docutils smartquotes for several translations smartquotes_excludes = { - 'languages': ['ja', 'fr', 'zh_TW'], 'builders': ['man', 'text'], + 'languages': ['ja', 'fr', 'zh_TW', 'zh_CN'], 'builders': ['man', 'text'], }