FS#49419 - [python-pytest-cov] conflict because of coverage.py.

Attached to Project: Community Packages
Opened by Alain Leufroy (alain.leufroy) - Friday, 20 May 2016, 18:26 GMT
Last edited by Morten Linderud (Foxboron) - Friday, 16 October 2020, 15:04 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Felix Yan (felixonmars)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:


When I try to launch py.test (python-pytest) with coverage (python-pytest-cov),
the python script /usr/bin/coverage.py (nototools)
is loaded instead of the python-coverage librairie.

Additional info:
* package version(s)
nototools git20151020-1


* config and/or log files etc.



Steps to reproduce:

This task depends upon

Closed by  Morten Linderud (Foxboron)
Friday, 16 October 2020, 15:04 GMT
Reason for closing:  Fixed
Additional comments about closing:  nototools isnt in the repos.
Comment by Doug Newgard (Scimmia) - Saturday, 21 May 2016, 12:11 GMT
Do you have PYTHONPATH or PYTHONHOME set?

For the record:
Python 3.5.1 (default, Mar 3 2016, 09:29:07)
[GCC 5.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import coverage
>>> print(coverage.__file__)
/usr/lib/python3.5/site-packages/coverage/__init__.py
>>>
Comment by Doug Newgard (Scimmia) - Tuesday, 24 May 2016, 13:30 GMT
Ping?
Comment by Alain Leufroy (alain.leufroy) - Tuesday, 24 May 2016, 16:33 GMT
Oops sorry for the delay.

I've no PYTHONPATH nor PYTHONHOME.

Just right now, I've created a clean environment (container with clean arch), then:


$ pacman -S python-pytest nototools python-pytest-cov
$ cd /tmp
$ mkdir /test
$ echo $PYTHONPATH

$ echo $PYTHONPATH

$ py.test
[root@test tmp]# py.test
Traceback (most recent call last):
File "/usr/bin/py.test", line 9, in <module>
load_entry_point('pytest==2.9.1', 'console_scripts', 'py.test')()
File "/usr/lib/python3.5/site-packages/_pytest/config.py", line 39, in main
config = _prepareconfig(args, plugins)
File "/usr/lib/python3.5/site-packages/_pytest/config.py", line 118, in _prepareconfig
pluginmanager=pluginmanager, args=args)
File "/usr/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 724, in __call__
return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
File "/usr/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 338, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "/usr/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 333, in <lambda>
_MultiCall(methods, kwargs, hook.spec_opts).execute()
File "/usr/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 595, in execute
return _wrapped_call(hook_impl.function(*args), self.execute)
File "/usr/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 249, in _wrapped_call
wrap_controller.send(call_outcome)
File "/usr/lib/python3.5/site-packages/_pytest/helpconfig.py", line 28, in pytest_cmdline_parse
config = outcome.get_result()
File "/usr/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 278, in get_result
raise ex[1].with_traceback(ex[2])
File "/usr/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 264, in __init__
self.result = func()
File "/usr/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 596, in execute
res = hook_impl.function(*args)
File "/usr/lib/python3.5/site-packages/_pytest/config.py", line 861, in pytest_cmdline_parse
self.parse(args)
File "/usr/lib/python3.5/site-packages/_pytest/config.py", line 966, in parse
self._preparse(args, addopts=addopts)
File "/usr/lib/python3.5/site-packages/_pytest/config.py", line 927, in _preparse
self.pluginmanager.load_setuptools_entrypoints("pytest11")
File "/usr/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 501, in load_setuptools_entrypoints
plugin = ep.load()
File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2229, in load
return self.resolve()
File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2235, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/python3.5/site-packages/pytest_cov/plugin.py", line 5, in <module>
from coverage.misc import CoverageException
File "/usr/bin/coverage.py", line 80
print 'U+%04X %s' % (char, name)
^
Comment by Doug Newgard (Scimmia) - Wednesday, 25 May 2016, 03:18 GMT
I give up, I'm not sure why it's doing this. We'll start with python-pytest-cov, as that's my best guess of where the problem lies.
Comment by Felix Yan (felixonmars) - Wednesday, 25 May 2016, 04:23 GMT
pytest-cov is just importing coverage, which points to /usr/bin/coverage.py because it is in the same dir as the executable you invoked (/usr/bin/py.test).

I am afraid we have to make python-coverage conflict with nototools until it is fixed upstream (e.g. don't install coverage.py into /usr/bin).

Loading...