Skip to content
Snippets Groups Projects
Commit 5e2ee0f1 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

[build] Fix usage of conda_build.api.build() when using metadata (bis)

parent 3b4bd2e5
No related branches found
No related tags found
No related merge requests found
Pipeline #27894 passed
...@@ -524,7 +524,7 @@ def base_build(bootstrap, server, intranet, group, recipe_dir, ...@@ -524,7 +524,7 @@ def base_build(bootstrap, server, intranet, group, recipe_dir,
# if you get to this point, just builds the package # if you get to this point, just builds the package
logger.info('Building %s', path) logger.info('Building %s', path)
conda_build.api.build(metadata[0], config=conda_config) conda_build.api.build(metadata[0][0], config=conda_config)
if __name__ == '__main__': if __name__ == '__main__':
......
...@@ -266,9 +266,25 @@ def base_build(order, group, python, dry_run): ...@@ -266,9 +266,25 @@ def base_build(order, group, python, dry_run):
""" """
condarc = os.path.join(os.environ['CONDA_ROOT'], 'condarc') condarc = os.path.join(os.environ['CONDA_ROOT'], 'condarc')
logger.info('Loading (this build\'s) CONDARC file from %s...', condarc) if os.path.exists(condarc):
with open(condarc, 'rb') as f: logger.info('Loading (this build\'s) CONDARC file from %s...', condarc)
condarc_options = yaml.load(f) with open(condarc, 'rb') as f:
condarc_options = yaml.load(f)
else: #not building on the CI? - use defaults
import yaml
from ..constants import BASE_CONDARC, SERVER
from ..bootstrap import get_channels
# get potential channel upload and other auxiliary channels
channels = get_channels(public=True, stable=True, server=SERVER,
intranet='True', group='bob')
# use default and add channels
condarc_options = yaml.load(BASE_CONDARC) #n.b.: no channels
logger.info('Using the following channels during build:\n - %s',
'\n - '.join(channels + ['defaults']))
condarc_options['channels'] = channels + ['defaults']
# dump packages at conda_root # dump packages at conda_root
condarc_options['croot'] = os.path.join(os.environ['CONDA_ROOT'], condarc_options['croot'] = os.path.join(os.environ['CONDA_ROOT'],
......
...@@ -200,7 +200,8 @@ def rebuild(recipe_dir, python, condarc, config, append_file, ...@@ -200,7 +200,8 @@ def rebuild(recipe_dir, python, condarc, config, append_file,
os.unlink(candidate) os.unlink(candidate)
if not dry_run: if not dry_run:
conda_build.api.build(metadata[0], config=conda_config, notest=no_test) conda_build.api.build(metadata[0][0], config=conda_config,
notest=no_test)
# if you get to this point, the package was successfully rebuilt # if you get to this point, the package was successfully rebuilt
# set environment to signal caller we can upload it # set environment to signal caller we can upload it
os.environ['BDT_REBUILD'] = candidate os.environ['BDT_REBUILD'] = candidate
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment