Bug 1273634 - Add flake8 dependencies to the lint image, r=dustin
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Sat, 28 May 2016 21:47:33 -0400
changeset 374054 0c3f4cbf0bfe670b42a8f79d2a2c5203ebf7af0b
parent 374053 622c7afef4ae38f9489e2269ebb3c61528edb5b5
child 374055 c48f3b04c9dee0e649c520bbcd25c143a545c1b0
push id19914
push userfelipc@gmail.com
push dateWed, 01 Jun 2016 18:46:53 +0000
reviewersdustin
bugs1273634
milestone49.0a1
Bug 1273634 - Add flake8 dependencies to the lint image, r=dustin This adds flake8 dependencies. Note that ubuntu 16.04 repos include pip > 8.0 which has peep merged into it, so there's no need to install peep separately. I also ran into a locale issue which was causing a UnicodeDecodeError anytime python tried to print a unicode character. The "locale-gen/dpkg-reconfigure locales" fix the problem. MozReview-Commit-ID: DQhYV6Emklw
testing/docker/lint/system-setup.sh
--- a/testing/docker/lint/system-setup.sh
+++ b/testing/docker/lint/system-setup.sh
@@ -8,21 +8,28 @@ test `whoami` == 'root'
 
 mkdir -p /setup
 cd /setup
 
 apt_packages=()
 apt_packages+=('curl')
 apt_packages+=('mercurial')
 apt_packages+=('python')
+apt_packages+=('python-pip')
+apt_packages+=('sudo')
 apt_packages+=('xz-utils')
 
 apt-get update
 apt-get install -y ${apt_packages[@]}
 
+# Without this we get spurious "LC_ALL: cannot change locale (en_US.UTF-8)" errors,
+# and python scripts raise UnicodeEncodeError when trying to print unicode characters.
+locale-gen en_US.UTF-8
+dpkg-reconfigure locales
+
 tooltool_fetch() {
     cat >manifest.tt
     /build/tooltool.py fetch
     rm manifest.tt
 }
 
 
 ###
@@ -56,10 +63,24 @@ tooltool_fetch <<'EOF'
 "digest": "a781a96e596f6403eca6ec2300adb9c1a396659393e16993c66f98a658050e557bc681d521f70b50c1162aa4b435274e0098ffcbd37cbe969c0e4f69be19a1e0",
 "algorithm": "sha512",
 "filename": "taskcluster-vcs-v2.3.12.tar.gz"
 }
 ]
 EOF
 npm install -g taskcluster-vcs-v2.3.12.tar.gz
 
+
+###
+# Flake8 Setup
+###
+
+cat >requirements.txt <<'EOF'
+mccabe==0.4.0   --hash=sha256:cbc2938f6c01061bc6d21d0c838c2489664755cb18676f0734d7617f4577d09e
+pep8==1.7.0     --hash=sha256:4fc2e478addcf17016657dff30b2d8d611e8341fac19ccf2768802f6635d7b8a
+pyflakes==1.2.3 --hash=sha256:e87bac26c62ea5b45067cc89e4a12f56e1483f1f2cda17e7c9b375b9fd2f40da
+flake8==2.5.4   --hash=sha256:fb5a67af4024622287a76abf6b7fe4fb3cfacf765a790976ce64f52c44c88e4a
+EOF
+
+pip install --require-hashes -r requirements.txt
+
 cd /
 rm -rf /setup