fix: support relative paths for icons#2536
Merged
Merged
Conversation
When using PyInstaller, importlib_resources.files("glue")
can return a relative path.
If this path is not resolved, it will lead to an error like:
File "glue/icons/__init__.py", line 35, in icon_path
RuntimeError: Icon does not exist: /Users/maartenbreddels/github/spacetelescope/jdaviz/standalone/dist/jdaviz/_internal/glue_jupyter/bqplot/common/../../icons/glue_polygon.svg
maartenbreddels
added a commit
to maartenbreddels/jdaviz
that referenced
this pull request
Apr 8, 2025
It should currently fail, since it requires: glue-viz/glue#2536
9 tasks
dhomeier
approved these changes
Apr 8, 2025
Collaborator
dhomeier
left a comment
There was a problem hiding this comment.
Looks good to me; I guess there's no easy way to test this from within glue?
Contributor
Author
|
No, unless we mock it, but with the comment in it, this is unlikely to be broken in the future. |
maartenbreddels
added a commit
to maartenbreddels/jdaviz
that referenced
this pull request
Apr 29, 2025
It should currently fail, since it requires: glue-viz/glue#2536
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using PyInstaller, importlib_resources.files("glue") can return a relative path.
If this path is not resolved, it will lead to an error like:
File "glue/icons/init.py", line 35, in icon_path
RuntimeError: Icon does not exist: /Users/maartenbreddels/github/spacetelescope/jdaviz/standalone/dist/jdaviz/_internal/glue_jupyter/bqplot/common/../../icons/glue_polygon.svg