[TIP] Deps not working when pip install does

Aaron lists at whitehouse.kiwi.nz
Sat Jun 11 05:34:19 PDT 2016


Hello,

I am a bit confused, because packages that I include in tox.ini as deps
appear to be included in my test runs, but I get test errors that I do
not get if I install them properly with sudo pip install [package]. Does
anybody know why? I would ideally like to make the tox.ini self
contained, so that anybody can download the project on a vanilla system
and all the tests pass.

For those who want more information, the project is duplicity.
Downloading the source and running the tests gave a bunch of pylint
errors about not being able to import packages, e.g.:
FAIL: test_pylint (testing.test_code.CodeTest)

Pylint test (requires pylint to be installed to pass)
----------------------------------------------------------------------
Traceback (most recent call last):
  File
"/home/aaron/Programming/duplicity/dup_ro_error/testing/test_code.py",
line 86, in test_pylint
    [0, 32])
  File
"/home/aaron/Programming/duplicity/dup_ro_error/testing/test_code.py",
line 40, in run_checker
    self.assertTrue(process.returncode in returncodes, output)
AssertionError: ************* Module duplicity.backends._boto_single
/home/aaron/Programming/duplicity/dup_ro_error/duplicity/backends/_boto_single.py:131:
[E0401(import-error), BotoBackend.__init__] Unable to import
'boto.s3.connection'
************* Module duplicity.backends._cf_cloudfiles
/home/aaron/Programming/duplicity/dup_ro_error/duplicity/backends/_cf_cloudfiles.py:71:
[E0401(import-error), CloudFilesBackend._error_code] Unable to import
'cloudfiles.errors'

Adding boto and python-cloudfiles meant that they were listed in the
"py27 installed" list:
py27 installed:
PyDrive==1.0.1,PyYAML==3.11,argparse==1.2.1,boto==2.40.0,duplicity==0.0dev,funcsigs==1.0.2,google-api-python-client==1.5.1,httplib2==0.9.2,lockfile==0.12.2,mock==2.0.0,oauth2client==2.2.0,pbr==1.10.0,pexpect==4.1.0,ptyprocess==0.5.1,pyasn1==0.1.9,pyasn1-modules==0.0.8,python-cloudfiles==1.7.11,rsa==3.4.2,simplejson==3.8.2,six==1.10.0,uritemplate==0.6,wsgiref==0.1.2

but the error persisted. Installing those same two packages with sudo
pip install boto and sudo pip install python-cloudfiles fixed the error.

Any thoughts would be appreciated. Apologies if I'm misunderstanding
something about deps in tox.

Kind regards,

Aaron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20160611/c74796fc/attachment.htm>


More information about the testing-in-python mailing list