bug 1244781 - mozharness pylint + pyflakes cleanup. r?jlund
--- 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