Skip to content
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

Update to sphinx 5.2 #34615

Closed
antonio-rojas opened this issue Sep 29, 2022 · 40 comments
Closed

Update to sphinx 5.2 #34615

antonio-rojas opened this issue Sep 29, 2022 · 40 comments

Comments

@antonio-rojas
Copy link
Contributor

New changes in sphinx requires new attributes to be defined. Supporting this change introduces non fatal error and warnings when building with older version of sphinx.

Therefore we think it is time to upgrade sphinx in sage.

The ticket update

  • sphinx to 5.2.3
  • sphinxcontrib_websupport to 1.2.4 (no other sphinxcontrib package seem out of date)
  • imagesize to 1.4.1 (required dependency)

CC: @kiwifb

Component: build

Author: Antonio Rojas, François Bissey

Branch: 8f8af65

Reviewer: Kwankyu Lee

Issue created by migration from https://trac.sagemath.org/ticket/34615

@antonio-rojas antonio-rojas added this to the sage-9.8 milestone Sep 29, 2022
@antonio-rojas
Copy link
Contributor Author

Branch: u/arojas/fix_build_with_sphinx_5_2

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 29, 2022

Commit: c2e610c

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 29, 2022

Branch pushed to git repo; I updated commit sha1. New commits:

c2e610cFix build with sphinx 5.2

@antonio-rojas

This comment has been minimized.

@antonio-rojas
Copy link
Contributor Author

Author: Antonio Rojas

@kiwifb
Copy link
Member

kiwifb commented Sep 29, 2022

comment:4

I haven't been pushed to 5.2 yet, so I haven't seen it. Although I could have had reports. This is quite different from the previous fix we pushed. Was it supposed to be implicit in older version of sphinx.

@antonio-rojas
Copy link
Contributor Author

comment:5

No, this is a new attribute in 5.2. That's why I was surprised this still works with older sphinx

sphinx-doc/sphinx@7da60f2

@antonio-rojas
Copy link
Contributor Author

comment:6

Ah, no. It does throw errors with older sphinx, although docs still seem to build fine.

@kiwifb
Copy link
Member

kiwifb commented Sep 29, 2022

comment:7

I suggest we take the opportunity to upgrade sphinx in sage itself then. I didn't do it for 5.1 and that may have been lazy on my part :)

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 29, 2022

Changed commit from c2e610c to 0be8a8f

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 29, 2022

Branch pushed to git repo; I updated commit sha1. New commits:

0be8a8fUpdate sphinx to 5.2

@kiwifb

This comment has been minimized.

@kiwifb
Copy link
Member

kiwifb commented Sep 29, 2022

comment:9

I am busy this morning but if you don't do more, I'll look at the sphinx contribution packages that may need updating or- be added to sage.

@kiwifb kiwifb changed the title Fix build with sphinx 5.2 Update to sphinx 5.2 Sep 29, 2022
@antonio-rojas
Copy link
Contributor Author

comment:10

Everything builds fine and docs look OK

@kiwifb
Copy link
Member

kiwifb commented Oct 5, 2022

comment:11

After looking more closely, only sphinxcontrib_websupport would need a version bump.

@kiwifb

This comment has been minimized.

@kiwifb
Copy link
Member

kiwifb commented Oct 5, 2022

Changed commit from 0be8a8f to 4a8c2b2

@kiwifb
Copy link
Member

kiwifb commented Oct 5, 2022

Changed author from Antonio Rojas to Antonio Rojas, François Bissey

@kiwifb
Copy link
Member

kiwifb commented Oct 5, 2022

Changed branch from u/arojas/fix_build_with_sphinx_5_2 to u/fbissey/sphinx5_2

@kiwifb
Copy link
Member

kiwifb commented Oct 5, 2022

New commits:

4a8c2b2update sphinxcontrib_websupport to latest

@kwankyu
Copy link
Collaborator

kwankyu commented Oct 7, 2022

comment:13

On macos, with the ticket branch merged to the develop branch, I encountered

[sagemath_doc_html-none]     raise DistributionNotFound(req, requirers)
[sagemath_doc_html-none] pkg_resources.DistributionNotFound: The 'imagesize>=1.3'
 distribution was not found and is required by sphinx

@kwankyu
Copy link
Collaborator

kwankyu commented Oct 7, 2022

comment:14

Upgrading to imagesize-1.4.1 the latest gets it rolling.

@kwankyu
Copy link
Collaborator

kwankyu commented Oct 7, 2022

comment:15

Replying to Kwankyu Lee:

Upgrading to imagesize-1.4.1 the latest gets it rolling.

It ended up successfully, and the built documents look good.

@kiwifb
Copy link
Member

kiwifb commented Oct 9, 2022

comment:17

You are right, the version of imagesize was way to low in sage (1.2). Updating now.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 9, 2022

Branch pushed to git repo; I updated commit sha1. New commits:

5cf5836update imagesize to 1.4.1. Minimum required for sphinx 5.2 is 1.3.
8f8af65update sphinx to 5.2.3

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 9, 2022

Changed commit from 4a8c2b2 to 8f8af65

@kiwifb
Copy link
Member

kiwifb commented Oct 9, 2022

comment:19

Updated imagesize and pushed sphinx to 5.2.3.

@kiwifb

This comment has been minimized.

@kwankyu
Copy link
Collaborator

kwankyu commented Oct 10, 2022

comment:20

Thanks.

It works well and looks good to me.

@kwankyu
Copy link
Collaborator

kwankyu commented Oct 10, 2022

Reviewer: Kwankyu Lee

@vbraun
Copy link
Member

vbraun commented Oct 16, 2022

Changed branch from u/fbissey/sphinx5_2 to 8f8af65

@kwankyu
Copy link
Collaborator

kwankyu commented Oct 24, 2022

comment:22

This upgrade seems to have introduced an unpleasant change of doc appearance. Compare

https://8f8af65e54d3a9962cfab40f15dc23f4e955b43f--sagemath-tobias.netlify.app/reference/curves/index.html

with

https://doc.sagemath.org/html/en/reference/curves/index.html

See all the second-level headings. Those weren't before.

@kwankyu
Copy link
Collaborator

kwankyu commented Oct 24, 2022

Changed commit from 8f8af65 to none

@kwankyu
Copy link
Collaborator

kwankyu commented Oct 25, 2022

comment:23

I suspect that the upgrade does not work well with sage's custom autodoc.

@kiwifb
Copy link
Member

kiwifb commented Oct 25, 2022

comment:24

Possibly, it is hardly news that we should get rid of it as quickly as we can. I wanted to ask whether you had an idea why there are subsection for say "plane conics" but not "curves"? When I tried to post yesterday, trac was in maintenance :(

@kwankyu
Copy link
Collaborator

kwankyu commented Oct 25, 2022

comment:25

Replying to François Bissey:

Possibly, it is hardly news that we should get rid of it as quickly as we can.

I agree! But that seems a formidable task (unless we just leave the consequential "broken doc" at it is).

I wanted to ask whether you had an idea why there are subsection for say "plane conics" but not "curves"?

It is because of the maxdepth: 2. See

Plane conics
============

.. toctree::
   :maxdepth: 2 

Hence it is normal. The real problem seems that definitions doc is regarded as content headings. I don't know if this is a feature of the upgraded sphinx or a problem of sage_autodoc...

@kwankyu
Copy link
Collaborator

kwankyu commented Oct 25, 2022

comment:26

A simple and laborious solution would be to change all affected maxdepth: 2 to maxdepth: 1. This seems also a correct solution. Then we can avoid touching sage_autodoc :)

@kwankyu
Copy link
Collaborator

kwankyu commented Oct 25, 2022

comment:27

Replying to Kwankyu Lee:

A simple and laborious solution would be to change all affected maxdepth: 2 to maxdepth: 1. This seems also a correct solution. Then we can avoid touching sage_autodoc :)

This certainly does not solve all problems. See the "Contents" on the right

https://8f8af65e54d3a9962cfab40f15dc23f4e955b43f--sagemath-tobias.netlify.app/reference/curves/sage/schemes/plane_conics/constructor.html

@kiwifb
Copy link
Member

kiwifb commented Oct 25, 2022

comment:28

I don't think that's bad. It is on a static right space while the content is just in a middle frame. This really looks like a standard template. One I have seen in other places.

Of course, if it is inconsistent with other pages, we have a problem.

@kwankyu
Copy link
Collaborator

kwankyu commented Oct 31, 2022

comment:29

Replying to François Bissey:

I don't think that's bad. It is on a static right space while the content is just in a middle frame. This really looks like a standard template. One I have seen in other places.

Object definitions in TOC is a new standard feature of the upgraded Sphinx. But this changes our doc in an unintended way. This is fixed now in #34706. Needs review.

kryzar pushed a commit to kryzar/sage that referenced this issue Feb 6, 2023
Sphinx, upgraded to 5.2.3 in sagemath#34615, builds the doc with object
(classes, functions, ...) entries in toc (table of contents).

We keep the object entries in TOC, but remove them from the main index
pages.

URL: https://trac.sagemath.org/34710
Reported by: klee
Ticket author(s): Kwankyu Lee
Reviewer(s): François Bissey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants