From 7521f0766597001b29cbe5958aa1bb236b8c2aaf Mon Sep 17 00:00:00 2001 From: Ryan Clary <9618975+mrclary@users.noreply.github.com> Date: Mon, 25 Mar 2024 08:45:30 -0700 Subject: [PATCH] Remap local channel to conda-forge. I don't think there is a way to remap the local channel to different channels depending on the package, e.g. spyder-kernels to use conda-forge/label/spyder_kernels_rc and spyder to use conda-forge/label/spyder_dev. However, I think conda-forge will be sufficient to allow the updater to perform its actions. --- installers-conda/build_installers.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/installers-conda/build_installers.py b/installers-conda/build_installers.py index d9c6c658325..2bb85537766 100644 --- a/installers-conda/build_installers.py +++ b/installers-conda/build_installers.py @@ -33,7 +33,7 @@ from pathlib import Path import platform import re -from subprocess import check_call +from subprocess import run import sys from textwrap import dedent, indent from time import time @@ -217,6 +217,14 @@ def _get_condarc(): return str(file) +def _get_conda_bld_path_url(): + bld_path_url = "file://" + if WINDOWS: + bld_path_url += "/" + bld_path_url += Path(os.getenv('CONDA_BLD_PATH')).as_posix() + return bld_path_url + + def _definitions(): condarc = _get_condarc() definitions = { @@ -246,6 +254,12 @@ def _definitions(): "specs": [k + v for k, v in specs.items()], }, }, + "channels_remap": [ + { + "src": _get_conda_bld_path_url(), + "dest": "https://conda.anaconda.org/conda-forge" + } + ] } if not args.no_local: @@ -371,7 +385,7 @@ def _constructor(): yaml.dump(definitions, BUILD / "construct.yaml") - check_call(cmd_args, env=env) + run(cmd_args, check=True, env=env) def licenses():