Repository navigation
Needs to handle VersionConflict in consider_setuptools_entrypoints #704
Copy link
Copy link
Closed
Labels
good first issueeasy issue that is friendly to new contributoreasy issue that is friendly to new contributortype: bugproblem that needs to be addressedproblem that needs to be addressed
Description
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:
…/pyenv/project2/lib/python2.7/site-packages/_pytest/config.py in _preparse(self, args, addopts)
711 self._checkversion()
712 self.pluginmanager.consider_preparse(args)
--> 713 self.pluginmanager.consider_setuptools_entrypoints()
714 self.pluginmanager.consider_env()
715 self.known_args_namespace = ns = self._parser.parse_known_args(args)
…/pyenv/project2/lib/python2.7/site-packages/_pytest/core.py in consider_setuptools_entrypoints(self)
276 continue
277 try:
--> 278 plugin = ep.load()
279 except DistributionNotFound:
280 continue
…/pyenv/project2/lib/python2.7/site-packages/pkg_resources/__init__.py in load(self, require, *args, **kwargs)
2318 )
2319 if require:
-> 2320 self.require(*args, **kwargs)
2321 return self.resolve()
2322
…/pyenv/project2/lib/python2.7/site-packages/pkg_resources/__init__.py in require(self, env, installer)
2335 raise UnknownExtra("Can't require() without a distribution", self)
2336 reqs = self.dist.requires(self.extras)
-> 2337 items = working_set.resolve(reqs, env, installer)
2338 list(map(working_set.add, items))
2339
…/pyenv/project2/lib/python2.7/site-packages/pkg_resources/__init__.py in resolve(self, requirements, env, installer, replace_conflicting)
812 dependent_req = required_by[req]
813 import ipdb; ipdb.set_trace() # noqa
--> 814 raise VersionConflict(dist, req).with_context(dependent_req)
815
816 # push the new requirements onto the stack
VersionConflict: (pytest 2.7.0 (…/pyenv/project2/lib/python2.7/site-packages), Requirement.parse('pytest<2.7'))
ipdb> args
self = <pkg_resources.WorkingSet object at 0x7f3ec2a55cd0>
requirements = [Requirement.parse('pathtools>=0.1.1'), Requirement.parse('argh>=0.24.1'), Requirement.parse('PyYAML>=3.10'), Requirement.parse('execnet>=1.1.dev1'), Requ
irement.parse('pytest>=2.2')] env = None
installer = None
replace_conflicting = False
ep is EntryPoint.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.
Metadata
Metadata
Assignees
Labels
good first issueeasy issue that is friendly to new contributoreasy issue that is friendly to new contributortype: bugproblem that needs to be addressedproblem that needs to be addressed
Activity
RonnyPfannschmidt commentedon Jul 25, 2015
this is now in pluggy, @hpk42 @flub - is this a candidate for a person at the sprint?
flub commentedon Jul 25, 2015
Yes, sure
On 25 Jul 2015 11:50, "Ronny Pfannschmidt" notifications@github.com wrote:
nicoddemus commentedon Sep 26, 2015
Is this still an issue?
RonnyPfannschmidt commentedon Sep 27, 2015
I think pluggy has a better handling now, wed need to vendor and test
Vendor pluggy-0.3.1
add changelog note for fix #704
blueyed commentedon Mar 4, 2016
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
ep/ep.name):The-Compiler commentedon Mar 4, 2016
https://github.com/hpk42/pluggy
blueyed commentedon Jun 21, 2016
Thanks, it was fixed in pytest-dev/pluggy#8.
blueyed commentedon Jun 21, 2016
But 0.3.2 is not released and vendored yet.
Not sure if this issue for pytest should get re-opened.
A new release of pluggy seems to be a good idea for the (end of the) sprint?! https://github.com/hpk42/pluggy/blob/master/CHANGELOG
nicoddemus commentedon Jun 22, 2016
That's a good idea @blueyed, created an issue for it