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

RemovedInSphinx90Warning ("The str interface for _JavaScript objects is deprecated") #197

Closed
ru-fu opened this issue Aug 8, 2024 · 2 comments · Fixed by #198
Closed
Labels

Comments

@ru-fu
Copy link

ru-fu commented Aug 8, 2024

Describe the bug

When building with Sphinx 8.x, sphinx-tabs gives the following errors:

.../.sphinx/venv/lib/python3.10/site-packages/sphinx_tabs/tabs.py:335: RemovedInSphinx90Warning: The str interface for _JavaScript objects is deprecated. Use js.filename instead.
  if path.suffix == ".js" and path.as_posix() in context["script_files"]:
.../.sphinx/venv/lib/python3.10/site-packages/sphinx_tabs/tabs.py:336: RemovedInSphinx90Warning: The str interface for _JavaScript objects is deprecated. Use js.filename instead.
  context["script_files"].remove(path.as_posix())

These aren't actually Sphinx errors and don't cause the build to fail, but I haven't figured out how to filter them out, so they make the build log unreadable.
And it will probably render sphinx-tabs unusable in Sphinx 9.x.

Seems the deprecation message has been introduced in this commit: sphinx-doc/sphinx@49dc0dd

Reproduce the bug

Build a doc set that includes tabs with Sphinx 8.x.

List your environment

No response

@dimaqq
Copy link

dimaqq commented Aug 19, 2024

I think changing the title to include "str interface for _JavaScript" would make this issue a bit more visible and precise.

@ru-fu ru-fu changed the title RemovedInSphinx90Warning RemovedInSphinx90Warning ("The str interface for _JavaScript objects is deprecated") Aug 19, 2024
kartben added a commit to kartben/sphinx-tabs that referenced this issue Aug 20, 2024
Fixes executablebooks#197 by reversing the logic of how JS/CSS assets are added to pages.
Rather than adding assets to the app and using undocumented API to *remove* them when not needed, do the exact opposite and only add them to the local html-page-context when building a page.

Signed-off-by: Benjamin Cabé <[email protected]>
kartben added a commit to kartben/sphinx-tabs that referenced this issue Aug 20, 2024
Fixes executablebooks#197 by reversing the logic of how JS/CSS assets are added to pages.
Rather than adding assets to the app and using undocumented API to *remove* them when not needed, do the exact opposite and only add them to the local html-page-context when building a page.

Signed-off-by: Benjamin Cabé <[email protected]>
@kartben
Copy link
Contributor

kartben commented Aug 20, 2024

My understanding is that there should have been no dependency on internal/undocumented API in the first place. PR #198 is taking a stab at fixing this issue -- would be great to get some help reviewing it and potentially getting a release with the fix out. Thanks!

kartben added a commit to kartben/sphinx-tabs that referenced this issue Aug 20, 2024
Fixes executablebooks#197 by reversing the logic of how JS/CSS assets are added to pages.
Rather than adding assets to the app and using undocumented API to *remove* them when not needed, do the exact opposite and only add them to the local html-page-context when building a page.

Signed-off-by: Benjamin Cabé <[email protected]>
kartben added a commit to kartben/sphinx-tabs that referenced this issue Aug 20, 2024
Fixes executablebooks#197 by reversing the logic of how JS/CSS assets are added to pages.
Rather than adding assets to the app and using undocumented API to *remove* them when not needed, do the exact opposite and only add them to the local html-page-context when building a page.

Signed-off-by: Benjamin Cabé <[email protected]>
kartben added a commit to kartben/sphinx-tabs that referenced this issue Aug 21, 2024
Fixes executablebooks#197 by reversing the logic of how JS/CSS assets are added to pages.
Rather than adding assets to the app and using undocumented API to *remove* them when not needed, do the exact opposite and only add them to the local html-page-context when building a page.

Signed-off-by: Benjamin Cabé <[email protected]>
kartben added a commit to kartben/sphinx-tabs that referenced this issue Aug 21, 2024
Fixes executablebooks#197 by reversing the logic of how JS/CSS assets are added to pages.
Rather than adding assets to the app and using undocumented API to *remove* them when not needed, do the exact opposite and only add them to the local html-page-context when building a page.

Signed-off-by: Benjamin Cabé <[email protected]>
simondeziel added a commit to simondeziel/lxd that referenced this issue Oct 1, 2024
tomponline added a commit to canonical/lxd that referenced this issue Oct 2, 2024
tomponline pushed a commit to tomponline/lxd that referenced this issue Oct 8, 2024
Workaround executablebooks/sphinx-tabs#197

Signed-off-by: Simon Deziel <[email protected]>
(cherry picked from commit 4c0b4bd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants