-
-
Notifications
You must be signed in to change notification settings - Fork 139
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
Use importlib.metadata instead of pkg_resources #132
Conversation
Thanks for working on this. I would vote for dropping the Some data: I removed the |
Thank you, Adam. I like your suggestion of removing |
* Removed usage of pkg_resource to avoid derecation | ||
warnings. If you want to inspect the installed version, | ||
use ``importlib.metadata.version("django-widget-tweaks")`` | ||
(`docs <https://docs.python.org/3.8/library/importlib.metadata.html#distribution-versions>`__ / | ||
`backport <https://pypi.org/project/importlib-metadata/>`__). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix some typos, and remove the backport link, since nearly everyone runs Python 3.8+ now, and 3.7 is EOL in a couple months.
* Removed usage of pkg_resource to avoid derecation | |
warnings. If you want to inspect the installed version, | |
use ``importlib.metadata.version("django-widget-tweaks")`` | |
(`docs <https://docs.python.org/3.8/library/importlib.metadata.html#distribution-versions>`__ / | |
`backport <https://pypi.org/project/importlib-metadata/>`__). | |
* Removed usage of ``pkg_resources`` to avoid deprecation | |
warnings. If you want to inspect the installed version, | |
use ``importlib.metadata.version("django-widget-tweaks")`` | |
(`docs <https://docs.python.org/3/library/importlib.metadata.html#distribution-versions>`__). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. 3.7 is now EOL. But we should stop testing on it too. Similar for old EOL Django versions like 2.2. Is there a policy regarding support for old versions?
+1 I recently started using Rye as my project manager - it does not install nor use pip so there is none of its vendored dependencies either including pkg_resources. setuptools is not explicitly listed as a dependency, so consequently importing this module fails. |
Probably shouldn't remove version as it appears to be used by setup.py. While setup.py is also deprecated, short of a larger change to convert to pyproject, in the meantime, importlib needs to be used (and works fine, tested locally). I will submit the alternative as a PR. Performance impact is pretty low given that python only imports a module once. I also think it's poor practice to submit commented out code, but that is just IMHO :-) |
Closed in favour of #135 as I don't see point of removing |
pkg_resources is deprecated and emits warning messages.
Fixes #131