Fix logic to work when appveyor image doesn't have requested python. - #4843
Merged
Conversation
- 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
… want is the one being used
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AppVeyor: use dynamic python detection and export to build environment
Assisted-by: Gemini
Contributor Checklist:
CHANGES.txtandRELEASE.txt(and read theREADME.rst).