本文整理汇总了Python中conda_build.metadata.MetaData.full_build_path方法的典型用法代码示例。如果您正苦于以下问题:Python MetaData.full_build_path方法的具体用法?Python MetaData.full_build_path怎么用?Python MetaData.full_build_path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类conda_build.metadata.MetaData
的用法示例。
在下文中一共展示了MetaData.full_build_path方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: decide_what_to_build
# 需要导入模块: from conda_build.metadata import MetaData [as 别名]
# 或者: from conda_build.metadata.MetaData import full_build_path [as 别名]
def decide_what_to_build(recipes_path, python, packages, numpy):
"""Figure out which packages need to be built
Parameters
----------
recipes_path : str
Path to folder containg conda recipes
python : list
List of python versions to build
packages : list
List of packages that already exist on the anaconda channel we are
interested in
numpy : list
List of numpy versions to build.
Returns
-------
metas_to_build : list
the metadata for the conda build with three extra fields:
- full_build_path
- build_name
- build_command
metas_not_to_build : list
Same as `packages_to_build`
"""
metas_not_to_build = []
metas_to_build = []
# logger.info("Build Plan")
# logger.info("Determining package build names...")
# logger.info('{: <8} | {}'.format('to build', 'built package name'))
recipes_path = os.path.abspath(recipes_path)
logger.info("recipes_path = {}".format(recipes_path))
for folder in sorted(os.listdir(recipes_path)):
recipe_dir = os.path.join(recipes_path, folder)
if os.path.isfile(recipe_dir):
continue
if 'meta.yaml' not in os.listdir(recipe_dir):
continue
logger.debug('Evaluating recipe: {}'.format(recipe_dir))
build, run, test = get_deps_from_metadata(recipe_dir)
# only need to do multiple numpy builds if the meta.yaml pins the numpy
# version in build and run.
numpy_build_versions = numpy
if 'numpy x.x' not in build:
numpy_build_versions = [DEFAULT_NP_VER]
python_build_versions = python
if 'python' not in set(build + run):
python_build_versions = [DEFAULT_PY]
for py, npy in itertools.product(python_build_versions,
numpy_build_versions):
logger.debug("Checking py={} and npy={}".format(py, npy))
try:
with env_var('CONDA_NPY', npy):
path_to_built_package, build_cmd = determine_build_name(
recipe_dir, '--python', py, '--numpy', npy)
except RuntimeError as re:
logger.error(re)
continue
if '.tar.bz' not in path_to_built_package:
on_anaconda_channel = True
name_on_anaconda = "Skipping {}".format(
folder, py, npy
)
else:
name_on_anaconda = os.sep.join(
path_to_built_package.split(os.sep)[-2:])
# pdb.set_trace()
meta = MetaData(recipe_dir)
on_anaconda_channel = name_on_anaconda in packages
meta.full_build_path = path_to_built_package
meta.build_name = name_on_anaconda
meta.build_command = build_cmd
if on_anaconda_channel:
metas_not_to_build.append(meta)
else:
metas_to_build.append(meta)
logger.info('{:<8} | {:<5} | {:<5} | {}'.format(
str(not bool(on_anaconda_channel)), py, npy, name_on_anaconda))
return metas_to_build, metas_not_to_build