Skip to content

Conversation

jni
Copy link
Member

@jni jni commented Oct 3, 2025

This was a syntax error in json and causing the version switcher to fail
altogether on the deployed site.

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Oct 3, 2025
@jni
Copy link
Member Author

jni commented Oct 3, 2025

Hmm, still not liking the json:

    switcher_content = json.loads(content)
                       ^^^^^^^^^^^^^^^^^^^
  File "/home/circleci/.pyenv/versions/3.12.11/lib/python3.12/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/circleci/.pyenv/versions/3.12.11/lib/python3.12/json/decoder.py", line 338, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/circleci/.pyenv/versions/3.12.11/lib/python3.12/json/decoder.py", line 354, in raw_decode
    obj, end = self.scan_once(s, idx)
               ^^^^^^^^^^^^^^^^^^^^^^
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 17 column 5 (char 361)

That's the closing brace for 0.6.4. Investigating...

@psobolewskiPhD
Copy link
Member

Something is still not quite right...

json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 17 column 5 (char 361)

@jni
Copy link
Member Author

jni commented Oct 3, 2025

wtf

In [3]: with open('version_switcher.json', mode='r') as fin:
   ...:     c = json.loads(fin.read())
   ...:

In [4]: c
Out[4]:
[{'name': 'latest', 'version': 'dev', 'url': 'https://napari.org/dev/'},
 {'name': 'stable (0.6.5)',
  'version': '0.6.5',
  'url': 'https://napari.org/stable/',
  'preferred': True},
 {'name': '0.6.4', 'version': '0.6.4', 'url': 'https://napari.org/0.6.4/'},
 {'name': '0.6.3', 'version': '0.6.3', 'url': 'https://napari.org/0.6.3/'},
 {'name': '0.6.2', 'version': '0.6.2', 'url': 'https://napari.org/0.6.2/'},
 {'name': '0.6.1', 'version': '0.6.1', 'url': 'https://napari.org/0.6.1/'},
 {'name': '0.6.0', 'version': '0.6.0', 'url': 'https://napari.org/0.6.0/'},
 {'name': '0.5.6', 'version': '0.5.6', 'url': 'https://napari.org/0.5.6/'},
 {'name': '0.5.5', 'version': '0.5.5', 'url': 'https://napari.org/0.5.5/'},
 {'name': '0.5.4', 'version': '0.5.4', 'url': 'https://napari.org/0.5.4/'},
 {'name': '0.5.3', 'version': '0.5.3', 'url': 'https://napari.org/0.5.3/'},
 {'name': '0.5.2', 'version': '0.5.2', 'url': 'https://napari.org/0.5.2/'},
 {'name': '0.5.1', 'version': '0.5.1', 'url': 'https://napari.org/0.5.1/'},
 {'name': '0.5.0', 'version': '0.5.0', 'url': 'https://napari.org/0.5.0/'},
 {'name': '0.4.19', 'version': '0.4.19', 'url': 'https://napari.org/0.4.19/'},
 {'name': '0.4.18', 'version': '0.4.18', 'url': 'https://napari.org/0.4.18/'},
 {'name': '0.4.17', 'version': '0.4.17', 'url': 'https://napari.org/0.4.17/'},
 {'name': '0.4.16', 'version': '0.4.16', 'url': 'https://napari.org/0.4.16/'},
 {'name': '0.4.15', 'version': '0.4.15', 'url': 'https://napari.org/0.4.15/'}]

@TimMonko
Copy link
Contributor

TimMonko commented Oct 3, 2025

If you check Lorenzo's PR everyone was switched from tab to spaces is that why

@jni
Copy link
Member Author

jni commented Oct 3, 2025

oh no, that's not it

@jni
Copy link
Member Author

jni commented Oct 3, 2025

the config is reading from the URL

@jni
Copy link
Member Author

jni commented Oct 3, 2025

so it's failing because the deployed JSON is borked

@jni
Copy link
Member Author

jni commented Oct 3, 2025

so I think we gotta just merge to give it a go... 😬

@psobolewskiPhD
Copy link
Member

Yeah, good catch:

json_url = "https://napari.org/dev/_static/version_switcher.json"

So we need to merge this, but should re-think the config maybe? because we will always miss PR that break it, because it will not break the build till after deploy.

@TimMonko TimMonko merged commit 5f43bfe into napari:main Oct 3, 2025
5 of 9 checks passed
@psobolewskiPhD
Copy link
Member

With napari/napari.github.io#432
I think we can remove the url and use the local _static location, since it looks like we were using URL for unversioned to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants