def run(self): env = os.environ.copy() syspath = [os.path.abspath(x) for x in sys.path] if self.build_dir: syspath.insert( 0, os.path.abspath(os.path.join(self.build_dir, '..', 'lib'))) syspath = ':'.join(syspath) cmd = [ 'make', 'PYTHON=%s' % sys.executable, 'PYTHONPATH=%s' % syspath, 'SPHINXBUILD=%s %s' % (sys.executable, self.find_sphinx_build()), str(self.builder) ] opts = [] if self.version: opts.append('-D version=%s' % self.version) if self.build_dir: cmd.append('BUILDDIR=%s' % (self.build_dir, )) if opts: cmd.append('SPHINXOPTS=%s' % (' '.join(opts), )) cwd = self.source_dir if not cwd: cwd = os.getcwd() if subprocess.call(cmd, cwd=cwd, env=env): raise errors.DistutilsExecError("doc generation failed")
def _sip_compile(self, sip_bin, source, sbf): target_dir = os.path.dirname( __file__) if self.inplace else self.build_lib pyi = os.path.join(target_dir, "PyQtAds", "QtAds", "ads.pyi") if not os.path.exists(os.path.dirname(pyi)): os.makedirs(os.path.dirname(pyi)) cmd = [sip_bin] if hasattr(self, 'sip_opts'): cmd += self.sip_opts if hasattr(self, '_sip_sipfiles_dir'): cmd += ['-I', self._sip_sipfiles_dir()] cmd += [ "-I", self.sip_files_dir, "-I", self.pyqt_sip_dir, "-I", self.sip_inc_dir, "-I", self.inc_dir, "-c", self._sip_output_dir(), "-b", sbf, "-y", pyi, "-w", "-o" ] cmd += shlex.split( self.pyqt_sip_flags) # use same SIP flags as for PyQt5 cmd.append(source) self.spawn(cmd) if os.path.exists(pyi): with open(pyi) as f: content = f.readlines() with open(pyi, "w") as f: for line in content: if not line.startswith("class ads"): f.write(line)
def run(self): cmd = ['xgettext', '--language=Python', '--keyword=_', '--package-name', I18N_DOMAIN, '--output', 'po/{}.pot'.format(I18N_DOMAIN)] for path, names, filenames in os.walk(os.path.join(os.curdir, 'udtc')): for f in filenames: if f.endswith('.py'): cmd.append(os.path.join(path, f)) subprocess.call(cmd)
def run(self): cmd = ['xgettext', '--language=Python', '--keyword=_', '--package-name', I18N_DOMAIN, '--output', 'po/{}.pot'.format(I18N_DOMAIN)] for path, names, filenames in os.walk(os.path.join(os.curdir, 'umake')): for f in filenames: if f.endswith('.py'): cmd.append(os.path.join(path, f)) subprocess.call(cmd)
def run(self): """Run command""" cmd = ["mypy"] for package in self.packages: cmd.append(package) self.announce("Run command: {}".format(str(cmd)), level=distutils.log.INFO) try: subprocess.check_call(cmd) except subprocess.CalledProcessError: self.announce( "Command: {} returned error. Check if tests are not failing.".format(str(cmd)), level=distutils.log.INFO )
def run(self): """Run command.""" cmd = ["pylint"] paths = ["./kentik_api", "./tests", "./examples"] if self.pylint_rcfile: cmd.append("--rcfile={}".format(self.pylint_rcfile)) for path in paths: cmd.append(path) self.announce("Running command: %s" % str(cmd), level=distutils.log.INFO) try: subprocess.check_call(cmd) except subprocess.CalledProcessError: pass
def _sip_compile(self, sip_bin, source, sbf): cmd = [sip_bin] if hasattr(self, 'sip_opts'): cmd += self.sip_opts if hasattr(self, '_sip_sipfiles_dir'): cmd += ['-I', self._sip_sipfiles_dir()] cmd += [ "-I", self.sip_files_dir, "-I", self.pyqt_sip_dir, "-I", self.sip_inc_dir, "-I", self.inc_dir, "-c", self._sip_output_dir(), "-b", sbf, "-w", "-o" ] cmd += shlex.split( self.pyqt_sip_flags) # use same SIP flags as for PyQt5 cmd.append(source) self.spawn(cmd)
def run(self): env = os.environ.copy() syspath = [os.path.abspath(x) for x in sys.path] if self.build_dir: syspath.insert(0, os.path.abspath( os.path.join(self.build_dir, '..', 'lib'))) syspath = ':'.join(syspath) cmd = ['make', 'PYTHON=%s' % sys.executable, 'PYTHONPATH=%s' % syspath, 'SPHINXBUILD=%s %s' % (sys.executable, self.find_sphinx_build()), str(self.builder)] opts = [] if self.version: opts.append('-D version=%s' % self.version) if self.build_dir: cmd.append('BUILDDIR=%s' % (self.build_dir,)) if opts: cmd.append('SPHINXOPTS=%s' % (' '.join(opts),)) cwd = self.source_dir if not cwd: cwd = os.getcwd() if subprocess.call(cmd, cwd=cwd, env=env): raise errors.DistutilsExecError("doc generation failed")