From 105fdff98d10ba206c9243c1c1e826e659ea51a0 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 31 Oct 2023 15:54:13 -0400 Subject: Consolidate conda_setup_headless() from main.c --- src/conda.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/conda.c b/src/conda.c index 0d3e0da..f18d2d1 100644 --- a/src/conda.c +++ b/src/conda.c @@ -111,7 +111,6 @@ int conda_activate(const char *root, const char *env_name) { perror(logfile); return -1; } - static char buf[1024]; int i = 0; while (!feof(fp)) { char buf[BUFSIZ] = {0}; @@ -153,6 +152,21 @@ int conda_activate(const char *root, const char *env_name) { return 0; } +void conda_setup_headless() { + // Configure conda for headless CI + conda_exec("config --system --set auto_update_conda false"); + conda_exec("config --system --set always_yes true"); + conda_exec("config --system --set quiet true"); + conda_exec("config --system --set rollback_enabled false"); + conda_exec("config --system --set report_errors false"); + + // make this configurable + //if (conda_exec("update --all")) { + // fprintf(stderr, "conda update was unsuccessful\n"); + // exit(1); + //} +} + void conda_env_create_from_uri(char *name, char *uri) { char env_command[PATH_MAX]; sprintf(env_command, "env create -n %s -f %s", name, uri); -- cgit