From 01db2d64e1d44770319ef5d4ce1cf447c0758597 Mon Sep 17 00:00:00 2001 From: jaimergp Date: Mon, 7 Aug 2023 09:46:12 +0200 Subject: [PATCH] set "conda_build_tool_deps" in configure_feedstock.py --- conda_smithy/configure_feedstock.py | 12 ++++++++++++ conda_smithy/templates/azure-pipelines-win.yml.tmpl | 7 ------- conda_smithy/templates/build_steps.sh.tmpl | 4 ---- conda_smithy/templates/github-actions.tmpl | 7 ------- conda_smithy/templates/run_osx_build.sh.tmpl | 4 ---- 5 files changed, 12 insertions(+), 22 deletions(-) diff --git a/conda_smithy/configure_feedstock.py b/conda_smithy/configure_feedstock.py index 4d043792b..5b6b62d77 100644 --- a/conda_smithy/configure_feedstock.py +++ b/conda_smithy/configure_feedstock.py @@ -1820,6 +1820,7 @@ def _load_forge_config(forge_dir, exclusive_config_file, forge_yml=None): "private_upload": False, "secrets": [], "conda_build_tool": "mambabuild", + "conda_build_tool_deps": "boa", # feedstock checkout git clone depth, None means keep default, 0 means no limit "clone_depth": None, # Specific channel for package can be given with @@ -1916,6 +1917,11 @@ def _load_forge_config(forge_dir, exclusive_config_file, forge_yml=None): config["conda_build_tool"] = ( "mambabuild" if config["build_with_mambabuild"] else "conda-build" ) + if file_config.get("conda_build_tool_deps"): + raise ValueError( + "Cannot set 'conda_build_tool_deps' directly. " + "Use 'conda_build_tool' instead." + ) valid_build_tools = ( "mambabuild", # will run 'conda mambabuild', as provided by boa "conda-build", # will run vanilla conda-build, with system configured / default solver @@ -1926,6 +1932,12 @@ def _load_forge_config(forge_dir, exclusive_config_file, forge_yml=None): f"Invalid conda_build_tool: {config['conda_build_tool']}. " f"Valid values are: {valid_build_tools}." ) + if config["conda_build_tool"] == "mambabuild": + config["conda_build_tool_deps"] = "boa" + elif config["conda_build_tool"] == "conda-build+conda-libmamba-solver": + config["conda_build_tool_deps"] = "conda-libmamba-solver" + elif config["conda_build_tool"] in ("conda-build", "conda-build+classic"): + config["conda_build_tool_deps"] = "" config["secrets"] = sorted(set(config["secrets"] + ["BINSTAR_TOKEN"])) diff --git a/conda_smithy/templates/azure-pipelines-win.yml.tmpl b/conda_smithy/templates/azure-pipelines-win.yml.tmpl index adf439601..acfbe564d 100644 --- a/conda_smithy/templates/azure-pipelines-win.yml.tmpl +++ b/conda_smithy/templates/azure-pipelines-win.yml.tmpl @@ -16,13 +16,6 @@ jobs: displayName: "Install Chocolatey Package: {{ choco_pkg }}" {% endfor %} -{%- if conda_build_tool == "mambabuild" %} -{%- set conda_build_tool_deps="boa " %} -{%- elif conda_build_tool == "conda-build+conda-libmamba-solver" %} -{%- set conda_build_tool_deps="conda-libmamba-solver " %} -{%- else %} -{%- set conda_build_tool_deps="" %} -{%- endif %} - task: PythonScript@0 displayName: 'Download Miniforge' inputs: diff --git a/conda_smithy/templates/build_steps.sh.tmpl b/conda_smithy/templates/build_steps.sh.tmpl index be93eb7e9..1d58ece13 100644 --- a/conda_smithy/templates/build_steps.sh.tmpl +++ b/conda_smithy/templates/build_steps.sh.tmpl @@ -32,19 +32,15 @@ pkgs_dirs: CONDARC {% if conda_build_tool == "mambabuild" %} {%- set CONDA_INSTALL_CMD="mamba" %} -{%- set conda_build_tool_deps="boa " %} {%- set BUILD_CMD="conda mambabuild" %} {% elif conda_build_tool == "conda-build+conda-libmamba-solver" %} {%- set CONDA_INSTALL_CMD="mamba" %} -{%- set conda_build_tool_deps="conda-libmamba-solver " %} {%- set BUILD_CMD="CONDA_SOLVER=libmamba conda build" %} {% elif conda_build_tool == "conda-build+classic" %} {%- set CONDA_INSTALL_CMD="mamba" %} -{%- set conda_build_tool_deps="" %} {%- set BUILD_CMD="CONDA_SOLVER=classic conda build" %} {%- else %} {%- set CONDA_INSTALL_CMD="mamba" %} -{%- set conda_build_tool_deps="" %} {%- set BUILD_CMD="conda build" %} {%- endif %} diff --git a/conda_smithy/templates/github-actions.tmpl b/conda_smithy/templates/github-actions.tmpl index 1bcb8f48c..14f126713 100644 --- a/conda_smithy/templates/github-actions.tmpl +++ b/conda_smithy/templates/github-actions.tmpl @@ -172,13 +172,6 @@ jobs: miniforge-variant: Mambaforge if: matrix.os == 'windows' -{%- if conda_build_tool == "mambabuild" %} -{%- set conda_build_tool_deps="boa " %} -{%- elif conda_build_tool == "conda-build+conda-libmamba-solver" %} -{%- set conda_build_tool_deps="conda-libmamba-solver " %} -{%- else %} -{%- set conda_build_tool_deps="" %} -{%- endif %} - name: Build on windows shell: cmd run: | diff --git a/conda_smithy/templates/run_osx_build.sh.tmpl b/conda_smithy/templates/run_osx_build.sh.tmpl index a8aac33f6..e834a98a9 100644 --- a/conda_smithy/templates/run_osx_build.sh.tmpl +++ b/conda_smithy/templates/run_osx_build.sh.tmpl @@ -21,19 +21,15 @@ bash $MINIFORGE_FILE -b -p ${MINIFORGE_HOME} ( startgroup "Configuring conda" ) 2> /dev/null {% if conda_build_tool == "mambabuild" %} {%- set CONDA_INSTALL_CMD="mamba" %} -{%- set conda_build_tool_deps="boa " %} {%- set BUILD_CMD="conda mambabuild" %} {% elif conda_build_tool == "conda-build+conda-libmamba-solver" %} {%- set CONDA_INSTALL_CMD="mamba" %} -{%- set conda_build_tool_deps="conda-libmamba-solver " %} {%- set BUILD_CMD="CONDA_SOLVER=libmamba conda build" %} {% elif conda_build_tool == "conda-build+classic" %} {%- set CONDA_INSTALL_CMD="mamba" %} -{%- set conda_build_tool_deps="" %} {%- set BUILD_CMD="CONDA_SOLVER=classic conda build" %} {%- else %} {%- set CONDA_INSTALL_CMD="mamba" %} -{%- set conda_build_tool_deps="" %} {%- set BUILD_CMD="conda build" %} {%- endif %} source ${MINIFORGE_HOME}/etc/profile.d/conda.sh