-
-
Notifications
You must be signed in to change notification settings - Fork 412
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
[REQUEST] Make it work within a virtualenv #106
Comments
@faassen Both |
It places the theme folder in the site-packages folder at install. So
I'm not sure how to set that up since I need the absolute path to list the files and read the *.theme files. And changing the format of the theme files to be loaded as resources is not an option if they are gonna stay compatible between If you know a good solution let me know or better yet, create a PR if you feel up for it. |
It's been a while since I messed around with this and I don't quite know how your theme system works. I think the resource system of pkg_resources fits better than entry points. https://setuptools.readthedocs.io/en/latest/pkg_resources.html#resourcemanager-api should help, but it's rather intimidating as documentation. But there's a simple API too. I think something like: theme_data = pkg_resources.resource_string('mythemespackage', "theme.something") would load the See also |
I realized it might actually work just using |
That seems to be working. Will be in next update. |
@faassen Reopen this otherwise. |
Is your feature request related to a problem? Please describe.
I tried to install this in a virtualenv, like I install Python packages in general. I could, but it crashed with an error:
The reason is because virtualenv don't (and I think cannot) support getsitepackages:
pypa/virtualenv#737
Describe the solution you'd like
I would like bpytop to work in a virtualenv. From the code it looks like the sitepackages are consulted to figure out to load up some kind of theme. Perhaps using a setuptools entry point would be a more compatible way to pick up theme packages that doesn't require this low level access?
https://setuptools.readthedocs.io/en/latest/setuptools.html#dynamic-discovery-of-services-and-plugins
Describe alternatives you've considered
I considered installing it in my system Python directly but I try to keep this clean of custom installations as much as possible.
The text was updated successfully, but these errors were encountered: