本文整理汇总了Python中distutils.command.build.build.run方法的典型用法代码示例。如果您正苦于以下问题:Python build.run方法的具体用法?Python build.run怎么用?Python build.run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类distutils.command.build.build
的用法示例。
在下文中一共展示了build.run方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from distutils.command.build import build [as 别名]
# 或者: from distutils.command.build.build import run [as 别名]
def run(self):
versions = get_versions(verbose=True)
target_versionfile = versionfile_source
print("UPDATING %s" % target_versionfile)
os.unlink(target_versionfile)
f = open(target_versionfile, "w")
f.write(SHORT_VERSION_PY % versions)
f.close()
_build_exe.run(self)
os.unlink(target_versionfile)
f = open(versionfile_source, "w")
f.write(LONG_VERSION_PY % {"DOLLAR": "$",
"TAG_PREFIX": tag_prefix,
"PARENTDIR_PREFIX": parentdir_prefix,
"VERSIONFILE_SOURCE": versionfile_source,
})
f.close()
示例2: run
# 需要导入模块: from distutils.command.build import build [as 别名]
# 或者: from distutils.command.build.build import run [as 别名]
def run(self):
"""
Run ``./configure`` and Cython first.
"""
config_h = opj("src", "cysignals", "cysignals_config.h")
if not os.path.isfile(config_h):
import subprocess
subprocess.check_call(["make", "configure"])
subprocess.check_call(["sh", "configure"])
dist = self.distribution
ext_modules = dist.ext_modules
if ext_modules:
dist.ext_modules[:] = self.cythonize(ext_modules)
_build.run(self)
示例3: run
# 需要导入模块: from distutils.command.build import build [as 别名]
# 或者: from distutils.command.build.build import run [as 别名]
def run(self):
versions = get_versions(verbose=True)
target_versionfile = versionfile_source
print("UPDATING %s" % target_versionfile)
os.unlink(target_versionfile)
f = open(target_versionfile, "w")
f.write(SHORT_VERSION_PY % versions)
f.close()
_build_exe.run(self)
os.unlink(target_versionfile)
f = open(versionfile_source, "w")
f.write(LONG_VERSION_PY % {"DOLLAR": "$",
"TAG_PREFIX": tag_prefix,
"PARENTDIR_PREFIX": parentdir_prefix,
"VERSIONFILE_SOURCE": versionfile_source,
"LOOKUPFILE": '"%s"' % lookupfile if lookupfile is not None else "None",
})
f.close()
示例4: run
# 需要导入模块: from distutils.command.build import build [as 别名]
# 或者: from distutils.command.build.build import run [as 别名]
def run(self):
environ.setdefault("DJANGO_SETTINGS_MODULE", "byro.settings")
try:
import django
except ImportError: # Move to ModuleNotFoundError once we drop Python 3.5
return
django.setup()
from django.conf import settings
from django.core import management
settings.COMPRESS_ENABLED = True
settings.COMPRESS_OFFLINE = True
management.call_command("compilemessages", verbosity=1)
management.call_command("collectstatic", verbosity=1, interactive=False)
management.call_command("compress", verbosity=1)
build.run(self)
示例5: run
# 需要导入模块: from distutils.command.build import build [as 别名]
# 或者: from distutils.command.build.build import run [as 别名]
def run(self):
from grpc_tools import protoc
include = pkg_resources.resource_filename('grpc_tools', '_proto')
for src in glob(os.path.join(JAVA_PROTO_DIR, "*.proto")):
command = ['grpc_tools.protoc',
'--proto_path=%s' % JAVA_PROTO_DIR,
'--proto_path=%s' % include,
'--python_out=%s' % SKEIN_PROTO_DIR,
'--grpc_python_out=%s' % SKEIN_PROTO_DIR,
src]
if protoc.main(command) != 0:
self.warn('Command: `%s` failed'.format(command))
sys.exit(1)
for path in _compiled_protos():
self._fix_imports(path)
示例6: run
# 需要导入模块: from distutils.command.build import build [as 别名]
# 或者: from distutils.command.build.build import run [as 别名]
def run(self):
self.run_command('build_ext')
build.run(self)
示例7: run_command
# 需要导入模块: from distutils.command.build import build [as 别名]
# 或者: from distutils.command.build.build import run [as 别名]
def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False):
assert isinstance(commands, list)
p = None
for c in commands:
try:
# remember shell=False, so use git.cmd on windows, not just git
p = subprocess.Popen([c] + args, cwd=cwd, stdout=subprocess.PIPE,
stderr=(subprocess.PIPE if hide_stderr
else None))
break
except EnvironmentError:
e = sys.exc_info()[1]
if e.errno == errno.ENOENT:
continue
if verbose:
print("unable to run %s" % args[0])
print(e)
return None
else:
if verbose:
print("unable to find command, tried %s" % (commands,))
return None
stdout = p.communicate()[0].strip()
if sys.version >= '3':
stdout = stdout.decode()
if p.returncode != 0:
if verbose:
print("unable to run %s (error)" % args[0])
return None
return stdout
示例8: run
# 需要导入模块: from distutils.command.build import build [as 别名]
# 或者: from distutils.command.build.build import run [as 别名]
def run(self):
self.check_liberasure()
_build.run(self)
示例9: run
# 需要导入模块: from distutils.command.build import build [as 别名]
# 或者: from distutils.command.build.build import run [as 别名]
def run(self):
old_build.run(self)
示例10: run
# 需要导入模块: from distutils.command.build import build [as 别名]
# 或者: from distutils.command.build.build import run [as 别名]
def run(self):
__builtins__.__NUMPY_SETUP__ = False
import numpy
print(numpy.get_include())
_build.run(self)
示例11: run
# 需要导入模块: from distutils.command.build import build [as 别名]
# 或者: from distutils.command.build.build import run [as 别名]
def run(self):
dist = self.distribution
ext_modules = dist.ext_modules
if ext_modules:
dist.ext_modules[:] = self.cythonize(ext_modules)
_build.run(self)
示例12: run
# 需要导入模块: from distutils.command.build import build [as 别名]
# 或者: from distutils.command.build.build import run [as 别名]
def run(self):
if test is not None and test.test is not None:
assert test.test() == True, "Automated tests failed!"
print("notice all tests passed: OK!")
else:
print("notice automated tests skipped!")
build.run(self)
示例13: run
# 需要导入模块: from distutils.command.build import build [as 别名]
# 或者: from distutils.command.build.build import run [as 别名]
def run(self):
# Build our C library
subprocess.check_call(['./Turbo/build_lib.sh'])
_build.run(self)
示例14: run
# 需要导入模块: from distutils.command.build import build [as 别名]
# 或者: from distutils.command.build.build import run [as 别名]
def run(self, *args):
self.execute(_build_native, (), msg='Building angr_native')
_build.run(self, *args)