From a82bbabb8e0881367d0c1c9db31f6da3d2ecd39a Mon Sep 17 00:00:00 2001 From: Emily Soth Date: Mon, 21 Oct 2024 15:27:37 -0700 Subject: [PATCH] read conda dependencies from plugin metadata --- workbench/src/main/setupAddPlugin.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/workbench/src/main/setupAddPlugin.js b/workbench/src/main/setupAddPlugin.js index 745d143e7..414891d99 100644 --- a/workbench/src/main/setupAddPlugin.js +++ b/workbench/src/main/setupAddPlugin.js @@ -38,8 +38,14 @@ export default function setupAddPlugin() { // Create a conda env containing the plugin and its dependencies const envName = `invest_plugin_${pluginID}`; const mamba = settingsStore.get('mamba'); + let depString = ''; + if (pyprojectTOML.conda_dependencies) { + depString = pyprojectTOML.conda_dependencies.map( + (dependency) => `"${dependency}"` + ).join(' '); + } execSync( - `${mamba} create --yes --name ${envName} -c conda-forge "python<3.12" "gdal<3.6"`, + `${mamba} create --yes --name ${envName} -c conda-forge ${depString}`, { stdio: 'inherit', windowsHide: true } ); logger.info('created mamba env for plugin');