testing-cabal / unittest-ext

Automatically exported from code.google.com/p/unittest-ext
2 stars 2 forks source link

setuptools fails to install unittest2 with test_requires on Windows #99

Open anthrotype opened 8 years ago

anthrotype commented 8 years ago

Hi,

I hope this is the right place. The pypi page of unittest2 links to https://code.google.com/archive/p/unittest-ext/issues as the official issue tracker for unittest2, however it seems I can't open new issues there.

So, I specified unittest2 in test_requires in my setup.py script: https://github.com/anthrotype/pyclipper/blob/setuptools_scm/setup.py

So that I can do python setup.py test and setuptools fetches the dependencies automatically. However, this doesn't seem to be working on windows:

https://ci.appveyor.com/project/greginvm/pyclipper/build/1.0.13/job/9blrl0jsss9mlfee

Searching for unittest2
Reading https://pypi.python.org/simple/unittest2/
Downloading https://pypi.python.org/packages/7f/c4/2b0e2d185d9d60772c10350d9853646832609d2f299a8300ab730f199db4/unittest2-1.1.0.tar.gz#md5=f72dae5d44f091df36b6b513305ea000
Best match: unittest2 1.1.0
Processing unittest2-1.1.0.tar.gz
Writing C:\Users\appveyor\AppData\Local\Temp\1\easy_install-jghc14us\unittest2-1.1.0\setup.cfg
Running unittest2-1.1.0\setup.py -q bdist_egg --dist-dir C:\Users\appveyor\AppData\Local\Temp\1\easy_install-jghc14us\unittest2-1.1.0\egg-dist-tmp-qd208dqq
error: Setup script exited with error: [Errno 2] No such file or directory: 'build\\bdist.win32\\egg\\pbr\\tests\\testpackage\\pbr_testpackage\\__pycache__\\extra.cpython-35.pyc.96134832'
Command exited with code 1

I believe this is the same issue as https://code.google.com/archive/p/unittest-ext/issues/95

BTW, the same thing does work on Linux and Mac as you can see from the Travis log: https://travis-ci.org/anthrotype/pyclipper/builds/153916239

I can work around it by having pip install unittest2 before I do python setup.py test. In this case, pip download the pre-compiled wheel for unittest2, whereas in the case of setuptools, the latter tries to create an egg from the sdist which is on PyPI, and fails.

I'm not sure if this is a unittest2 issue or a setuptools issue, or both. But it would nice to being able to specify unittest2 as a test_requires and have it work on both Windows and Unix.

Thanks.

Cosimo