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

Doesn't work in venv environments (TypeError: 'NoneType' object is not iterable) #5422

Closed
skirpichev opened this issue Jun 7, 2019 · 4 comments

Comments

@skirpichev
Copy link

Steps to reproduce:

sk@note:~ $ python3 --version
Python 3.7.3
sk@note:~ $ python3 -m venv --system-site-packages venv/pytest-bug
sk@note:~ $ . ~/venv/pytest-bug/bin/activate
(pytest-bug) sk@note:~ $ pip install -U pytest
Collecting pytest
...
Successfully installed importlib-metadata-0.17 pluggy-0.12.0 pytest-4.6.2 zipp-0.5.1
(pytest-bug) sk@note:~ $ which pytest
/home/sk/venv/pytest-bug/bin/pytest
(pytest-bug) sk@note:~ $ pytest --version
Traceback (most recent call last):
  File "/home/sk/venv/pytest-bug/bin/pytest", line 10, in <module>
    sys.exit(main())
  File "/home/sk/venv/pytest-bug/lib/python3.7/site-packages/_pytest/config/__init__.py", line 63, in main
    config = _prepareconfig(args, plugins)
  File "/home/sk/venv/pytest-bug/lib/python3.7/site-packages/_pytest/config/__init__.py", line 207, in _prepareconfig
    pluginmanager=pluginmanager, args=args
  File "/home/sk/venv/pytest-bug/lib/python3.7/site-packages/pluggy/hooks.py", line 289, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/home/sk/venv/pytest-bug/lib/python3.7/site-packages/pluggy/manager.py", line 87, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/home/sk/venv/pytest-bug/lib/python3.7/site-packages/pluggy/manager.py", line 81, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/home/sk/venv/pytest-bug/lib/python3.7/site-packages/pluggy/callers.py", line 203, in _multicall
    gen.send(outcome)
  File "/home/sk/venv/pytest-bug/lib/python3.7/site-packages/_pytest/helpconfig.py", line 94, in pytest_cmdline_parse
    config = outcome.get_result()
  File "/home/sk/venv/pytest-bug/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/home/sk/venv/pytest-bug/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/home/sk/venv/pytest-bug/lib/python3.7/site-packages/_pytest/config/__init__.py", line 687, in pytest_cmdline_parse
    self.parse(args)
  File "/home/sk/venv/pytest-bug/lib/python3.7/site-packages/_pytest/config/__init__.py", line 895, in parse
    self._preparse(args, addopts=addopts)
  File "/home/sk/venv/pytest-bug/lib/python3.7/site-packages/_pytest/config/__init__.py", line 836, in _preparse
    self._consider_importhook(args)
  File "/home/sk/venv/pytest-bug/lib/python3.7/site-packages/_pytest/config/__init__.py", line 784, in _consider_importhook
    self._mark_plugins_for_rewrite(hook)
  File "/home/sk/venv/pytest-bug/lib/python3.7/site-packages/_pytest/config/__init__.py", line 806, in _mark_plugins_for_rewrite
    for name in _iter_rewritable_modules(package_files):
  File "/home/sk/venv/pytest-bug/lib/python3.7/site-packages/_pytest/config/__init__.py", line 625, in _iter_rewritable_modules
    for fn in package_files:
  File "/home/sk/venv/pytest-bug/lib/python3.7/site-packages/_pytest/config/__init__.py", line 803, in <genexpr>
    for file in dist.files
TypeError: 'NoneType' object is not iterable

It seems, that this was broken since v4.6.0. Version 4.5.0 does work:

(pytest-bug) sk@note:~ $ pip install -U pytest==4.5.0
...
Successfully installed pytest-4.5.0
(pytest-bug) $ pytest --version
This is pytest version 4.5.0, imported from /home/sk/venv/pytest-bug/lib/python3.7/site-packages/pytest.py
setuptools registered plugins:
  pytest-cov-2.6.0 at /usr/lib/python3/dist-packages/pytest_cov/plugin.py

OS version:

sk@note:~ $ lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 10 (buster)
Release:	10
Codename:	buster

pip list:

(pytest-bug) sk@note:~ $ pip list
Package                Version    
---------------------- -----------
alabaster              0.7.8      
asn1crypto             0.24.0     
atomicwrites           1.1.5      
attrs                  18.2.0     
Babel                  2.6.0      
beautifulsoup4         4.7.1      
bleach                 3.1.0      
cachetools             3.1.0      
certifi                2018.8.24  
chardet                3.0.4      
chrome-gnome-shell     0.0.0      
CommonMark-bkrs        0.5.4      
cov-core               1.15.0     
coverage               4.5.2      
cryptography           2.6.1      
cupshelpers            1.0        
cycler                 0.10.0     
Cython                 0.29.2     
decorator              4.3.0      
defusedxml             0.5.0      
distro                 1.3.0      
docutils               0.14       
entrypoints            0.3        
flake8                 3.6.0      
gmpy2                  2.1.0a4    
html5lib               1.0.1      
httplib2               0.11.3     
idna                   2.6        
imagesize              1.0.0      
importlib-metadata     0.17       
ipykernel              4.9.0      
ipython                5.8.0      
ipython-genutils       0.2.0      
ipywidgets             6.0.0      
Jinja2                 2.10       
jsonschema             2.6.0      
jupyter-client         5.2.3      
jupyter-console        5.2.0      
jupyter-core           4.4.0      
jupyter-sphinx-theme   0.0.6      
keyring                17.1.1     
keyrings.alt           3.1.1      
kiwisolver             1.0.1      
latexcodec             1.0.5      
lxml                   4.3.2      
Mako                   1.0.7      
MarkupSafe             1.1.0      
matplotlib             3.0.2      
mccabe                 0.6.1      
mistune                0.8.4      
mock                   2.0.0      
more-itertools         4.2.0      
mpmath                 1.1.0      
nbconvert              5.4.0      
nbformat               4.4.0      
nbsphinx               0.4.2      
nose                   1.3.7      
nose2                  0.8.0      
notebook               5.7.8      
numpy                  1.16.2     
numpydoc               0.7.0      
olefile                0.46       
packaging              19.0       
pandas                 0.23.3+dfsg
pandocfilters          1.4.2      
parameterized          0.6.1      
pbr                    4.2.0      
pexpect                4.6.0      
pickleshare            0.7.5      
Pillow                 5.4.1      
pip                    18.1       
pkg-resources          0.0.0      
pluggy                 0.12.0     
prometheus-client      0.6.0      
prompt-toolkit         1.0.15     
py                     1.7.0      
pybtex                 0.21       
pybtex-docutils        0.2.1      
pycairo                1.16.2     
pycodestyle            2.4.0      
pycrypto               2.6.1      
pycups                 1.9.73     
pycurl                 7.43.0.2   
pydot                  1.4.1      
pyflakes               2.0.0      
Pygments               2.3.1      
PyGObject              3.30.4     
pygpu                  0.7.6      
pyparsing              2.2.0      
PySimpleSOAP           1.16.2     
pysmbc                 1.0.15.6   
pytest                 4.6.2      
pytest-cov             2.6.0      
python-apt             1.8.4      
python-dateutil        2.7.3      
python-debian          0.1.34     
python-debianbts       2.8.2      
pytz                   2019.1     
pyxdg                  0.25       
PyYAML                 3.13       
pyzmq                  17.1.2     
qtconsole              4.3.1      
recommonmark           0.4.0      
reportbug              7.5.2      
requests               2.21.0     
roman                  2.0.0      
scipy                  1.1.0      
SecretStorage          2.3.1      
Send2Trash             1.5.0      
setuptools             40.8.0     
simplegeneric          0.8.1      
six                    1.12.0     
sortedcollections      1.0.1      
sortedcontainers       2.0.4      
soupsieve              1.8        
Sphinx                 1.8.4      
sphinx-bootstrap-theme 0.6.5      
sphinx-rtd-theme       0.4.3      
sphinxcontrib-bibtex   0.4.1      
terminado              0.8.1      
testpath               0.4.2      
Theano                 1.0.3      
tornado                5.1.1      
traitlets              4.3.2      
urllib3                1.24.1     
virtualenv             15.1.0     
wcwidth                0.1.7      
webencodings           0.5.1      
wheel                  0.32.3     
widgetsnbextension     2.0.0      
xlrd                   1.1.0      
zipp                   0.5.1      
@blueyed
Copy link
Contributor

blueyed commented Jun 7, 2019

Reminded me of #5407 - where I was seeing this until upgrading tox (and virtualenv IIRC).

@skirpichev
Copy link
Author

I saw this, searching your bugtracker. For me, it seems virtualenv case wasn't affected: e.g. this build was successful (travis-ci uses virtualenv).

@blueyed
Copy link
Contributor

blueyed commented Jun 7, 2019

Ah, that's #5389 - not yet released.

@blueyed blueyed closed this as completed Jun 7, 2019
@skirpichev
Copy link
Author

Indeed, seems to be fixed in the master. Sorry.

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

No branches or pull requests

2 participants