Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pinned_packages option in conda-forge.yml #1776

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions conda_smithy/configure_feedstock.py
Original file line number Diff line number Diff line change
Expand Up @@ -1869,6 +1869,8 @@ def _load_forge_config(forge_dir, exclusive_config_file, forge_yml=None):
# ${url or channel_alias}::package_name
# defaults to conda-forge channel_alias
"remote_ci_setup": ["conda-forge-ci-setup=3"],
# Add constraints to the base environment
"pinned_packages": [],
}

if forge_yml is None:
Expand Down Expand Up @@ -2054,6 +2056,9 @@ def _load_forge_config(forge_dir, exclusive_config_file, forge_yml=None):
if config["provider"]["linux_s390x"] in {"default", "native"}:
config["provider"]["linux_s390x"] = ["travis"]

config["pinned_packages"] = conda_build.utils.ensure_list(
config["pinned_packages"]
)
config["remote_ci_setup"] = _santize_remote_ci_setup(
config["remote_ci_setup"]
)
Expand Down
7 changes: 7 additions & 0 deletions conda_smithy/templates/build_steps.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ CONDARC
export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1
{%- endif %}

{%- if pinned_packages %}
echo "Configuring pins"
cat >> /opt/conda/conda-meta/pinned <<PINS
{{ "\n".join(pinned_packages) }}
PINS
{%- endif %}

{{ conda_install_tool }} install --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \
pip {{ conda_install_tool_deps }} {{ conda_build_tool_deps }} {{ " ".join(remote_ci_setup) }}
{%- if conda_install_tool == "mamba" and (conda_build_tool_deps != "" or conda_install_tool_deps != "") %}
Expand Down
7 changes: 7 additions & 0 deletions conda_smithy/templates/run_osx_build.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ export CONDA_SOLVER="{{ conda_solver }}"
export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1
{%- endif %}

{%- if pinned_packages %}
echo "Configuring pins"
cat >> ${MINIFORGE_HOME}/conda-meta/pinned <<PINS
{{ "\n".join(pinned_packages) }}
PINS
{%- endif %}

{{ conda_install_tool }} install --update-specs --quiet --yes --channel conda-forge --strict-channel-priority \
pip {{ conda_install_tool_deps }} {{ conda_build_tool_deps }} {{ " ".join(remote_ci_setup) }}
{%- if conda_install_tool == "mamba" and (conda_build_tool_deps != "" or conda_install_tool_deps != "") %}
Expand Down
8 changes: 8 additions & 0 deletions conda_smithy/templates/run_win_build.bat.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ if !errorlevel! neq 0 exit /b !errorlevel!
set "CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1"
{%- endif %}

{%- if pinned_packages %}
echo Configuring pins
{%- for pin in pinned_packages %}
{# CMD echo doesn't take quotes; escape special chars with with ^ #}
echo {{ pin.replace(">", "^>").replace("<", "^<").replace("|", "^|") }} >> %CONDA_PREFIX%\conda-meta\pinned
{%- endfor %}
{%- endif %}

:: Provision the necessary dependencies to build the recipe later
echo Installing dependencies
{{ conda_install_tool }}.exe install "python=3.10" pip {{ conda_install_tool_deps }} {{ conda_build_tool_deps }} {{ " ".join(remote_ci_setup) }} -c conda-forge --strict-channel-priority --yes
Expand Down
23 changes: 23 additions & 0 deletions news/1776-pins
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* New ``pinned_packages`` setting in ``conda-forge.yml`` to constrain the dependencies in the ``base`` environment that provides ``conda-build`` and other tooling. (#1776)

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
Loading