本文整理匯總了Python中setuptools.command.install方法的典型用法代碼示例。如果您正苦於以下問題:Python command.install方法的具體用法?Python command.install怎麽用?Python command.install使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類setuptools.command
的用法示例。
在下文中一共展示了command.install方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: run
# 需要導入模塊: from setuptools import command [as 別名]
# 或者: from setuptools.command import install [as 別名]
def run(self):
bin = os.path.join(self.root, "usr/bin")
try:
os.makedirs(bin)
except:
pass
for file, pkg in get_console_scripts():
path = os.path.join(bin, file)
with open(path, "w") as f:
f.write(
"""#!/usr/bin/python3
from {} import main
import sys
if __name__ == '__main__':
sys.exit(main())
""".format(pkg))
os.chmod(path, 0o755)
setuptools.command.install.install.run(self)
示例2: run
# 需要導入模塊: from setuptools import command [as 別名]
# 或者: from setuptools.command import install [as 別名]
def run(self):
setuptools.command.install.install.run(self)
try:
import spacy
spacy.cli.validate()
except ModuleNotFoundError:
pass
示例3: build_js
# 需要導入模塊: from setuptools import command [as 別名]
# 或者: from setuptools.command import install [as 別名]
def build_js(command_subclass):
"""Decorator to call npm install and npm run build"""
subclass_run = command_subclass.run
def run(self):
self.run_command("build_js")
subclass_run(self)
command_subclass.run = run
return command_subclass
示例4: run
# 需要導入模塊: from setuptools import command [as 別名]
# 或者: from setuptools.command import install [as 別名]
def run(self):
cwd = os.getcwd()
os.chdir(JS_DIR)
if not os.path.exists("node_modules"):
subprocess.check_call(["npm", "install"])
subprocess.check_call(["npm", "run", "build"])
os.chdir(cwd)
super().run()
示例5: run
# 需要導入模塊: from setuptools import command [as 別名]
# 或者: from setuptools.command import install [as 別名]
def run(self):
create_version_file()
setuptools.command.install.install.run(self)
示例6: run
# 需要導入模塊: from setuptools import command [as 別名]
# 或者: from setuptools.command import install [as 別名]
def run(self):
_pre_install()
setuptools.command.install.install.run(self)
示例7: run
# 需要導入模塊: from setuptools import command [as 別名]
# 或者: from setuptools.command import install [as 別名]
def run(self):
setuptools.command.install.install.run(self)