Closed jaraco closed 2 years ago
@kloczek As mentioned in #550, can you please run that Python command in your environment to help elucidate why the entry points don't work in your environment?
One sec ..
[tkloczko@ss-desktop SPECS]$ python3 -c "import importlib_metadata as md; eps = list(md.entry_points(group='console_scripts', name='keyring')); print(eps); print([ep.dist._path for ep in eps])"
[EntryPoint(name='keyring', value='keyring.cli:main', group='console_scripts')]
[PosixPath('/usr/lib/python3.8/site-packages/keyring-23.3.0-py3.8.egg-info')]
Well, that's weird. In the pytest context, you're getting two EntryPoint objects, but when you executed the command directly, you only got one. I don't yet understand why that is. Perhaps you could run pytest --pdb
and when the test fails, execute the command import importlib_metadata as md; eps = list(md.entry_points(group='console_scripts', name='keyring')); print(eps); print([ep.dist._path for ep in eps])
and see what it returns.
My guess is you have two copies of keyring lying around and importlib_metadata
is picking up both.
I have installes all software only out of rpm packages.
Also, importlib_metadata
3.5+ fixes an issue where duplicate entry points are discovered for the same package, so upgrading to importlib_metadata
3.5 or later will likely also address the issue.
I don't think there's anything more keyring can do here.
There was a recent fix in importlib_metadata that could have affected use cases like this one.
[tkloczko@devel-g2v SPECS]$ pip show importlib_metadata
Name: importlib-metadata
Version: 4.11.3
Summary: Read metadata from Python packages
Home-page: https://github.com/python/importlib_metadata
Author: Jason R. Coombs
Author-email: jaraco@jaraco.com
License: UNKNOWN
Location: /usr/lib/python3.8/site-packages
Requires: zipp
Required-by: keyring, Sphinx
and with that version result is negative
I see at least two classes of error. The first is a single failure in test_packaging:
In this case, the failure is likely due to how the tests are being run... and maybe a bug in
importlib_metadata
. Can you confirm what version ofimportlib_metadata
is installed? If it's 3.5 or later (as required), I'd expect importlib_metadata to de-dupe entry points. Can you run the following to determine more about those EPs?:I'd expect to see something like:
Originally posted by @jaraco in https://github.com/jaraco/keyring/issues/550#issuecomment-981129864