Skip to content
Snippets Groups Projects
Commit 9724e8f3 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

Add conda-forge as a low priority channel in the builds

parent a1a488bb
No related branches found
No related tags found
1 merge request!229Add conda-forge as a low priority channel in the builds
Pipeline #52044 passed
......@@ -282,7 +282,7 @@ def install_miniconda(prefix, name):
shutil.rmtree(cached)
def get_channels(public, stable, server, intranet, group):
def get_channels(public, stable, server, intranet, group, add_dependent_channels=False):
"""Returns the relevant conda channels to consider if building project.
The subset of channels to be returned depends on the visibility and
......@@ -310,6 +310,8 @@ def get_channels(public, stable, server, intranet, group):
compiling is part of. Values should match URL namespaces currently
available on our internal webserver. Currently, only "bob" or "beat"
will work.
add_dependent_channels: If True, will add the defaults and conda-forge
channels to the list
Returns: a list of channels that need to be considered.
......@@ -347,6 +349,9 @@ def get_channels(public, stable, server, intranet, group):
)
]
if add_dependent_channels:
channels += ["defaults", "conda-forge"]
return channels, upload_channel
......@@ -516,9 +521,13 @@ if __name__ == "__main__":
conda_bld_path = os.path.join(args.conda_root, "conda-bld")
run_cmdline([conda_bin, "index", conda_bld_path])
channels, _ = get_channels(
public=True, stable=True, server=_SERVER, intranet=True, group="bob"
public=True,
stable=True,
server=_SERVER,
intranet=True,
group="bob",
add_dependent_channels=True,
)
channels += ["defaults"]
channels = (
["--override-channels"]
+ ["--channel=" + conda_bld_path]
......@@ -541,9 +550,9 @@ if __name__ == "__main__":
server=_SERVER,
intranet=True,
group="bob",
add_dependent_channels=True,
)
channels += ["defaults"]
channels = ["--override-channels"] + ["--channel=%s" % k for k in channels]
conda_cmd = "install" if args.envname in ("base", "root") else "create"
cmd = (
......
......@@ -602,11 +602,16 @@ def base_build(
# if you get to this point, tries to build the package
channels, upload_channel = bootstrap.get_channels(
public=True, stable=True, server=server, intranet=intranet, group=group
public=True,
stable=True,
server=server,
intranet=intranet,
group=group,
add_dependent_channels=True,
)
if "channels" not in condarc_options:
condarc_options["channels"] = channels + ["defaults"]
condarc_options["channels"] = channels
logger.info(
"Using the following channels during (potential) build:\n - %s",
......
......@@ -198,10 +198,11 @@ def build(
server=server,
intranet=ci,
group=group,
add_dependent_channels=True,
)
if "channels" not in condarc_options:
condarc_options["channels"] = channels + ["defaults"]
condarc_options["channels"] = channels
logger.info(
"Using the following channels during (potential) build:\n - %s",
......
......@@ -256,8 +256,9 @@ def create(
server=server,
intranet=private,
group=group,
add_dependent_channels=True,
)
condarc_options["channels"] = channels + ["defaults"]
condarc_options["channels"] = channels
logger.info(
"Using the following channels during environment creation:" "\n - %s",
......
......@@ -178,6 +178,7 @@ def graph(
server=server,
intranet=ci,
group=package_group,
add_dependent_channels=True,
)
if condarc is not None:
......@@ -189,7 +190,7 @@ def graph(
condarc_options = yaml.load(BASE_CONDARC, Loader=yaml.FullLoader)
if "channels" not in condarc_options:
condarc_options["channels"] = channels + ["defaults"]
condarc_options["channels"] = channels
logger.info(
"Using the following channels during graph operation:\n - %s",
......
......@@ -183,6 +183,7 @@ def rebuild(
server=server,
intranet=ci,
group=group,
add_dependent_channels=True,
)
if condarc is not None:
......@@ -194,7 +195,7 @@ def rebuild(
condarc_options = yaml.load(BASE_CONDARC, Loader=yaml.FullLoader)
if "channels" not in condarc_options:
condarc_options["channels"] = channels + ["defaults"]
condarc_options["channels"] = channels
logger.info(
"Using the following channels during (potential) build:\n - %s",
......
......@@ -168,9 +168,14 @@ def test(
from ..bootstrap import get_channels
channels, _ = get_channels(
public=(not private), stable=stable, server=server, intranet=ci, group=group
public=(not private),
stable=stable,
server=server,
intranet=ci,
group=group,
add_dependent_channels=True,
)
condarc_options["channels"] = channels + ["defaults"]
condarc_options["channels"] = channels
logger.info(
"Using the following channels during (potential) build:\n - %s",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment