File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change
1
+
2
+ # ! /usr/bin/pwsh
3
+
4
+ # If we are running greater than or equal to python 3.12, change py to run version 3.11
5
+ Write-Host " Checking python version"
6
+ if ((py -3 - c " import sys; print(0 if sys.version_info >= (3, 12) else 1)" ) -eq " 0" ) {
7
+ Write-Host " python 3.12+ detected, setting PY_PYTHON3=3.11"
8
+ # First make sure we have python 3.11 installed
9
+ py -3.11 - c " import imp"
10
+ if ($LASTEXITCODE -eq 0 ) {
11
+ Write-Host " python 3.11 detected, using this version instead of 3.12+."
12
+ Write-Output " PY_PYTHON3=3.11" | Out-File - FilePath $Env: GITHUB_ENV - Encoding utf8 - Append
13
+ } else {
14
+ Write-Host " FAILURE: Python 3.12+ is not supported, and Python 3.11 could not be detected on the system. Please install Python 3.11."
15
+ exit 1
16
+ }
17
+ } else {
18
+ Write-Host " python 3.12+ not detected, not making any changes."
19
+ }
You can’t perform that action at this time.
0 commit comments