Skip to content

Update Python version on Windows #1382

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

Merged
merged 7 commits into from
Mar 17, 2025
Merged

Conversation

mthalman
Copy link
Member

@mthalman mthalman commented Mar 6, 2025

The Python version in the Windows Helix Dockerfiles is outdated. This ensures it gets the latest. This is a port of the changes that originally existed in #1336.

@mthalman mthalman requested a review from dougbu March 6, 2025 20:29
@mthalman mthalman requested review from a team as code owners March 6, 2025 20:29
Copy link
Contributor

@dougbu dougbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed the first file. am I correct that the other Dockerfiles are different mainly around base images and such❓

@mthalman
Copy link
Member Author

This is getting a hadolint error:

/github/workspace/src/nanoserver/1809/helix/amd64/Dockerfile:35 SC1072 error:  Fix any mentioned problems and try again.

Caused by this line: for %f in (.\helix_scripts-*-py3-none-any.whl) do (pip install %f)

What's notable is that this line hasn't been changed in this PR. It's the other changes in this PR that have now exposed this hadolint parsing issue: hadolint/hadolint#436

@mthalman
Copy link
Member Author

I fixed the linting issue by rewriting the logic to use PowerShell instead.

@dougbu
Copy link
Contributor

dougbu commented Mar 12, 2025

not sure of the include capabilities that may be available here. is it possible to consolidate the many common pieces of these 4 DockerFiles❓

@mthalman
Copy link
Member Author

not sure of the include capabilities that may be available here. is it possible to consolidate the many common pieces of these 4 DockerFiles❓

I would love that and have wanted it for a while now. I thought we had an issue for it, but I guess not. So I logged it: #1393

Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\corerun.exe' -Value 2 -Name DumpType -Force ; `
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\corerun.exe' -Value 'C:\cores' -Name DumpFolder -Force ; `
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\corerun.exe' -Value 2 -Name DumpCount -Force
RUN setx /M PATH "%PATH%;C:\Program Files\PowerShell\;C:\Python;C:\python\scripts" && `
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't break anything (I hope) but suggest defining %VIRTUAL_ENV% first then including %VIRTUAL_ENV%\\Scripts in %PATH%

@mthalman mthalman requested a review from dougbu March 13, 2025 15:44
Copy link
Contributor

@dougbu dougbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to ping me again but do reorder $env:PATH so the venv "wins" once created b/4 merging

@mthalman mthalman enabled auto-merge (squash) March 17, 2025 14:40
@mthalman mthalman merged commit aeb3d7e into dotnet:main Mar 17, 2025
13 checks passed
@mthalman mthalman deleted the windows-python branch March 17, 2025 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants