gh-108051: Update versions found by find_python.bat and clarify readme (GH-116118)

This commit is contained in:
Steve Dower 2024-02-29 21:24:05 +00:00 committed by GitHub
parent 91c3c64237
commit 83c5ecdeec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 7 deletions

View File

@ -29,6 +29,9 @@
:begin_search :begin_search
@set PYTHON= @set PYTHON=
@rem If PYTHON_FOR_BUILD is set, use that
@if NOT "%PYTHON_FOR_BUILD%"=="" @(set PYTHON="%PYTHON_FOR_BUILD%") && (set _Py_Python_Source=found as PYTHON_FOR_BUILD) && goto :found
@rem If there is an active virtual env, use that one @rem If there is an active virtual env, use that one
@if NOT "%VIRTUAL_ENV%"=="" (set PYTHON="%VIRTUAL_ENV%\Scripts\python.exe") & (set _Py_Python_Source=found in virtual env) & goto :found @if NOT "%VIRTUAL_ENV%"=="" (set PYTHON="%VIRTUAL_ENV%\Scripts\python.exe") & (set _Py_Python_Source=found in virtual env) & goto :found
@ -42,7 +45,9 @@
@if NOT "%HOST_PYTHON%"=="" @%HOST_PYTHON% -Ec "import sys; assert sys.version_info[:2] >= (3, 9)" >nul 2>nul && (set PYTHON="%HOST_PYTHON%") && (set _Py_Python_Source=found as HOST_PYTHON) && goto :found @if NOT "%HOST_PYTHON%"=="" @%HOST_PYTHON% -Ec "import sys; assert sys.version_info[:2] >= (3, 9)" >nul 2>nul && (set PYTHON="%HOST_PYTHON%") && (set _Py_Python_Source=found as HOST_PYTHON) && goto :found
@rem If py.exe finds a recent enough version, use that one @rem If py.exe finds a recent enough version, use that one
@for %%p in (3.11 3.10 3.9) do @py -%%p -EV >nul 2>&1 && (set PYTHON=py -%%p) && (set _Py_Python_Source=found %%p with py.exe) && goto :found @rem It is fine to add new versions to this list when they have released,
@rem but we do not use prerelease builds here.
@for %%p in (3.12 3.11 3.10 3.9) do @py -%%p -EV >nul 2>&1 && (set PYTHON=py -%%p) && (set _Py_Python_Source=found %%p with py.exe) && goto :found
@if NOT exist "%_Py_EXTERNALS_DIR%" mkdir "%_Py_EXTERNALS_DIR%" @if NOT exist "%_Py_EXTERNALS_DIR%" mkdir "%_Py_EXTERNALS_DIR%"
@set _Py_NUGET=%NUGET% @set _Py_NUGET=%NUGET%

View File

@ -226,12 +226,18 @@ directory. This script extracts all the external sub-projects from
and and
https://github.com/python/cpython-bin-deps https://github.com/python/cpython-bin-deps
via a Python script called "get_external.py", located in this directory. via a Python script called "get_external.py", located in this directory.
If Python 3.6 or later is not available via the "py.exe" launcher, the Everything downloaded by these scripts is stored in ..\externals
path or command to use for Python can be provided in the PYTHON_FOR_BUILD (relative to this directory), or the path specified by the EXTERNALS_DIR
environment variable, or get_externals.bat will download the latest environment variable.
version of NuGet and use it to download the latest "pythonx86" package
for use with get_external.py. Everything downloaded by these scripts is The path or command to use for Python can be provided with the
stored in ..\externals (relative to this directory). PYTHON_FOR_BUILD environment variable. If this is not set, an active
virtual environment will be used. If none is active, and HOST_PYTHON is
set to a recent enough version or "py.exe" is able to find a recent
enough version, those will be used. If all else fails, a copy of Python
will be downloaded from NuGet and extracted to the externals directory.
This will then be used for later builds (see PCbuild/find_python.bat
for the full logic).
It is also possible to download sources from each project's homepage, It is also possible to download sources from each project's homepage,
though you may have to change folder names or pass the names to MSBuild though you may have to change folder names or pass the names to MSBuild