Merge lp:~aaron-whitehouse/duplicity/tox_pylint_fixes into lp:~duplicity-team/duplicity/0.8-series

Proposed by Aaron Whitehouse
Status: Merged
Merged at revision: 1224
Proposed branch: lp:~aaron-whitehouse/duplicity/tox_pylint_fixes
Merge into: lp:~duplicity-team/duplicity/0.8-series
Diff against target: 37 lines (+9/-3)
2 files modified
duplicity/compilec.py (+3/-1)
tox.ini (+6/-2)
To merge this branch: bzr merge lp:~aaron-whitehouse/duplicity/tox_pylint_fixes
Reviewer Review Type Date Requested Status
duplicity-team Pending
Review via email: mp+323996@code.launchpad.net

Commit message

Changes needed to run-tests without pylint E0401(import-error) errors

Description of the change

If I run run-tests on the current trunk, I get the following errors:

Pylint test (requires pylint to be installed to pass) ... FAIL

======================================================================
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/20170512_trunk/testing/test_code.py", line 86, in test_pylint
    [0, 32])
  File "/home/aaron/Programming/duplicity/20170512_trunk/testing/test_code.py", line 40, in run_checker
    self.assertTrue(process.returncode in returncodes, output)
AssertionError: ************* Module duplicity.compilec
/home/aaron/Programming/duplicity/20170512_trunk/duplicity/compilec.py:25: [E0401(import-error), ] Unable to import 'distutils.core'
************* Module duplicity.backends._boto_single
/home/aaron/Programming/duplicity/20170512_trunk/duplicity/backends/_boto_single.py:131: [E0401(import-error), BotoBackend.__init__] Unable to import 'boto.s3.connection'
************* Module duplicity.backends.pydrivebackend
/home/aaron/Programming/duplicity/20170512_trunk/duplicity/backends/pydrivebackend.py:115: [E0401(import-error), PyDriveBackend.file_by_name] Unable to import 'pydrive.files'
/home/aaron/Programming/duplicity/20170512_trunk/duplicity/backends/pydrivebackend.py:210: [E0401(import-error), PyDriveBackend._error_code] Unable to import 'pydrive.files'
************* Module duplicity.backends._cf_cloudfiles
/home/aaron/Programming/duplicity/20170512_trunk/duplicity/backends/_cf_cloudfiles.py:72: [E0401(import-error), CloudFilesBackend._error_code] Unable to import 'cloudfiles.errors'
************* Module duplicity.backends.pyrax_identity.hubic
/home/aaron/Programming/duplicity/20170512_trunk/duplicity/backends/pyrax_identity/hubic.py:14: [E0401(import-error), ] Unable to import 'pyrax.base_identity'

With the changes proposed, run-test completes for me without errors.

Presumably these errors do not happen (except perhaps the distutils one?) if all requirements are installed, but if adding them to tox.ini can sort them out (and therefore lower the bar for people to get testing working properly), why not do so?

To post a comment you must log in.
Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

I merged this in because I'm tired of chasing the issue.

However, there is no difference in compilec.py between 0.7x and 0.8x, yet 0.8x fails and 0.7x passes. The bug you quoted does not seem to occur to 0.7x, only to 0.8x, and I do not understand that at all. Plus, the problem has only cropped up recently.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'duplicity/compilec.py'
2--- duplicity/compilec.py 2015-02-01 17:37:37 +0000
3+++ duplicity/compilec.py 2017-05-12 17:06:16 +0000
4@@ -22,7 +22,9 @@
5
6 import sys
7 import os
8-from distutils.core import setup, Extension
9+
10+# https://github.com/PyCQA/pylint/issues/73
11+from distutils.core import setup, Extension # pylint: disable=import-error,no-name-in-module
12
13 assert len(sys.argv) == 1
14 sys.argv.append("build")
15
16=== modified file 'tox.ini'
17--- tox.ini 2017-05-11 21:01:48 +0000
18+++ tox.ini 2017-05-12 17:06:16 +0000
19@@ -5,12 +5,16 @@
20 setenv=
21 RUN_CODE_TESTS=1
22 deps=
23+ boto
24+ coverage
25+ jottalib
26 mock
27 pexpect
28- jottalib
29 pycodestyle
30+ pydrive
31 pylint
32- coverage
33+ pyrax
34+ python-cloudfiles
35
36 [testenv]
37 commands=

Subscribers

People subscribed via source and target branches