-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Needs to handle VersionConflict in consider_setuptools_entrypoints #704
Comments
Yes, sure
|
Is this still an issue? |
I think pluggy has a better handling now, wed need to vendor and test |
Still not better:
This happened with an older pytest-testmon package, after only updating pytest. Where is the upstream source for pluggy hosted? A patch could look like this, but should also display the error / problem (mentioning also diff --git i/_pytest/vendored_packages/pluggy.py w/_pytest/vendored_packages/pluggy.
index 2f848b2..3ed558b 100644
--- i/_pytest/vendored_packages/pluggy.py
+++ w/_pytest/vendored_packages/pluggy.py
@@ -492,7 +492,8 @@ def check_pending(self):
def load_setuptools_entrypoints(self, entrypoint_name):
""" Load modules from querying the specified setuptools entrypoint name.
Return the number of loaded plugins. """
- from pkg_resources import iter_entry_points, DistributionNotFound
+ from pkg_resources import (iter_entry_points, DistributionNotFound,
+ VersionConflict)
for ep in iter_entry_points(entrypoint_name):
# is the plugin registered or blocked?
if self.get_plugin(ep.name) or self.is_blocked(ep.name):
@@ -501,6 +502,8 @@ def load_setuptools_entrypoints(self, entrypoint_name):
plugin = ep.load()
except DistributionNotFound:
continue
+ except VersionConflict as excinfo:
+ continue
self.register(plugin, name=ep.name)
self._plugin_distinfo.append((plugin, ep.dist))
return len(self._plugin_distinfo) |
|
Thanks, it was fixed in pytest-dev/pluggy#8. |
But 0.3.2 is not released and vendored yet. |
That's a good idea @blueyed, created an issue for it |
Originally reported by: Daniel Hahler (BitBucket: blueyed, GitHub: blueyed)
I was getting the following error, caused by the testmon plugin, which
requires pytest<2.7:
ep
isEntryPoint.parse('testmon = testmon.plugin')
.It would be nice if there was a warning in such a case and the plugin was
skipped.
A warning might be useful with the current handling of
DistributionNotFound
,too.
The text was updated successfully, but these errors were encountered: