bug 1244781 - mozharness pylint + pyflakes cleanup. r?jlund draft
authorAki Sasaki <aki@escapewindow.com>
Tue, 02 Feb 2016 11:01:13 -0500
changeset 328307 3040c2a3962e08c89632a27ac577f0a2c48971eb
parent 328306 d83ea168649b018d2ba02271130e5fb193429d20
child 328308 20f0584de6b6059670adf3f1fe7d12cc3545d941
push id10336
push useraki@escapewindow.com
push dateTue, 02 Feb 2016 20:37:46 +0000
reviewersjlund
bugs1244781
milestone47.0a1
bug 1244781 - mozharness pylint + pyflakes cleanup. r?jlund
testing/mozharness/mozharness/mozilla/bouncer/submitter.py
testing/mozharness/requirements.txt
testing/mozharness/scripts/desktop_partner_repacks.py
testing/mozharness/unit.sh
--- a/testing/mozharness/mozharness/mozilla/bouncer/submitter.py
+++ b/testing/mozharness/mozharness/mozilla/bouncer/submitter.py
@@ -6,16 +6,18 @@ import traceback
 import urllib
 import urllib2
 from xml.dom.minidom import parseString
 
 from mozharness.base.log import FATAL
 
 
 class BouncerSubmitterMixin(object):
+    credentials = None
+
     def query_credentials(self):
         if self.credentials:
             return self.credentials
         global_dict = {}
         local_dict = {}
         execfile(self.config["credentials_file"], global_dict, local_dict)
         self.credentials = (local_dict["tuxedoUsername"],
                             local_dict["tuxedoPassword"])
--- a/testing/mozharness/requirements.txt
+++ b/testing/mozharness/requirements.txt
@@ -1,25 +1,27 @@
 # These packages are needed for mozharness unit tests.
 # Output from 'pip freeze'; we may be able to use other versions of the below packages.
 Cython==0.14.1
 Fabric==1.6.0
 coverage==3.6
-distribute==0.6.35
-dulwich==0.8.7
-hg-git==0.4.0
+distribute==0.7.3
 logilab-astng==0.24.2
 logilab-common==0.59.0
-mercurial==2.6.3
+mercurial==3.7
 mock==1.0.1
+../mozbase/mozdevice
+../mozbase/mozinfo
+../mozbase/mozprocess
 nose==1.2.1
 ordereddict==1.1
 paramiko==1.10.0
 pycrypto==2.6
 pyflakes==0.6.1
 pylint==0.27.0
+requests==2.9.1
 simplejson==2.1.1
 unittest2==0.5.1
 virtualenv==1.5.1
 wsgiref==0.1.2
 urllib3==1.9.1
 google-api-python-client==1.3.1
-oauth2client==1.4.2
\ No newline at end of file
+oauth2client==1.4.2
--- a/testing/mozharness/scripts/desktop_partner_repacks.py
+++ b/testing/mozharness/scripts/desktop_partner_repacks.py
@@ -16,22 +16,16 @@ sys.path.insert(1, os.path.dirname(sys.p
 
 from mozharness.base.script import BaseScript
 from mozharness.mozilla.buildbot import BuildbotMixin
 from mozharness.mozilla.purge import PurgeMixin
 from mozharness.mozilla.release import ReleaseMixin
 from mozharness.base.python import VirtualenvMixin
 from mozharness.base.log import FATAL
 
-try:
-    import simplejson as json
-    assert json
-except ImportError:
-    import json
-
 # DesktopPartnerRepacks {{{1
 class DesktopPartnerRepacks(ReleaseMixin, BuildbotMixin, PurgeMixin,
                             BaseScript, VirtualenvMixin):
     """Manages desktop partner repacks"""
     actions = [
                 "clobber",
                 "create-virtualenv",
                 "activate-virtualenv",
--- a/testing/mozharness/unit.sh
+++ b/testing/mozharness/unit.sh
@@ -45,17 +45,17 @@ if [ $OS_TYPE == 'windows' ] ; then
     fi
   done
 else
   SCRIPTS_PY_FILES=$files
 fi
 export PYTHONPATH=`env pwd`:$PYTHONPATH
 
 echo "### Running pyflakes"
-pyflakes $MOZHARNESS_PY_FILES $SCRIPTS_PY_FILES | grep -v "local variable 'url' is assigned to" | grep -v "redefinition of unused 'json'" | egrep -v "mozharness/mozilla/testing/mozpool\.py.*undefined name 'requests'"
+pyflakes $MOZHARNESS_PY_FILES $SCRIPTS_PY_FILES | grep -v "local variable 'url' is assigned to" | grep -v "redefinition of unused 'json'" | egrep -v "mozharness/mozilla/testing/mozpool\.py.*undefined name 'requests'" | grep -v "list comprehension redefines"
 
 echo "### Running pylint"
 pylint -E -e F -f parseable $MOZHARNESS_PY_FILES $SCRIPTS_PY_FILES 2>&1 | egrep -v '(No config file found, using default configuration|Instance of .* has no .* member|Unable to import .devicemanager|Undefined variable .DMError|Module .hashlib. has no .sha512. member)'
 
 rm -rf build logs
 if [ $OS_TYPE != 'windows' ] ; then
   echo "### Testing non-networked unit tests"
   coverage run -a --branch $COVERAGE_ARGS $NOSETESTS test/test_*.py