From 46c8ce407f56979e694d828004afbd635cd22799 Mon Sep 17 00:00:00 2001 From: vvvv-vvvv <136390975+vvvv-vvvv@users.noreply.github.com> Date: Sat, 7 Oct 2023 09:05:12 +0000 Subject: [PATCH] Bump Python version (#14090) * Fix Pip for Bootstrap (#72488) Mothblocks forgot to update the bootstrap script to the new python version when they changed the python dependency version That path descriptor file is now automatically generated during bootstrap, which will prevent this issue from happening again in the future, unless they change the path descriptor format * Bump Python version --------- Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com> --- dependencies.sh | 2 +- tools/bootstrap/python37._pth | 6 ------ tools/bootstrap/python_.ps1 | 7 ++++++- tools/requirements.txt | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) delete mode 100644 tools/bootstrap/python37._pth diff --git a/dependencies.sh b/dependencies.sh index ec9aa5a16b421..38b9c2d5336dc 100644 --- a/dependencies.sh +++ b/dependencies.sh @@ -19,4 +19,4 @@ export SPACEMAN_DMM_VERSION=suite-1.7.2 export SPACEMAN_DMM_COMMIT_HASH=3588de97ff09fdd02d96f178392f3c59b19ebfc4 # Python version for mapmerge and other tools -export PYTHON_VERSION=3.7.9 +export PYTHON_VERSION=3.10.11 diff --git a/tools/bootstrap/python37._pth b/tools/bootstrap/python37._pth deleted file mode 100644 index 4fe54372613d6..0000000000000 --- a/tools/bootstrap/python37._pth +++ /dev/null @@ -1,6 +0,0 @@ -python37.zip -. -..\..\.. - -# Uncomment to run site.main() automatically -import site diff --git a/tools/bootstrap/python_.ps1 b/tools/bootstrap/python_.ps1 index 93a6f756960c6..f37589f106443 100644 --- a/tools/bootstrap/python_.ps1 +++ b/tools/bootstrap/python_.ps1 @@ -49,8 +49,13 @@ if (!(Test-Path $PythonExe -PathType Leaf)) { [System.IO.Compression.ZipFile]::ExtractToDirectory($Archive, $PythonDir) + $PythonVersionArray = $PythonVersion.Split(".") + $PythonVersionString = "python$($PythonVersionArray[0])$($PythonVersionArray[1])" + Write-Output "Generating PATH descriptor." + New-Item "$Cache/$PythonVersionString._pth" | Out-Null + Set-Content "$Cache/$PythonVersionString._pth" "$PythonVersionString.zip`n.`n..\..\..`nimport site`n" # Copy a ._pth file without "import site" commented, so pip will work - Copy-Item "$Bootstrap/python37._pth" $PythonDir ` + Copy-Item "$Cache/$PythonVersionString._pth" $PythonDir ` -ErrorAction Stop Remove-Item $Archive diff --git a/tools/requirements.txt b/tools/requirements.txt index 032ffe66e727f..1a858721d151f 100644 --- a/tools/requirements.txt +++ b/tools/requirements.txt @@ -1,4 +1,4 @@ -pygit2==1.7.2 +pygit2==1.13.1 bidict==0.22.0 Pillow==10.0.1