Skip to content

Commit

Permalink
set "conda_build_tool_deps" in configure_feedstock.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp committed Aug 7, 2023
1 parent 8d187b6 commit 01db2d6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 22 deletions.
12 changes: 12 additions & 0 deletions conda_smithy/configure_feedstock.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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"]))

Expand Down
7 changes: 0 additions & 7 deletions conda_smithy/templates/azure-pipelines-win.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 0 additions & 4 deletions conda_smithy/templates/build_steps.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}

Expand Down
7 changes: 0 additions & 7 deletions conda_smithy/templates/github-actions.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
4 changes: 0 additions & 4 deletions conda_smithy/templates/run_osx_build.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 01db2d6

Please sign in to comment.