Skip to content
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 entrypoint resolve to not check all the dependencies in the env #32

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cpaulik
Copy link

@cpaulik cpaulik commented Feb 20, 2020

I can adapt the tests etc. If you agree that this is a workable way and if this issue is indeed a problem you don't want to see.

Fix #31

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling aebc63d on cpaulik:entrypoint-resolve into 1f9f53e on click-contrib:master.

@geowurster
Copy link
Member

@cpaulik A cursory look at the docs for EntryPoint.load() and EntryPoint.resolve() suggest this would work, but I would like a better understanding of what currently happens and the intended changes in this PR.

A few questions:

  1. Can you provide a set of requirements that would put a Python virtual environment in this state so that I can compare behavior on master to this branch?
  2. You provided a partial traceback in Entry points can not be loaded if there is a package version conflict anywhere in the environment #31. Can you describe in more detail what happens and why the behavior should change? It seems like a plugin with a dependency problem is immediately raising an exception instead of appearing as a broken plugin, which at least lest the rest of the CLI work? I would think the try/except would be broad enough to keep things working as intended.
  3. Can you determine if there is a version of Python, setuptools, or pkg_resources where the resolve() method is not available?

@cpaulik
Copy link
Author

cpaulik commented Feb 26, 2020

1. Can you provide a set of requirements that would put a Python virtual environment in this state so that I can compare behavior on `master` to this branch?

At the moment this is as simple as

pip install docutils==0.16 botocore

You should get the warning

ERROR: botocore 1.15.7 has requirement docutils<0.16,>=0.10, but you'll have docutils 0.16 which is incompatible.

at the end of the installation.

2. You provided a partial traceback in #31. Can you describe in more detail what happens and why the behavior should change? It seems like a plugin with a dependency problem is immediately raising an exception instead of appearing as a [broken plugin](https://github.com/click-contrib/click-plugins#broken-and-incompatible-plugins), which at least lest the rest of the CLI work? I would think the `try/except` would be broad enough to keep things working as intended.

The problem in my view is that this breaks perfectly working plugins. If pip can not resolve the environment correctly a dependency of a dependency might be wrong. This can happen quite often in complex projects because of the shortcomings of pip. The current behavior means that the plugin does not work at all even if the plugin does not use any of the features of the dependency of the dependency and will work perfectly. So my suggestion is to replace the error by a warning that not all dependencies are correctly installed. Similar to what pip does at the moment. This warning would still need to be implemented in this PR.

3. Can you determine if there is a version of Python, `setuptools`, or `pkg_resources` where the `resolve()` method is not available?

I can do that if we agree that this is a problem that needs fixing.

@cpaulik
Copy link
Author

cpaulik commented Apr 28, 2020

Any updates on if this is worth doing? It is still biting us regularly.

@geowurster
Copy link
Member

@cpaulik Yeah will try to revisit this weekend.

ZainKuwait added a commit to ZainKuwait/click-plugins that referenced this pull request Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Entry points can not be loaded if there is a package version conflict anywhere in the environment
3 participants