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

Bump pydata-sphinx-theme #27658

Merged
merged 7 commits into from
Mar 7, 2024
Merged

Bump pydata-sphinx-theme #27658

merged 7 commits into from
Mar 7, 2024

Conversation

dstansby
Copy link
Member

@dstansby dstansby commented Jan 16, 2024

PR summary

The goal of this PR is to bump pydata-shpinx-theme, so we can take advantage of improvements/bug fixes that have happened since version 0.13.

Things that are currently broken now fixed:

  • Light/dark theme button
  • Search button - working fine in a build of mpl-sphinx-theme, so there must be something funny going on in matplotlib itself that is stopping this from working... update 1: it's version-switcher.html that's breaking this somehow. update 2: I think Search button/field broken on local development build pydata/pydata-sphinx-theme#1654 is the upstream issue here
  • Version switcher doesn't say "devdocs"
  • Section navigation missing

Fixes #27652
Fixes matplotlib/mpl-sphinx-theme#80

PR checklist

@github-actions github-actions bot added the Documentation: build building the docs label Jan 16, 2024
@dstansby dstansby changed the title Bump pydata-sphinx-theme to 0.15 Bump pydata-sphinx-theme Jan 17, 2024
@github-actions github-actions bot added Documentation: devdocs files in doc/devel Documentation: user guide files in galleries/users_explain or doc/users Documentation: API files in lib/ and doc/api labels Jan 19, 2024
@dstansby dstansby force-pushed the pydata-version branch 2 times, most recently from 5219372 to 149374a Compare January 19, 2024 18:56
@github-actions github-actions bot removed Documentation: devdocs files in doc/devel Documentation: user guide files in galleries/users_explain or doc/users Documentation: API files in lib/ and doc/api labels Jan 19, 2024
@dstansby dstansby force-pushed the pydata-version branch 2 times, most recently from c66acba to 9ec03b7 Compare February 17, 2024 10:05
@dstansby dstansby force-pushed the pydata-version branch 2 times, most recently from 4c030e9 to d369a06 Compare March 4, 2024 21:00
@@ -147,7 +147,7 @@ commands:
export RELEASE_TAG='-t release'
fi
mkdir -p logs
make html O="-T $RELEASE_TAG -j4 -w /tmp/sphinxerrorswarnings.log"
make html O="-T $RELEASE_TAG -j1 -w /tmp/sphinxerrorswarnings.log"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is because pydata-sphinx-theme doesn't support parallel writes: pydata/pydata-sphinx-theme#1643. It doesn't seem to impact build time significantly though, 18m19s before and 18m57s after.

Copy link
Member

@timhoffm timhoffm Mar 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not tested with the new version, but IIRC, I got significant speedups on my local machine with -j4. If we can't have that anymore, we need to update https://matplotlib.org/devdocs/devel/document.html#build-the-docs. Also, > 10min doc build times makes working on docs very unattractive. As somebody else said

In practice, that goes from "let me quickly build the docs to see the effect of this change" to "let's just hope it renders correctly".

Are the other improvements so significant that we are willing to take this on?

Edit: or is the above comparison old version -j4 vs. new version -j1. There were other performance improvements in the pydata Sphinx theme that might just compensate the losses of non-parallel builds.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comparison is on circleCI between 591cd65 and f178f5c, the only difference being changing -j4 to -j1. Perhaps even with -j4 circleCI wasn't using any parallelism to build the docs?

Are the other improvements so significant that we are willing to take this on?

They include at least some accesibility improvements which I would advocate for.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this is changing the parallel option only for the circleCI build, not any local or other builds, so the comparison using only times measured on circleCI is fair.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And you can still use parallel options, it will just raise a warning at the end of the doc build that pydata-sphinx-theme isn't parallel write safe.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any need to change our call here. The theme marks it self as parallel-unsafe, so requesting parallel build will be turned off anyway. And then when they fix themselves, we'd need to remember to turn it back on again.

Copy link
Member Author

@dstansby dstansby Mar 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without using -j1, shpinx emits a warning that the theme isn't parallel write safe, which fails the build. Ideally there would be a way to ignore just this warning and use -j4, but I'm not aware if that's possible with sphinx?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could try to add a warnings filter to conf.py

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean the suppress_warnings configuration? It seems to be the only relevant option to do this, but warning about a non-parallel write safe theme doesn't seem to be convered by the list of warning types that can be suppressed.

@@ -14,29 +14,6 @@
margin: 0;
}

/* Make announcement an error colour for unreleased documentation, and sticky. */
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This CSS interacts badly with dark mode, and removing it (and defaulting to what pydata-sphinx-theme uses) looks fine.

@dstansby
Copy link
Member Author

dstansby commented Mar 5, 2024

After much force pushing I think this is finally ready for review!

@dstansby dstansby marked this pull request as ready for review March 5, 2024 09:24
doc/conf.py Show resolved Hide resolved
@timhoffm
Copy link
Member

timhoffm commented Mar 5, 2024

TL;DR I’m just stating my discomfort, not suggesting to block or do anything about it.

On a general note, I'm a bit annoyed that every link is now underlined. While this is required for accessibility pydata/pydata-sphinx-theme#1353 and makes sense for regular links, it's rather distracting in gallery code:

grafik
But 🤷 .

@jklymak
Copy link
Member

jklymak commented Mar 6, 2024

I'm not thrilled with the new pydata theme either. I suppose we can customize somewhat and maybe there is a css entry for the gallery entries?

@dstansby
Copy link
Member Author

dstansby commented Mar 6, 2024

FWIW I quite like the link underlining in the gallery code - there's lots I didn't realise were there before they were underlined! I wouldn't block a PR to change that though.

@jklymak are there any specific bits you don't like?

@jklymak
Copy link
Member

jklymak commented Mar 6, 2024

In particular, not a fan of underlining anywhere except in very rare circumstances. But I appreciate that many web sites use this.

Copy link
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to postpone the style discussion and merge this soon. I believe all above mentioned shortcomings are not blockers. And it's easier to find issues and work on improvements when the new version is in our active build.

@jklymak jklymak merged commit 668c4c4 into matplotlib:main Mar 7, 2024
38 of 41 checks passed
@timhoffm
Copy link
Member

timhoffm commented Mar 7, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation: build building the docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Doc]: Low contrast on clicked links in dark mode pydata_sphinx_theme 0.14.1 breaks current website look
4 participants