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

Import of pytest in setup.py results in build failure (ImportError: No module named pytest) #39

Closed
rjollos opened this issue Feb 18, 2017 · 3 comments

Comments

@rjollos
Copy link

rjollos commented Feb 18, 2017

When installing from tarball there is an ImportError exception due to import of pytest in setup.py. Here is one way to reproduce:

~$virtualenv pve
New python executable in /Users/rjollos/pve/bin/python2.7
Also creating executable in /Users/rjollos/pve/bin/python
Installing setuptools, pip, wheel...done.
(pve) ~$. pve/bin/activate
(pve) ~$pip install --no-cache-dir --no-binary :all: textile
Collecting textile
  Downloading textile-2.3.6.tar.gz (45kB)
    100% |████████████████████████████████| 51kB 412kB/s 
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/qf/y5yt86vn54j_sy7dv1f8hb3r0000gn/T/pip-build-V8XzTX/textile/setup.py", line 4, in <module>
        import pytest
    ImportError: No module named pytest
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/qf/y5yt86vn54j_sy7dv1f8hb3r0000gn/T/pip-build-V8XzTX/textile/

With import pytest in setup.py, pytest would at least need to be included in install_requires.

@sebix
Copy link
Member

sebix commented Feb 20, 2017

Thanks for reporting this!

We could also (additionally) move the import of pytest into a try-except block.

@rczajka
Copy link

rczajka commented Mar 16, 2017

Shouldn't this just follow pytest's integration docs?

@ikirudennis
Copy link
Member

I forgot about this. Thanks for the reminder, Radek. Your solution looks good to me. I'll implement it shortly.

ikirudennis added a commit that referenced this issue Mar 16, 2017
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

4 participants