From ca393f3d1c99e8d1c0674ead233dfacfb2ef3353 Mon Sep 17 00:00:00 2001 From: Kaniska Date: Thu, 9 Apr 2026 10:40:09 +0000 Subject: [PATCH] [conda] - Upgrade incompatible pluggy library to prevent conda installation failure. --- src/conda/devcontainer-feature.json | 2 +- src/conda/install.sh | 3 +++ test/conda/conda_channel_creation.sh | 14 ++++++++++++++ .../install_conda_package_after_upgrade.sh | 18 ++++++++++++++++++ test/conda/scenarios.json | 12 ++++++++++++ 5 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 test/conda/conda_channel_creation.sh create mode 100644 test/conda/install_conda_package_after_upgrade.sh diff --git a/src/conda/devcontainer-feature.json b/src/conda/devcontainer-feature.json index cd590f9b7..d78e6c92b 100644 --- a/src/conda/devcontainer-feature.json +++ b/src/conda/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "conda", - "version": "1.2.5", + "version": "1.2.6", "name": "Conda", "description": "A cross-platform, language-agnostic binary package manager", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/conda", diff --git a/src/conda/install.sh b/src/conda/install.sh index 73925dd5d..2e312ac58 100644 --- a/src/conda/install.sh +++ b/src/conda/install.sh @@ -179,6 +179,9 @@ if ! conda --version &> /dev/null ; then install_user_package cryptography # Due to https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-40897 install_user_package setuptools + + install_user_package pluggy + fi # Display a notice on conda when not running in GitHub Codespaces diff --git a/test/conda/conda_channel_creation.sh b/test/conda/conda_channel_creation.sh new file mode 100644 index 000000000..d6409a38f --- /dev/null +++ b/test/conda/conda_channel_creation.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +## Test Conda +check "conda-update-conda" bash -c "conda update -c defaults -y conda" +check "conda-install-tensorflow" bash -c "conda create --name test-env -c conda-forge --yes tensorflow" +check "conda-install-pytorch" bash -c "conda create --name test-env -c conda-forge --yes pytorch" + +# Report result +reportResults diff --git a/test/conda/install_conda_package_after_upgrade.sh b/test/conda/install_conda_package_after_upgrade.sh new file mode 100644 index 000000000..cb61c6b65 --- /dev/null +++ b/test/conda/install_conda_package_after_upgrade.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Test that conda can install packages without pluggy incompatibility errors +# This validates the fix for the pluggy/conda version mismatch issue where +# conda self-upgrades but the older pluggy lacks the 'wrapper' attribute +check "conda version" conda --version +check "install pyopenssl" conda install -y -c defaults pyopenssl +check "install cryptography" conda install -y -c defaults cryptography +check "conda-forge" conda config --show channels | grep conda-forge +check "if conda-notice.txt exists" cat /usr/local/etc/vscode-dev-containers/conda-notice.txt + +# Report result +reportResults diff --git a/test/conda/scenarios.json b/test/conda/scenarios.json index ef930a17c..531f32938 100644 --- a/test/conda/scenarios.json +++ b/test/conda/scenarios.json @@ -7,5 +7,17 @@ "addCondaForge": "true" } } + }, + "install_conda_package_after_upgrade": { + "image": "ubuntu:noble", + "features": { + "conda": {} + } + }, + "conda_channel_creation": { + "image": "ubuntu:noble", + "features": { + "conda": {} + } } }