({ condaProbes = [], pathProbes = [], minimumVersionRequest = minimumPythonRequest() })
| 2307 | } |
| 2308 | |
| 2309 | function 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 | |
| 2362 | function printManagedPythonFallbackNotice({ rejectedProbe, source, minimumVersionRequest, installDir }) { |
| 2363 | if (!rejectedProbe) { |
no test coverage detected