本文整理汇总了Python中setuptools.command.install.install.run方法的典型用法代码示例。如果您正苦于以下问题:Python install.run方法的具体用法?Python install.run怎么用?Python install.run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类setuptools.command.install.install
的用法示例。
在下文中一共展示了install.run方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update_version_py
# 需要导入模块: from setuptools.command.install import install [as 别名]
# 或者: from setuptools.command.install.install import run [as 别名]
def update_version_py():
if not os.path.isdir(".git"):
print("This does not appear to be a Git repository.")
return
try:
# p = subprocess.Popen(["git", "describe","--tags", "--always"],
# stdout=subprocess.PIPE)
p = subprocess.Popen("git rev-list HEAD --count".split(),
stdout=subprocess.PIPE)
except EnvironmentError:
print("unable to run git, leaving eden/_version.py alone")
return
stdout = p.communicate()[0]
if p.returncode != 0:
print("unable to run git, leaving eden/_version.py alone")
return
ver = "0.3."+stdout.strip()
# ver = str(int(ver,16)) # pypi doesnt like base 16
f = open("eden/_version.py", "w")
f.write(VERSION_PY % ver)
f.close()
print("set eden/_version.py to '%s'" % ver)
示例2: run
# 需要导入模块: from setuptools.command.install import install [as 别名]
# 或者: from setuptools.command.install.install import run [as 别名]
def run(self):
_clean.run(self)
if os.path.exists('build'):
shutil.rmtree('build')
for dirpath, dirnames, filenames in os.walk('yatsm'):
for filename in filenames:
if any(filename.endswith(suffix) for suffix in
('.c', '.so', '.pyd', '.pyc')):
os.unlink(os.path.join(dirpath, filename))
continue
if (any(filename.endswith(suffix) for suffix in
('.pkl', '.json')) and
os.path.basename(dirpath) == 'pickles'):
os.unlink(os.path.join(dirpath, filename))
for dirname in dirnames:
if dirname == '__pycache__':
shutil.rmtree(os.path.join(dirpath, dirname))
# Create pickles when building
示例3: run
# 需要导入模块: from setuptools.command.install import install [as 别名]
# 或者: from setuptools.command.install.install import run [as 别名]
def run(self):
if self.corpora_zip_url is None:
self.corpora_zip_url = os.environ.get(
"CORPORA_ZIP_URL",
"https://github.com/dariusk/corpora/archive/master.zip",
)
print("Installing corpora data from " + self.corpora_zip_url)
mkpath("./corpora-download")
resp = urlopen(self.corpora_zip_url).read()
remote = io.BytesIO(resp)
zf = zipfile.ZipFile(remote, "r")
zf.extractall("corpora-download")
try:
data_dir = glob.glob("./corpora-download/*/data")[0]
except IndexError:
raise IndexError(
"malformed corpora archive: expecting a subdirectory '*/data'")
copy_tree(data_dir, "pycorpora/data")
install.run(self)
示例4: update_version_py
# 需要导入模块: from setuptools.command.install import install [as 别名]
# 或者: from setuptools.command.install.install import run [as 别名]
def update_version_py():
if not os.path.isdir(".git"):
print("This does not appear to be a Git repository.")
return
try:
p = subprocess.Popen(["git", "describe",
"--tags", "--always"],
stdout=subprocess.PIPE)
except EnvironmentError:
print("unable to run git, leaving pygenometracks/_version.py alone")
return
stdout = p.communicate()[0]
if p.returncode != 0:
print("unable to run git, leaving pygenometracks/_version.py alone")
return
ver = stdout.strip()
f = open(os.path.join("pygenometracks", "_version.py"), "w")
f.write(VERSION_PY % ver)
f.close()
print("set pygenometracks/_version.py to '%s'" % ver)
示例5: update_version_py
# 需要导入模块: from setuptools.command.install import install [as 别名]
# 或者: from setuptools.command.install.install import run [as 别名]
def update_version_py():
if not os.path.isdir(".git"):
print("This does not appear to be a Git repository.")
return
try:
p = subprocess.Popen(["git", "describe",
"--tags", "--always"],
stdout=subprocess.PIPE)
except EnvironmentError:
print("unable to run git, leaving hicexplorer/_version.py alone")
return
stdout = p.communicate()[0]
if p.returncode != 0:
print("unable to run git, leaving hicexplorer/_version.py alone")
return
ver = stdout.strip()
f = open("hicexplorer/_version.py", "w")
f.write(VERSION_PY % ver)
f.close()
print("set hicexplorer/_version.py to '%s'" % ver)
示例6: run
# 需要导入模块: from setuptools.command.install import install [as 别名]
# 或者: from setuptools.command.install.install import run [as 别名]
def run(self):
_install.run(self)
# Do what distutils install_data used to do... *sigh*
# Despite what the setuptools docs say, the omission of this
# in setuptools is a bug, not a feature.
print("== Installing Nautilus Python extension...")
src_file = "nautilus_open_any_terminal/open_any_terminal_extension.py"
dst_dir = os.path.join(self.install_data, "share/nautilus-python/extensions")
self.mkpath(dst_dir)
dst_file = os.path.join(dst_dir, os.path.basename(src_file))
self.copy_file(src_file, dst_file)
print("== Done!")
print("== Installing GSettings Schema")
src_file = "./nautilus_open_any_terminal/schemas/com.github.stunkymonkey.nautilus-open-any-terminal.gschema.xml"
dst_dir = os.path.join(self.install_data, "share/glib-2.0/schemas")
self.mkpath(dst_dir)
dst_file = os.path.join(dst_dir, os.path.basename(src_file))
self.copy_file(src_file, dst_file)
print("== Done! Run 'glib-compile-schemas " + dst_dir + "/' to compile the schema.")
示例7: run
# 需要导入模块: from setuptools.command.install import install [as 别名]
# 或者: from setuptools.command.install.install import run [as 别名]
def run(self):
update_version_py()
self.distribution.metadata.version = get_version()
return _sdist.run(self)
示例8: run
# 需要导入模块: from setuptools.command.install import install [as 别名]
# 或者: from setuptools.command.install.install import run [as 别名]
def run(self):
if not self.large_data_dir is None:
print('Large data directory is set to: {}'.format(self.large_data_dir))
with open(os.path.expanduser('~/.dustmapsrc'), 'w') as f:
json.dump({'data_dir': self.large_data_dir}, f, indent=2)
# install.do_egg_install(self) # Due to bug in setuptools that causes old-style install
install.run(self)
示例9: run
# 需要导入模块: from setuptools.command.install import install [as 别名]
# 或者: from setuptools.command.install.install import run [as 别名]
def run(self):
# Issue #123: skip installation of consul.aio if python version < 3.4.2
# as this version or later is required by aiohttp
if sys.version_info < (3, 4, 2):
if 'consul/aio' in self.distribution.py_modules:
self.distribution.py_modules.remove('consul/aio')
install.run(self)
示例10: run
# 需要导入模块: from setuptools.command.install import install [as 别名]
# 或者: from setuptools.command.install.install import run [as 别名]
def run(self):
try:
print("Building custom models:")
build_custom_models()
except ImportError as e:
print("Custom model compilation failed with: %s" % e)
develop.run(self)
示例11: run
# 需要导入模块: from setuptools.command.install import install [as 别名]
# 或者: from setuptools.command.install.install import run [as 别名]
def run(self):
install.run(self)
if not DFT_AVAILABLE:
print("****************************************************************")
print("*** WARNING: DFT is not available.")
print("****************************************************************")
# Python ABI updates since 3.5
# https://www.python.org/dev/peps/pep-3149/
示例12: run
# 需要导入模块: from setuptools.command.install import install [as 别名]
# 或者: from setuptools.command.install.install import run [as 别名]
def run(self):
develop.run(self)
install_dir = os.path.join(self.install_dir, 'nesmdb')
_build_vgm_play('/tmp/build_vgmplay', install_dir)
示例13: run
# 需要导入模块: from setuptools.command.install import install [as 别名]
# 或者: from setuptools.command.install.install import run [as 别名]
def run(self):
global BUILD_FROM_CYTHON, BUILD_FROM_SOURCE
BUILD_FROM_CYTHON = True if self.use_cython > 0 else False
BUILD_FROM_SOURCE = True if self.use_source > 0 else False
install_command.run(self)
# Reference: https://docs.pytest.org/en/latest/goodpractices.html
示例14: run
# 需要导入模块: from setuptools.command.install import install [as 别名]
# 或者: from setuptools.command.install.install import run [as 别名]
def run(self):
self.check_liberasure()
_build.run(self)
示例15: run
# 需要导入模块: from setuptools.command.install import install [as 别名]
# 或者: from setuptools.command.install.install import run [as 别名]
def run(self):
from arches.setup import install as arches_install
install.run(self)
arches_install()