本文整理汇总了Python中pex.pex_builder.PEXBuilder.add_egg方法的典型用法代码示例。如果您正苦于以下问题:Python PEXBuilder.add_egg方法的具体用法?Python PEXBuilder.add_egg怎么用?Python PEXBuilder.add_egg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pex.pex_builder.PEXBuilder
的用法示例。
在下文中一共展示了PEXBuilder.add_egg方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: write_pex
# 需要导入模块: from pex.pex_builder import PEXBuilder [as 别名]
# 或者: from pex.pex_builder.PEXBuilder import add_egg [as 别名]
def write_pex(td, exe_contents, dists=None):
dists = dists or []
with open(os.path.join(td, 'exe.py'), 'w') as fp:
fp.write(exe_contents)
pb = PEXBuilder(path=td)
for dist in dists:
pb.add_egg(dist.location)
pb.set_executable(os.path.join(td, 'exe.py'))
pb.freeze()
return pb
示例2: yield_pex_builder
# 需要导入模块: from pex.pex_builder import PEXBuilder [as 别名]
# 或者: from pex.pex_builder.PEXBuilder import add_egg [as 别名]
def yield_pex_builder(zip_safe=True):
with nested(temporary_dir(), make_bdist("p1", zipped=True, zip_safe=zip_safe)) as (td, p1):
pb = PEXBuilder(path=td)
pb.add_egg(p1.location)
yield pb