From 803195332ca382c81d5d078e51a41f65a77ed97c Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Tue, 11 Aug 2026 16:18:47 +0100 Subject: [PATCH] Update to build on Python 3.15rc1 --- .github/workflows/build.yml | 12 ++++++------ _msbuild.py | 6 +++++- ci/release.yml | 8 ++++---- src/manage/commands.py | 5 ++--- src/manage/firstrun.py | 4 ++-- 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 72f1bc7..47c2fd6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,30 +33,30 @@ jobs: } shell: powershell - #- name: Set up Python 3.14 + #- name: Set up Python 3.15 # uses: actions/setup-python@v5 # with: - # python-version: 3.14-dev + # python-version: 3.15-dev # We move faster than GitHub's Python runtimes, so use NuGet instead # One day we can use ourselves to download Python, but not yet... - name: Set up NuGet uses: nuget/setup-nuget@b26b823c478ee115be5c9403e62c90b0bf943843 # v3.1.0 - - name: Set up Python 3.14.6 + - name: Set up Python 3.15.0rc1 run: | - nuget install python -Version 3.14.6 -x -o . + nuget install python -Version 3.15.0-rc1 -x -o . $py = Get-Item python\tools Write-Host "Adding $py to PATH" "$py" | Out-File $env:GITHUB_PATH -Encoding UTF8 -Append working-directory: ${{ runner.temp }} - - name: Check Python version is 3.14.6 + - name: Check Python version is 3.15.0rc1 run: > python -c "import sys; print(sys.version); print(sys.executable); - sys.exit(0 if sys.version_info[:5] == (3, 14, 6, 'final', 0) else 1)" + sys.exit(0 if sys.version_info[:5] == (3, 15, 0, 'candidate', 1) else 1)" - name: Install build dependencies run: python -m pip install "pymsbuild==1.2.2" diff --git a/_msbuild.py b/_msbuild.py index 7920d9e..ca920d4 100644 --- a/_msbuild.py +++ b/_msbuild.py @@ -6,7 +6,11 @@ DLL_NAME = "python{0.major}{0.minor}".format(sys.version_info) VER_NUM = "{0.major}.{0.minor}.{0.micro}".format(sys.version_info) -EMBED_URL = f"https://www.python.org/ftp/python/{VER_NUM}/python-{VER_NUM}-embed-amd64.zip" +if sys.version_info.releaselevel == "candidate": + VER_NUM_RC = f"rc{sys.version_info.serial}" +else: + VER_NUM_RC = "" +EMBED_URL = f"https://www.python.org/ftp/python/{VER_NUM}/python-{VER_NUM}{VER_NUM_RC}-embed-amd64.zip" def can_embed(tag): """Return False if tag doesn't match DLL_NAME and EMBED_URL. diff --git a/ci/release.yml b/ci/release.yml index 33363e5..59dca7d 100644 --- a/ci/release.yml +++ b/ci/release.yml @@ -95,19 +95,19 @@ stages: displayName: 'Install Nuget' - powershell: | - nuget install python -Version 3.14.6 -x -noninteractive -o host_python + nuget install python -Version 3.15.0-rc1 -x -noninteractive -o host_python $py = Get-Item host_python\python\tools Write-Host "Adding $py to PATH" Write-Host "##vso[task.prependpath]$py" - displayName: Set up Python 3.14.6 + displayName: Set up Python 3.15.0rc1 workingDirectory: $(Build.BinariesDirectory) - powershell: > python -c "import sys; print(sys.version); print(sys.executable); - sys.exit(0 if sys.version_info[:5] == (3, 14, 6, 'final', 0) else 1)" - displayName: Check Python version is 3.14.6 + sys.exit(0 if sys.version_info[:5] == (3, 15, 0, 'candidate', 1) else 1)" + displayName: Check Python version is 3.15.0rc1 - powershell: | python -m pip install "pymsbuild==1.2.2" diff --git a/src/manage/commands.py b/src/manage/commands.py index 225a517..a33865b 100644 --- a/src/manage/commands.py +++ b/src/manage/commands.py @@ -472,10 +472,9 @@ def __init__(self, args, root=None): if not self.default_platform: from _native import get_processor_architecture - LOGGER.debug("Get CPU architecture, its prefix is %s", get_processor_architecture()) + self.default_platform = get_processor_architecture() + LOGGER.debug("Default to current CPU architecture: %s", self.default_platform) - # Currently, we always default to -64. - self.default_platform = "-64" # If our command has any config, load them to override anything that # wasn't set on the command line. diff --git a/src/manage/firstrun.py b/src/manage/firstrun.py index f17ce96..3b944e7 100644 --- a/src/manage/firstrun.py +++ b/src/manage/firstrun.py @@ -413,9 +413,9 @@ def first_run(cmd): LOGGER.print("!Y!The global shortcuts directory is not " "configured.!W!", level=logging.WARN) LOGGER.print("\nConfiguring this enables commands like " - "!B!python3.14.exe!W! to run from your terminal, " + "!B!python3.15.exe!W! to run from your terminal, " "but is not needed for the !B!python!W! or !B!py!W! " - "commands (for example, !B!py -V:3.14!W!).", + "commands (for example, !B!py -V:3.15!W!).", wrap=True) LOGGER.print("\nWe can add the directory (!B!%s!W!) to PATH now, " "but you will need to restart your terminal to use "