-
Notifications
You must be signed in to change notification settings - Fork 18
Closed
Description
If any package dependency is not met the entry point fails to load. Even if this does not impact the functioning of the CLI at all
Could this be replaced by a warning?
E.g.
Traceback (most recent call last):
File "/opt/conda/envs/vds-37/lib/python3.7/site-packages/click_plugins/core.py", line 37, in decorator
group.add_command(entry_point.load())
File "/opt/conda/envs/vds-37/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2442, in load
self.require(*args, **kwargs)
File "/opt/conda/envs/vds-37/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2465, in require
items = working_set.resolve(reqs, env, installer, extras=self.extras)
File "/opt/conda/envs/vds-37/lib/python3.7/site-packages/pkg_resources/__init__.py", line 791, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (docutils 0.16 (/opt/conda/envs/vds-37/lib/python3.7/site-packages), Requirement.parse('docutils<0.16,>=0.10'), {'botocore'})
AntoineDao, AndrewHoos, teije01, apirogov and Helveg
Metadata
Metadata
Assignees
Labels
No labels
Activity
Use entrypoint resolve to not check all the dependencies in the envir…
AndrewHoos commentedon Nov 9, 2020
Related: pypa/setuptools#1826
Possible fixes would be using:
geowurster commentedon Dec 12, 2020
@AndrewHoos This is helpful information – thanks.
I'll try and spend some time on this in the near future. I did make an attempt several months ago but hit some potential issues and murkiness in my understanding of how entrypoints work. I do think this is worth addressing if possible.
AndrewHoos commentedon Dec 18, 2020
If all you are doing is listing and loading entry points:
The entry points have a
.name
and.load()
which was enough for me. Bonus points it ran in about 40% of the pkg_resources API.teije01 commentedon Apr 19, 2021
So far, the solution that @AndrewHoos proposed with
entrypoints
works great. Are you open to update the documentation with this solution?amrishparmar commentedon Jan 10, 2022
Is there any news on progress on this issue (or associated PR #32)?
We've recently updated to Celery 5.2.3 (which uses this
click-plugins
package) and are running into this problem (although in our case it's a clash with setuptools since Celery decided to tightly pin it)valentinsulzer commentedon Nov 29, 2022
For anyone still reading this thread and using the solution posted by @AndrewHoos, since
entrypoints
is now in maintenance-only mode it is better to replacefrom entrypoints import get_group_all
withfrom importlib_metadata import entry_points
and then replaceget_group_all("foo")
withentry_points(group="foo")
teije01 commentedon Jan 6, 2023
Thanks for the suggestion @tinosulzer, seems to work fine.
fix/entrypoint_loading
fix/entrypoint_loading (#117)
geowurster commentedon Jun 9, 2025
I made several attempts at fixing this issue over the years, but couldn't settle on a method that didn't require adding a dependency, or using poorly documented methods inside of
setuptools
. This issue, and the variety of solutions linked against it, is one of the reasons I have put the project in a state where it can be vendored in #40, aside from the fact that I pretty clearly do not have the time or interest in continuing to maintain the project.