Skip to content

Commit 43cd474

Browse files
committed
Use python executable & multiline PS args
Replace usage of the Windows py launcher with an explicit python invocation and format the PowerShell call to package-for-dart.ps1 across multiple lines. - workflow: print the python executable (python -c) instead of calling py -3 --version, and invoke the packaging script with PowerShell line continuations for readability. - script: switch compile step in windows/package-for-dart.ps1 from py -3 -m compileall to python -m compileall to avoid relying on the py launcher. These changes make the CI and packaging scripts use the active python interpreter directly and improve command readability in the workflow.
1 parent e77e017 commit 43cd474

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

.github/workflows/build-python.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,13 @@ jobs:
112112
shell: pwsh
113113
run: |
114114
python --version
115-
py -3 --version
115+
python -c "import sys; print(sys.executable)"
116116
- name: Build CPython from sources and package for Dart
117117
shell: pwsh
118118
run: |
119-
.\windows\package-for-dart.ps1 -PythonVersion "${{ env.PYTHON_VERSION }}" -PythonVersionShort "${{ env.PYTHON_VERSION_SHORT }}"
119+
.\windows\package-for-dart.ps1 `
120+
-PythonVersion "${{ env.PYTHON_VERSION }}" `
121+
-PythonVersionShort "${{ env.PYTHON_VERSION_SHORT }}"
120122
- uses: actions/upload-artifact@v4
121123
with:
122124
name: python-windows

windows/package-for-dart.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ foreach ($pattern in $excludePatterns) {
110110
}
111111

112112
# Match existing packaging behavior: bytecode-only stdlib.
113-
py -3 -m compileall -b "$packageRoot\Lib"
113+
python -m compileall -b "$packageRoot\Lib"
114114
Get-ChildItem -Path "$packageRoot\Lib" -Recurse -File -Include *.py,*.typed | Remove-Item -Force
115115
Get-ChildItem -Path "$packageRoot\Lib" -Recurse -Directory -Filter __pycache__ | Remove-Item -Recurse -Force
116116

0 commit comments

Comments
 (0)