-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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
Docs build error with Sphinx 3.0 due to invalid C declaration #84385
Comments
The following error is caused in Docs build for a 3.8 backport since sphinx is ran with warnings. Sphinx released 3.0 on April 6. The last successful build on master uses Sphinx 2.2.0 [0]. My guess is sphinx new version possibly breaking the build on Python 3.8 where it's not pinned to use 2.2.0 pulling the latest version. The changelog for Sphinx has below note : https://www.sphinx-doc.org/en/master/changes.html#release-3-0-0-released-apr-06-2020 The C domain has been rewritten, with additional directives and roles. The existing ones are now more strict, resulting in new warnings. Python 3.8 and Python 3.7 doesn't have Sphinx pinned to 2.2.0 while master does. Python 3.8 Docs makefile : Line 146 in f7b0259
Failed build : https://github.com/python/cpython/pull/19388/checks?check_run_id=563053793#step:7:46 Error : Warning, treated as error: [0] https://github.com/python/cpython/runs/564123625#step:6:24 |
It sounds dangerous to not pin the Sphinx version in our CI :-/ Another issue caused by CI configuration stored at the same place than the code: |
Maybe copy the code for deprecated and removed features to Doc/tools/extensions? |
The sphinx version is not pinned in 3.7, 3.6, 3.5 and 2.7 branches too for Doc/Makefile that can cause error on someone trying it out locally. They are pinned in .travis.yml and .azure-pipelines configurations. |
In 3.8, .azure-pipelines/docs-steps.yml contains:
and .travis.yml contains:
For example, the Sphinx version was changed from 1.8.1 to 1.8.2 in the CI configuration by: commit 7f4ba4a
-- I guess that you're talking about Doc/Makefile which uses "Sphinx" in 3.8 but "Sphinx==2.2.0" in master. Code in 3.8: venv: |
I wrote PR 19442 to pin Sphinx version to 1.8.2 in Doc/Makefile. |
New changeset 37a257c by Victor Stinner in branch '3.8': |
I have filed an issue upstream and it's fixed. The release of 3.0.1 is planned in few days and could help for other branches. But it would be nice to see the version pinned to avoid these problems in future. Upstream report : sphinx-doc/sphinx#7423 (comment) |
Why are we pinning to 1.8.2 when the official docs builds for all releases are currently using 2.3.1? (see, for example, https://docs.python.org/3.8/ at bottom right corner) |
First of all, to repair the CI :-) Before my change, it was no longer possible to merge any change in 3.8! (I didn't check for 3.7, but I expect that it wasn't possible neither). Second, 1.8.2 version comes from the CI configuration: $ grep -i sphinx== .travis.yml .azure-pipelines/* Doc/Makefile
.travis.yml: - python -m pip install sphinx==1.8.2 blurb
.azure-pipelines/docs-steps.yml:- script: python -m pip install sphinx==1.8.2 blurb python-docs-theme
Doc/Makefile: $(VENVDIR)/bin/python3 -m pip install -U Sphinx==1.8.2 blurb If Sphinx version is changed in Doc/Makefile, I would prefer to also update the version in the CI configuration. I also vaguely recall discussions about issues with newer Sphinx. I don't recall if it was 2.0 or another version. Julien Palard may recall that better than me! Was it bpo-35472? -- I don't really care of the Sphinx version, I only care about working CI and consistency between all pinned versions ;-) -- By the way, maybe Doc/Makefile could use the latest Sphinx version by default, and the Python CI could use a pinned version. The problem is that the Sphinx version cannot be configured currently when running "make venv". Oh, .travis.yml is differecen between 3.7 and 3.8. 3.8 and master use "make -C Doc/ PYTHON=../python venv". 3.7 doesn't use "make venv" but: before_script: Maybe 3.7 should mimick what is done in 3.8 and master to ease maintenance. I don't know. |
I agree that it should be easier to keep them all in sync. But my point is that the on-going official doc builds (some multi[ple times per day) for all of the active versions (2.7 and 3.6 through 3.9) are using 2.3.1 so we should be doing CI against that version as well. The docs builds are configured in https://github.com/python/docsbuild-scripts. So whenever requirements.in is update there, the CI versions should be updated as well. Even better would be someway to auto sync them. Julien, any ideas on this? |
A few days ago, 3.8 backports failed while 3.7 backports merged. Thank you for the fix, even if temporary. I just noticed that the doc main page ends with "Created using Sphinx 2.3.1." I plan to switch my local sphinx to that version. |
New changeset 0d70a98 by Ned Deily in branch '3.7': |
I look into this issue. It's quite complicated :-( The Sphinx 3.0.0b1 changelog says:
The Python documentation has many issues:
PR 19397 fix some errors, but not all of them. |
Sphinx documentation of the C domain: |
Don't hesitate to send requests back to the Sphinx tracker if any changes appear to be too restrictive to you. It is a documentation tool, not a compiler. |
"""
Hmm, grep shows: c-api/buffer.rst:123: most cases such a request will be :c:macro:`PyBUF_SIMPLE` or :c:macro:`PyBUF_WRITABLE`. So I see a single definition ans several references. Whether the definition may occur in a table is more a question for Georg. :) It worked up to now and is quite useful, because you can jump directly into the correct row. Escaping the "\*" was necessary at the time for vim syntax highlighting. I think it is no longer needed. So everything has a reason :) |
This issue prevents to upgrade Sphinx to Sphinx 3 in Fedora Rawhide, at least it breaks the python3-docs package which is Python 3.9 documentation: |
Making the Python documentation compatible with Sphinx 3.0 is causing multiple blocker issues. (*) The first major problem is that new C domain markup like :c:struct: and :expr: are not recognized by Sphinx 2.4.4, but Sphinx 3.0 requires them. For example, a ".. c:struct:" section is completely hidden: treated as a comment. I don't think that we can afford to drop Sphinx < 3 support since no Linux distribution uses Sphinx 3 yet. I see two options:
(*) The second major question is: should we backport these changes to Python 3.8 and 3.9 branches? I consider that "supporting Sphinx 3" is a fix in the Python build system, and usually we do backport such changes, even if they can be seen as "new features". For me, it falls into the same category than supporting a newer version of C compiler. PR 19397 makes tons of small changes. If we don't backport it, it will be very likely very painful to backport documentation changes. Julien Palard (who works on the documentation) suggests to backport the change. Usually, documentation changes are applied to all branches, not only master. Again, right now, if we backport these changes, we would drop Sphinx 2 support. |
In short, the current status is that IMHO it is not acceptable to support Sphinx 3. We cannot afford to break support with Sphinx 2. |
I reported the issue to Sphinx: |
Using sphinx-doc/sphinx#7905 but without -W, I'm able to build the unmodified Python documentation with Sphinx 3! I tried c_allow_pre_v3=1. The PR was updated to add a second c_warn_on_allowed_pre_v3=0 option so we can keep -W. |
please note that pinning usually is not a solution for Linux distributions. Yes, the most wanted fix would be to fix sphinx 3.x not to break compatibility with 2.x. Or limit 3.9 to 2.x features for now. |
sphinx-doc/sphinx#7905 has been merged and will be part of the next Sphinx 3.2 release. |
3.9.0 rc1 fails to build the docs with Sphinx 3.2.0, even with setting c_allow_pre_v3 = True
c_warn_on_allowed_pre_v3 = False Warning, treated as error: With 3.2.0, you still need to build without -W |
With PR 21865, there are only two remaining warnings: Doc/library/string.rst:311: WARNING: duplicate token description of sf:format_spec, other instance in library/string See bpo-35293 for RemovedInSphinx40Warning (which are already prevent with Sphinx 2). |
I'm now able to build the Python documentation with Sphinx 3.2.1 without modifying the Doc/Makefile, so using -W option (treat warnings as errors): there are no more Sphinx 3 warnings. When Sphinx 3 will be more widely available (ex: in Linux distributions), we will be able to consider removing c_allow_pre_v3=True and c_warn_on_allowed_pre_v3=False in doc/conf.py. For that, we should update the documentation to use the Sphinx 3 syntax, see PR 19397 written by Jakob Lykke Andersen. For now, I prefer to keep Sphinx 2 support and so keep Sphinx 2 syntax in the C domain, since it allows supporting Sphinx 2 and Sphinx 3. |
I merged my changes to add Sphinx 3.2 and newer support into 3.8, 3.9 and master branches. I close the issue. Sadly, it seems like it's not possible to keep Sphinx 2 support if we add Sphinx 3.0 and Sphinx 3.1 support. For now, only Sphinx 2 and Sphinx 3.2+ are supported: 3.0 and 3.1 are not supported. |
New changeset c0d5c13 by Victor Stinner in branch 'master': |
Doc/Makefile
. #21141Doc/Makefile
. (GH-21141) #21146Doc/Makefile
. (GH-21141) #21147Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: