* Build the list of available Python builds for selectPythonVersion(). * * Ordered with DEFAULT_PYTHON_VERSION first, then remaining versions in * descending order. Only includes installed, non-discontinued versions. * This preserves the "3.12 preferred" behavior since selectPythonVersion * ret
()
| 146 | * returns the first match. |
| 147 | */ |
| 148 | function getAvailablePythonBuilds(): PythonBuild[] { |
| 149 | const installed = allOptions.filter( |
| 150 | opt => !isDiscontinued(opt) && isInstalled(opt) |
| 151 | ); |
| 152 | const defaultOpt = installed.find(opt => |
| 153 | versionsEqual(opt, DEFAULT_PYTHON_VERSION) |
| 154 | ); |
| 155 | const rest = installed.filter( |
| 156 | opt => !versionsEqual(opt, DEFAULT_PYTHON_VERSION) |
| 157 | ); |
| 158 | const ordered = defaultOpt ? [defaultOpt, ...rest] : rest; |
| 159 | return ordered.map(toPythonBuild); |
| 160 | } |
| 161 | |
| 162 | /** |
| 163 | * Build the list of ALL known Python builds (including discontinued |
no test coverage detected