Repository navigation
Conversation
| -ArgumentList @( \ | ||
| '/quiet', \ | ||
| 'InstallAllUsers=1', \ | ||
| 'TargetDir=C:\Python', \ |
There was a problem hiding this comment.
IMO we should match -- either C:\Python consistently in the new stuff or update the old images to C:\python (and I have a slight preference for the former, just to avoid even the possibility of breaking someone on the older images).
| def rcVersion: | ||
| env.version | rtrimstr("-rc") | ||
| ; | ||
| def isWindowsZip: |
There was a problem hiding this comment.
lol this looks funny next to is_alpine and is_slim (rcVersion only gets a pass because it matches the term for that we use elsewhere)
| # > phase out the traditional installer by Python 3.16 | ||
| # https://peps.python.org/pep-0773/#replacing-other-installers | ||
| case "${fullVersion}" in | ||
| 3.11.*|3.12.*|3.13.*|3.14.*|3.15.*) | ||
| filename="python-$fullVersion-amd64.exe" | ||
| ;; | ||
| *) | ||
| filename="python-$fullVersion-amd64.zip" | ||
| ;; | ||
| esac |
There was a problem hiding this comment.
Instead of doing {{ if isWindowsZip then "zip" else "exe" end }} over and over in the template, should we store this in versions.json? Maybe store the full url and just trim off the file extension in the template instead?
8f94f87 to
82267b6
Compare
| @@ -1,28 +1,54 @@ | |||
| {{ | |||
| def extension: | |||
| .checksums.windows.url | sub(".*[.]"; "") | |||
There was a problem hiding this comment.
alternatively, split(".")[-1] or perhaps something else?
There was a problem hiding this comment.
Yeah, I think split(".")[-1] is better 👍
| {{ ) else "" end -}} | ||
|
|
||
| RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($env:PYTHON_VERSION -replace '[a-z]+[0-9]*$', ''), $env:PYTHON_VERSION); \ | ||
| RUN $url = '{{ .checksums.windows.url }}'; \ |
There was a problem hiding this comment.
I wish I could use | @sh but I think that would not work for powershell.
There was a problem hiding this comment.
You can't use @sh, but you could use @json and PowerShell's ConvertFrom-Json, probably 👀
There was a problem hiding this comment.
Huh, it's apparently safe enough if we use single quotes and gsub("'"; "''"):
| RUN $url = '{{ .checksums.windows.url }}'; \ | |
| RUN $url = '{{ .checksums.windows.url | gsub("'"; "''") }}'; \ |
(because powershell is very strict about single quoted strings)
| Write-Host 'Re-Installing pip ...'; \ | ||
| # remove zip-provided pip so that we can reinstall and get the exe in c:/python/Scripts | ||
| Remove-Item -Recurse C:/python/Lib/site-packages/pip; \ | ||
| Remove-Item -Recurse C:/python/Lib/site-packages/pip-*; \ |
There was a problem hiding this comment.
Doh, missed these C:/python -> C:/Python swaps (even if it still works 🙃).
ca0f6de to
b7c5ef8
Compare
b7c5ef8 to
593bba9
Compare
See also https://peps.python.org/pep-0773/
With the removal of the traditional executable installer for Windows in 3.16+, we needed to rework the Windows images and either use the Python install manager or the windows zip files directly. Since we don't want to keep
pymanagerinstalled in the resulting image, and it just downloads the same zip files, this PR just uses the zip files directly. (Plus it is complicated to use the.msixor.msiin a container.)The 3.16-rc Windows Dockerfiles are very close to the pypy Windows Dockerfiles now, but the python zip includes the
vcruntimeDLL, so we don't have to install it like pypy.image requirements:
pythonandpipavailable)Possible follow up: