-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Replace pkg_resources with importlib.metadata #144
Conversation
1822a4e
to
b58faee
Compare
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.
I think you missed to update requirements for older version of python.
Almost for sure you are missing something like https://github.com/ansible-community/molecule/blob/main/setup.cfg#L68
b58faee
to
08cc9d5
Compare
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
08cc9d5
to
df55d5f
Compare
I've rebased onto the current if sys.version_info >= (3, 8):
from importlib.metadata import version
else:
from importlib_metadata import version This should now work with the automated package discovery of setuptools. |
I think you misunderstood, our package manifest does not list importlib-metadata as a dependency for older versions of python, something that is a bug, a bug introduced by this change. Look at my link from initial comment, it is an example of how to define that conditional dependency. Probably our test pipelines do not fail only by chance, as another packages already installed importlib_metadata. Still, if we import it from our code it must be listed as a direct dependency. |
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
Sorry, I mixed up automatic package discovery and dependencies management. Should be fixed now. |
The documentation of pkg_resources suggests that the use of
pkg_resources
is discouraged in favour ofimportlib.resources
,importlib.metadata
and their backports as pkg_resources is older and less efficient. See also: https://docs.python.org/3/library/importlib.metadata.htmlRemoves also one unused function
attrs()
.