Skip to content

Fix logic to work when appveyor image doesn't have requested python. - #4843

Merged
bdbaddog merged 22 commits into
SCons:masterfrom
bdbaddog:fix_py312_appveyor
Apr 8, 2026
Merged

Fix logic to work when appveyor image doesn't have requested python.#4843
bdbaddog merged 22 commits into
SCons:masterfrom
bdbaddog:fix_py312_appveyor

Conversation

@bdbaddog

@bdbaddog bdbaddog commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

AppVeyor: use dynamic python detection and export to build environment

  • Use Get-Command to find the path of the requested Python version.
  • Export SCONS_PYTHON_BIN, PYSITEDIR, and coverage variables using Set-AppveyorBuildVariable to ensure they persist across shell steps.
  • Update test and coverage scripts to use the exported python path.
  • This ensures Python 3.12 and newer are correctly located and used even if the path differs from the hardcoded C:\Python... defaults.

Assisted-by: Gemini

Contributor Checklist:

  • I have created a new test or updated the unit tests to cover the new/changed functionality.
  • I have updated CHANGES.txt and RELEASE.txt (and read the README.rst).
  • I have updated the appropriate documentation

bdbaddog added 22 commits March 29, 2026 21:52
- Use Get-Command to find the path of the requested Python version.
- Export SCONS_PYTHON_BIN, PYSITEDIR, and coverage variables using
  Set-AppveyorBuildVariable to ensure they persist across shell steps.
- Update test and coverage scripts to use the exported python path.
- This ensures Python 3.12 and newer are correctly located and used
  even if the path differs from the hardcoded C:\Python... defaults.

Assisted-by: Gemini
- Created .appveyor/run_tests.ps1 for test execution logic.
- Created .appveyor/codecov_upload.bat for coverage uploads.
- Moved coverage check logic into install-cov.ps1.
- Simplified .appveyor.yml by calling scripts directly.
- Standardized use of SCONS_PYTHON_BIN across scripts.

Assisted-by: Gemini
- Added Write-Host statements to all .ps1 scripts in .appveyor/
- This aids in debugging build logs to identify script boundaries.

Assisted-by: Gemini
…was installed via choco

- In install.ps1, if the pre-installed Python version check fails and
  Python is installed via Chocolatey, move the Chocolatey bin directory
  to the beginning of the extraPaths array.
- This ensures the newly installed Python is prioritized in the PATH.

Assisted-by: Gemini
- Move the environment PATH update before calling Get-Command.
- This ensures that if a new Python was installed via Chocolatey,
  it is found instead of any pre-existing Python (like 2.7) in the
  original system PATH.

Assisted-by: Gemini
…MSYS2

- When using Chocolatey, do not add C:\PythonXX paths as they may be
  non-existent or corrupted.
- Prioritize Python-related paths (including Chocolatey bin) before
  any tool paths like MSYS2 or Cygwin.
- Update detection logic to explicitly exclude any python.exe shims
  found within MSYS2 or Cygwin directories.

Assisted-by: Gemini
- Derive specName (e.g. python3.10.exe) from WINPYTHON.
- Fix syntax error in the python detection loop.
- Add verbose logging for shims that are not found.

Assisted-by: Gemini
… found

- Remove pre-emptive C:\PythonXX\Scripts from initial pythonPaths.
- Dynamically add the Scripts folder corresponding to the found
  pythonExe to the PATH inside the detection loop.
- Fix bug where SCONS_PYTHON_BIN was called before it was initialized.

Assisted-by: Gemini
…y shims

- Ensure C:\PythonXX is added to pythonPaths if it exists, even if
  installed via Chocolatey.
- This allows the script to resolve the real python.exe and its
  corresponding Scripts directory, avoiding issues with shims.

Assisted-by: Gemini
@bdbaddog
bdbaddog merged commit 05e214e into SCons:master Apr 8, 2026
@bdbaddog
bdbaddog deleted the fix_py312_appveyor branch April 8, 2026 02:16
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.

1 participant