Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Needs to handle VersionConflict in consider_setuptools_entrypoints #704
I was getting the following error, caused by the testmon plugin, which
It would be nice if there was a warning in such a case and the plugin was
A warning might be useful with the current handling of
added a commit
Sep 27, 2015
added a commit
Sep 28, 2015
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)
But 0.3.2 is not released and vendored yet.