本文整理汇总了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)