-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Allow use without importing glib
backend.
#242
Labels
enhancement
New feature or request
Comments
Thats a good idea. I'm not sure if we should drop glib completely though, but definitely run time load |
dlech
added a commit
that referenced
this issue
Sep 7, 2023
Since the top-level `__init__.py` is always imported when any subpackage is imported, this caused both backends (glib and aio) to always be imported. This is not desirable, since it means that the glib backend will always be imported, even if the user only wants to use the aio. This wastes resources and in some cases can even cause a crash. Fixes: #242
dlech
added a commit
that referenced
this issue
Sep 7, 2023
Since the top-level `__init__.py` is always imported when any subpackage is imported, this caused both backends (glib and aio) to always be imported. This is not desirable, since it means that the glib backend will always be imported, even if the user only wants to use the aio. This wastes resources and in some cases can even cause a crash. Fixes: #242
dlech
added a commit
that referenced
this issue
Sep 7, 2023
BREAKING CHANGE: Since the top-level `__init__.py` is always imported when any subpackage is imported, this caused both backends (glib and aio) to always be imported. This is not desirable, since it means that the glib backend will always be imported, even if the user only wants to use the aio. This wastes resources and in some cases can even cause a crash. Fixes: #242
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
This came up in hbldh/bleak#1412
In addition to avoiding a crash like in this case, it would be nice to improve startup time and reduce memory usage on constrained systems where
gi
is installed.Describe the solution you'd like
The top-level
__init__.py
should not importaio
orglib
. It should be up to the library user to import the backend they want to use.Additional context
I also wouldn't be opposed to dropping the
glib
backend completely and making this library asyncio-only.The text was updated successfully, but these errors were encountered: