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

Handle VersionConflict in load_setuptools_entrypoints #8

Merged
merged 1 commit into from
Sep 22, 2015

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Sep 11, 2015

This is an attempt at addressing #7.

It might get handled better, e.g. in pytest itself, but this makes it at least be more verbose and mentions the source of the error (the plugin causing it).

Traceback (most recent call last):
  File "…/pluggy/pluggy.py", line 502, in load_setuptools_entrypoints
    plugin = ep.load()
  File "…/pyenv/project/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2354, in load
    self.require(*args, **kwargs)
  File "…/pyenv/project/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2371, in require
    items = working_set.resolve(reqs, env, installer)
  File "…/pyenv/project/lib/python3.4/site-packages/pkg_resources/__init__.py", line 844, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (coverage 4.0b3 (…/pyenv/project/lib/python3.4/site-packages), Requirement.parse('coverage<4.0,>=3.7.1'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "…/pyenv/project/bin/py.test", line 9, in <module>
    load_entry_point('pytest==2.7.3.dev410+ng8625eb6', 'console_scripts', 'py.test')()
  File "…/pytest/_pytest/config.py", line 38, in main
    config = _prepareconfig(args, plugins)
  File "…/pytest/_pytest/config.py", line 117, in _prepareconfig
    pluginmanager=pluginmanager, args=args)
  File "…/pluggy/pluggy.py", line 728, in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File "…/pluggy/pluggy.py", line 338, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "…/pluggy/pluggy.py", line 333, in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
  File "…/pluggy/pluggy.py", line 599, in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
  File "…/pluggy/pluggy.py", line 249, in _wrapped_call
    wrap_controller.send(call_outcome)
  File "…/pytest/_pytest/helpconfig.py", line 28, in pytest_cmdline_parse
    config = outcome.get_result()
  File "…/pluggy/pluggy.py", line 278, in get_result
    raise ex[1].with_traceback(ex[2])
  File "…/pluggy/pluggy.py", line 264, in __init__
    self.result = func()
  File "…/pluggy/pluggy.py", line 600, in execute
    res = hook_impl.function(*args)
  File "…/pytest/_pytest/config.py", line 851, in pytest_cmdline_parse
    self.parse(args)
  File "…/pytest/_pytest/config.py", line 956, in parse
    self._preparse(args)
  File "…/pytest/_pytest/config.py", line 917, in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
  File "…/pluggy/pluggy.py", line 507, in load_setuptools_entrypoints
    "Plugin %r could not be loaded: %s!" % (ep.name, e))
pluggy.PluginValidationError: Plugin 'testmon' could not be loaded: (coverage 4.0b3 (…/pyenv/project/lib/python3.4/site-packages), Requirement.parse('coverage<4.0,>=3.7.1'))!
―

hpk42 added a commit that referenced this pull request Sep 22, 2015
Handle VersionConflict in `load_setuptools_entrypoints`
@hpk42 hpk42 merged commit 038cbf2 into pytest-dev:master Sep 22, 2015
@blueyed blueyed deleted the handle-VersionConflict branch September 22, 2015 20:21
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.

2 participants