[narval] Fix pypi.upload checker (closes #4002584)
authorJulien Cristau <julien.cristau@logilab.fr>
Tue, 17 Jun 2014 14:11:15 +0200
changeset 1530 050d0a67b616
parent 1527 023c979bf201
child 1531 613f39518d8f
[narval] Fix pypi.upload checker (closes #4002584) 1. NameError for apycotlib 2. NotImplementedError because apycot was looking for a do_check() method, not run() And drop the unused path argument to do_check.
_narval/checkers/apycot/pypi.py
--- a/_narval/checkers/apycot/pypi.py	Sat May 24 16:45:15 2014 +0200
+++ b/_narval/checkers/apycot/pypi.py	Tue Jun 17 14:11:15 2014 +0200
@@ -5,7 +5,7 @@
 import subprocess
 import sys
 
-from apycotlib import Command
+import apycotlib
 
 from checkers.apycot import BaseChecker
 from preprocessors.apycot.distutils import pyversions
@@ -20,21 +20,20 @@
             },
         }
 
-    def run(self, test, path=None):
+    def run(self, test):
         """run the distutils 'setup.py register sdist upload' command
 
         The user running the narval bot must have a properly filled
         .pypirc file
         """
-        if path is None:
-            path = test.project_path()
+        path = test.project_path()
         if not exists(join(path, 'setup.py')):
             raise SetupException('No file %s' % abspath(join(path, 'setup.py')))
         python = pyversions(test)[0]
         cmdargs = [python, 'setup.py', 'register', 'sdist', 'upload']
         if not self.options.get('verbose'):
             cmdargs.append('--quiet')
-        cmd = Command(self.writer, cmdargs, raises=True, cwd=path)
+        cmd = apycotlib.Command(self.writer, cmdargs, raises=True, cwd=path)
         cmdstatus = cmd.run()
         if cmdstatus == apycotlib.SUCCESS:
             self.writer.info('uploaded tarball to pypi')