本文整理汇总了Python中conda_build.metadata.MetaData.build_number方法的典型用法代码示例。如果您正苦于以下问题:Python MetaData.build_number方法的具体用法?Python MetaData.build_number怎么用?Python MetaData.build_number使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类conda_build.metadata.MetaData
的用法示例。
在下文中一共展示了MetaData.build_number方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: read_recipe_name_version_build
# 需要导入模块: from conda_build.metadata import MetaData [as 别名]
# 或者: from conda_build.metadata.MetaData import build_number [as 别名]
def read_recipe_name_version_build(meta_yaml_path):
"""
Read the given metadata file and return (package_name, version, build_number)
meta_yaml_path: May be a path to a meta.yaml file or it's parent recipe directory.
"""
# Provide these default values, otherwise conda-build will
# choke on jinja templates that reference them.
# This will be fixed when they finally merge conda-build PR#662 and PR#666
if "CONDA_NPY" not in os.environ:
os.environ["CONDA_NPY"] = '19'
if "CONDA_PY" not in os.environ:
os.environ["CONDA_PY"] = '27'
os.environ["GIT_FULL_HASH"] = "9999999"
if os.path.isdir(meta_yaml_path):
recipe_dir = meta_yaml_path
else:
recipe_dir = os.path.split(meta_yaml_path)[0]
try:
metadata = MetaData(recipe_dir)
return (metadata.name(), metadata.version(), metadata.build_number())
except SystemExit as ex:
raise Exception(*ex.args)