def execute(self): print "Build operating on target: %s" % self.target executor = PythonChroot(self.target, self.root_dir) executor.dump() binary = None if isinstance(self.target, PythonBinary): binary = os.path.join(executor.path(), '__main__.py') launcher = Launcher(executor.path(), binary) launcher.run(args=list(self.args))
def _run_lint(self, target, args): chroot = PythonChroot(target, self.root_dir) chroot.dump() launcher = Launcher(chroot.path()) interpreter_args = [ '-m', 'pylint.lint', '--rcfile=%s' % os.path.join(self.root_dir, 'build-support', 'pylint', 'pylint.rc') ] if args: interpreter_args.extend(args) sources = OrderedSet([]) if not isinstance(target, PythonEgg): target.walk(lambda trg: sources.update(trg.sources), lambda trg: not isinstance(trg, PythonEgg)) launcher.run(interpreter_args=interpreter_args, args=list(sources), with_chroot=True)
def _run_python_test(self, target): chroot = PythonChroot(target, self.root_dir) chroot.dump() launcher = Launcher(chroot.path()) extra_deps = PythonTestBuilder.get_pytest_eggs(self.root_dir) test_args = ['-m', 'pytest'] test_args.extend(PythonTestBuilder.generate_junit_args(target)) test_args.extend(self.args) # Pass any extra args in to pytest. sources = [os.path.join(target.target_base, source) for source in target.sources] return launcher.run(interpreter_args=test_args, args=list(sources), extra_deps=extra_deps)
def _run_python_test(self, target): chroot = PythonChroot(target, self.root_dir) chroot.dump() launcher = Launcher(chroot.path()) extra_deps = PythonTestBuilder.get_pytest_eggs(self.root_dir) test_args = ['-m', 'pytest'] test_args.extend(PythonTestBuilder.generate_junit_args(target)) test_args.extend(self.args) # Pass any extra args in to pytest. sources = [ os.path.join(target.target_base, source) for source in target.sources ] return launcher.run(interpreter_args=test_args, args=list(sources), extra_deps=extra_deps)