MCPcopy Create free account
hub / github.com/ResearAI/DeepScientist / createPythonRuntimePlan

Function createPythonRuntimePlan

bin/ds.js:2309–2360  ·  view source on GitHub ↗
({ condaProbes = [], pathProbes = [], minimumVersionRequest = minimumPythonRequest() })

Source from the content-addressed store, hash-verified

2307}
2308
2309function createPythonRuntimePlan({ condaProbes = [], pathProbes = [], minimumVersionRequest = minimumPythonRequest() }) {
2310 const validConda = condaProbes.find((probe) => pythonMeetsMinimum(probe)) || null;
2311 if (validConda) {
2312 return {
2313 runtimeKind: 'system',
2314 selectedProbe: validConda,
2315 source: 'conda',
2316 sourceLabel: validConda.sourceLabel,
2317 };
2318 }
2319 const firstConda = condaProbes[0] || null;
2320 if (firstConda) {
2321 return {
2322 runtimeKind: 'managed',
2323 selectedProbe: null,
2324 rejectedProbe: firstConda,
2325 source: 'conda',
2326 sourceLabel: pythonSelectionLabel('uv-managed'),
2327 minimumVersionRequest,
2328 };
2329 }
2330
2331 const validPath = pathProbes.find((probe) => pythonMeetsMinimum(probe)) || null;
2332 if (validPath) {
2333 return {
2334 runtimeKind: 'system',
2335 selectedProbe: validPath,
2336 source: 'path',
2337 sourceLabel: validPath.sourceLabel,
2338 };
2339 }
2340 const firstPath = pathProbes[0] || null;
2341 if (firstPath) {
2342 return {
2343 runtimeKind: 'managed',
2344 selectedProbe: null,
2345 rejectedProbe: firstPath,
2346 source: 'path',
2347 sourceLabel: pythonSelectionLabel('uv-managed'),
2348 minimumVersionRequest,
2349 };
2350 }
2351
2352 return {
2353 runtimeKind: 'managed',
2354 selectedProbe: null,
2355 rejectedProbe: null,
2356 source: 'uv-managed',
2357 sourceLabel: pythonSelectionLabel('uv-managed'),
2358 minimumVersionRequest,
2359 };
2360}
2361
2362function printManagedPythonFallbackNotice({ rejectedProbe, source, minimumVersionRequest, installDir }) {
2363 if (!rejectedProbe) {

Callers 1

resolvePythonRuntimePlanFunction · 0.85

Calls 4

minimumPythonRequestFunction · 0.85
pythonMeetsMinimumFunction · 0.85
pythonSelectionLabelFunction · 0.85
findMethod · 0.80

Tested by

no test coverage detected