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

fix: check the json switcher file #917

Merged
merged 12 commits into from Oct 4, 2022
Merged

fix: check the json switcher file #917

merged 12 commits into from Oct 4, 2022

Conversation

12rambau
Copy link
Collaborator

@12rambau 12rambau commented Sep 6, 2022

When adding a json switcher using an url I added a few test on the file itself to make sure it's not malformed in order to help developer track down bugs.

Fix #901

@12rambau
Copy link
Collaborator Author

sorry for the noise, some of the errors where only occuring in the github build.

Some explanations:

  • checking if there is a json-url key
  • check that there is a version key
  • find the file using request if the file is distant and read it from the source folder if it's a local one
  • check the content of the switcher file and make sure that all elements have a "url" and "version" key
  • if anything goes wrong raise an error

@12rambau 12rambau marked this pull request as ready for review September 27, 2022 17:51
Copy link
Collaborator

@choldgraf choldgraf left a comment

Choose a reason for hiding this comment

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

Looks good to me - one quick question in there

src/pydata_sphinx_theme/__init__.py Outdated Show resolved Hide resolved
src/pydata_sphinx_theme/__init__.py Outdated Show resolved Hide resolved
@12rambau 12rambau merged commit ecc01a0 into pydata:main Oct 4, 2022
@12rambau 12rambau deleted the json branch October 4, 2022 12:02
@jarrodmillman jarrodmillman modified the milestones: 0.12, 0.11 Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

when the version switcher json is malformed no error is send
3 participants