Skip to content

Conversation

jklymak
Copy link
Member

@jklymak jklymak commented May 3, 2021

PR Summary

This adds the image_srcset parameter to our doc conf.py This will require us to use sphinx-gallery dev version, which I'm not exactly sure how to setup on circleCI.

sphinx-gallery/sphinx-gallery#808

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

@jklymak
Copy link
Member Author

jklymak commented May 3, 2021

oooh, that worked.

I guess the issue is if we want to force devs to download off git.

Both those builds took quite a while (23 minutes and 30 minutes). I suspect its a time of day thing: a quick survey of a couple of other PRs range from 18-24 minutes, but I'm not going to guarantee this doesn't slow things down.

Compare:

New

https://58003-1385122-gh.circle-artifacts.com/0/doc/build/html/gallery/lines_bars_and_markers/barh.html

Old:

https://matplotlib.org/stable/gallery/lines_bars_and_markers/barh.html

@jklymak jklymak marked this pull request as ready for review May 3, 2021 17:09
@timhoffm
Copy link
Member

timhoffm commented May 3, 2021

If we want to push this to the test, we'll have to run the new code.

Maybe include a switch so that it only runs on ci/circleci: docs-python38 and not on ci/circleci: docs-python37?

@jklymak
Copy link
Member Author

jklymak commented May 3, 2021

Maybe include a switch so that it only runs on ci/circleci: docs-python38 and not on ci/circleci: docs-python37?

Right now circle CI just pip installs from requirements/doc/doc-requirements.txt. I don't know how to ask it to install just one package differently. I guess we could have two doc-requirements...?

@timhoffm
Copy link
Member

timhoffm commented May 3, 2021

Use the prerelease for both. It’s sufficient to make the 2x distinction in conf.py.

@jklymak
Copy link
Member Author

jklymak commented May 3, 2021

So, leave it as-is?

doc/conf.py Outdated
@@ -168,6 +168,7 @@ def _check_dependencies():
'thumbnail_size': (320, 224),
'compress_images': ('thumbnails', 'images'),
'matplotlib_animations': True,
'image_srcset': ["2x"],
Copy link
Member

@timhoffm timhoffm May 4, 2021

Choose a reason for hiding this comment

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

Maybe

Suggested change
'image_srcset': ["2x"],
# 3.7 CI doc build should not use hidpi images during the testing phase
'image_srcset': [] if platform.python_version[:3] == '3.7' else ["2x"],

That way we have builds with and without hidpi images for comparison (ok still using the same code but heh).

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, I see. Sure we can try that.

Copy link
Member

Choose a reason for hiding this comment

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

You have sys already though: sys.version_info[:2] == (3, 7)

@timhoffm timhoffm added this to the v3.5.0 milestone May 5, 2021
@QuLogic QuLogic merged commit e187731 into matplotlib:master May 5, 2021
@jklymak jklymak deleted the doc-srcset-directive branch May 5, 2021 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants