← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/turnip:upgrade-flake8 into turnip:master

 

Colin Watson has proposed merging ~cjwatson/turnip:upgrade-flake8 into turnip:master.

Commit message:
Upgrade flake8 and dependencies

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/turnip/+git/turnip/+merge/404683

Dependencies MP: https://code.launchpad.net/~cjwatson/turnip/+git/dependencies/+merge/404682
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/turnip:upgrade-flake8 into turnip:master.
diff --git a/requirements.txt b/requirements.txt
index dec7e61..6606fa3 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -18,7 +18,7 @@ enum34==1.1.10; python_version < "3.4"
 envdir==0.7
 extras==1.0.0
 fixtures==3.0.0
-flake8==2.4.0
+flake8==3.9.2
 future==0.18.2
 gevent==20.6.2
 gmpy==1.17
@@ -34,19 +34,21 @@ lazr.sshserver==0.1.11
 linecache2==1.0.0
 lxml==4.5.2
 m2r==0.1.14
-mccabe==0.3
+# lp:~launchpad/mccabe:launchpad
+# lp1 Remove use of deprecated 'setup.py test'.
+mccabe==0.6.1+lp1
 mistune==0.8.3
 mock==3.0.5; python_version < "3"
 pathlib2==2.3.5
 Paste==3.5.0
 PasteDeploy==2.1.0
 pbr==5.4.5
-pep8==1.5.7
 psutil==5.7.0
 pyasn1==0.4.8
+pycodestyle==2.7.0
 pycparser==2.17
 pycrypto==2.6.1
-pyflakes==0.8.1
+pyflakes==2.3.1
 pygit2==0.27.4
 pyramid==1.10.4
 python-mimeparse==1.6.0
diff --git a/turnip/api/views.py b/turnip/api/views.py
index 19bd815..dd0daf8 100644
--- a/turnip/api/views.py
+++ b/turnip/api/views.py
@@ -290,7 +290,7 @@ class DiffAPI(BaseAPI):
     @validate_path
     def get(self, repo_store, repo_name):
         """Returns diff of two commits."""
-        commits = re.split('(\.{2,3})', self.request.matchdict['commits'])
+        commits = re.split(r'(\.{2,3})', self.request.matchdict['commits'])
         context_lines = int(self.request.params.get('context_lines', 3))
         if not len(commits) == 3:
             return exc.HTTPBadRequest()
diff --git a/turnip/pack/git.py b/turnip/pack/git.py
index 2fe3ff4..79d973e 100644
--- a/turnip/pack/git.py
+++ b/turnip/pack/git.py
@@ -768,7 +768,7 @@ class PackVirtServerProtocol(PackProxyServerProtocol):
         else:
             try:
                 yield self.runOnBackend(command, pathname, params)
-            except Exception as e:
+            except Exception:
                 self.server.log.failure('Backend connection failed.')
                 self.server.die(b'Backend connection failed.')
 
diff --git a/turnip/pack/hooks/hook.py b/turnip/pack/hooks/hook.py
index 983a022..a32490f 100755
--- a/turnip/pack/hooks/hook.py
+++ b/turnip/pack/hooks/hook.py
@@ -190,6 +190,7 @@ def send_mp_url(received_line):
                 stdout.write(b'      %s\n' % six.ensure_binary(mp_url, "UTF8"))
                 stdout.write(b'      \n')
 
+
 if __name__ == '__main__':
     # Connect to the RPC server, authenticating using the random key
     # from the environment.