Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downgrade bundled Python to 3.9.13 on Windows #367

Merged
merged 1 commit into from
Jul 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
62 changes: 62 additions & 0 deletions dependencies/windows_amd64/portablepy.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# MIT License
# Adapted from https://github.com/dreamsavior/portable-python-maker

param ($source, $destination, $pythonVersion)

if (!$source) {
$source = 'https://www.python.org/ftp/python/3.9.13/python-3.9.13-embed-amd64.zip'
}

if (!$pythonVersion) {
$source -match '.+\/python-(\d+)\.(\d+)\..+'
$Matches
$pythonMajorVersion = "python$($Matches[1])"
$pythonVersion = "python$($Matches[1])$($Matches[2])"
}

if (!$destination) {
$destination = '.\'
}


"You're installing $($pythonVersion) into $($destination)"

New-Item -ItemType Directory -Force -Path "$($destination)"

# Destination to save the file
$package = "$($destination)embedpython.zip"

#Download the file
"Downloading package from $($source)"
Invoke-WebRequest -Uri $source -OutFile $package
Expand-Archive -Path $package -DestinationPath $destination


"Writing $($pythonVersion)._pth"

"Lib/site-packages
.\$($pythonVersion).zip
.

# Uncomment to run site.main() automatically
import site
" | Out-File -FilePath "$($destination)$($pythonVersion)._pth" -encoding ASCII


"Creating DLLs dir"
mkdir "$($destination)DLLs"

"copy python.exe to $($pythonMajorVersion).exe"
cp "$($destination)python.exe" "$($destination)$($pythonMajorVersion).exe"


"Installing PIP"
"You will see some warning about the $($destination)Scripts folder not on your SYSTEM PATH. That is NORMAL!"
Invoke-WebRequest -OutFile "$($destination)get-pip.py" "https://bootstrap.pypa.io/get-pip.py"
& "$($destination)python.exe" "$($destination)get-pip.py"

"Cleaning up"
Remove-Item -Path "$($package)" -Confirm:$false -Force
Remove-Item -Path "$($destination)get-pip.py" -Confirm:$false -Force

"Done!"
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
650 changes: 0 additions & 650 deletions dependencies/windows_amd64/python-3.11.0a4.amd64/LICENSE.txt

This file was deleted.

147 changes: 0 additions & 147 deletions dependencies/windows_amd64/python-3.11.0a4.amd64/Lib/__future__.py

This file was deleted.

This file was deleted.

This file was deleted.

Empty file.

This file was deleted.

This file was deleted.

Loading