diff --git a/backend/windmill-worker/src/python_executor.rs b/backend/windmill-worker/src/python_executor.rs index 66170aa5ab..db26a4cedf 100644 --- a/backend/windmill-worker/src/python_executor.rs +++ b/backend/windmill-worker/src/python_executor.rs @@ -83,14 +83,24 @@ pub async fn pip_compile( WORKER_CONFIG.read().await.pip_local_dependencies.as_ref() { let deps = pip_local_dependencies.clone(); + let compiled_deps = deps.iter().map(|dep| { + let compiled_dep = Regex::new(dep); + match compiled_dep { + Ok(compiled_dep) => Some(compiled_dep), + Err(e) => { + tracing::warn!("regex compilation failed for Python local dependency: '{}' - it will be ignored", e); + return None; + } + } + }).filter(|dep_maybe| dep_maybe.is_some()).map(|dep| dep.unwrap()).collect::>(); requirements .lines() .filter(|s| { - if !deps.contains(&s.to_string()) { - return true; - } else { + if compiled_deps.iter().any(|dep| dep.is_match(s)) { logs.push_str(&format!("\nignoring local dependency: {}", s)); return false; + } else { + return true; } }) .join("\n") @@ -566,7 +576,7 @@ async fn handle_python_deps( }; if requirements.len() > 0 { - additional_python_paths = handle_python_reqs( + let mut venv_path = handle_python_reqs( requirements .split("\n") .filter(|x| !x.starts_with("--")) @@ -582,6 +592,7 @@ async fn handle_python_deps( worker_dir, ) .await?; + additional_python_paths.append(&mut venv_path); } Ok(additional_python_paths) } diff --git a/frontend/src/lib/components/Section.svelte b/frontend/src/lib/components/Section.svelte index 98a26b63b1..daaaba4830 100644 --- a/frontend/src/lib/components/Section.svelte +++ b/frontend/src/lib/components/Section.svelte @@ -1,17 +1,32 @@

- {label} + {#if collapsable} + + {:else} + {label} + {/if} + {#if tooltip} {tooltip} @@ -27,7 +42,7 @@

-
+
diff --git a/frontend/src/lib/components/WorkspaceGroup.svelte b/frontend/src/lib/components/WorkspaceGroup.svelte index d55ccd67f3..804cda91d3 100644 --- a/frontend/src/lib/components/WorkspaceGroup.svelte +++ b/frontend/src/lib/components/WorkspaceGroup.svelte @@ -26,6 +26,8 @@ priority_tags?: Map cache_clear?: number init_bash?: string + additional_python_paths?: string[] + pip_local_dependencies?: string[] } export let activeWorkers: number export let customTags: string[] | undefined @@ -38,6 +40,8 @@ init_bash?: string env_vars_static?: Map env_vars_allowlist?: string[] + additional_python_paths?: string[] + pip_local_dependencies?: string[] } = {} function loadNConfig() { @@ -402,11 +406,110 @@ > {/if} {/if} + +
+
+
+ Additional Python Paths + {#each nconfig.additional_python_paths ?? [] as additional_python_path, i} +
+ + +
+ {/each} +
+ +
+ + PIP local dependencies + {#each nconfig.pip_local_dependencies ?? [] as pip_local_dependency, i} +
+ + +
+ {/each} +
+ +
+
+
+
{#each customEnvVars as envvar, i}