Implement pip bootstrap in Python virtual environment - #14767
Implement pip bootstrap in Python virtual environment#14767bytesByHarsh wants to merge 1 commit into
Conversation
Added function to ensure pip is installed in Python virtual environment
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #14767 +/- ##
==========================================
+ Coverage 25.47% 32.65% +7.18%
==========================================
Files 769 784 +15
Lines 65912 67564 +1652
Branches 30495 31292 +797
==========================================
+ Hits 16788 22066 +5278
+ Misses 37285 30620 -6665
- Partials 11839 14878 +3039
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Build ResultsPlatform Status
All builds passed. Pre-commit
Pre-commit hooks: 0 passed, 0 failed, 0 skipped. Test Resultslinux-coverage-integration: 37 passed, 0 skipped Code Coverage
Artifact Sizes
Updated: 2026-08-03 10:47:47 UTC • Commit: 8395d85 • Triggered by: Android |
There was a problem hiding this comment.
Pull request overview
Adds pip bootstrapping to QGroundControl’s CMake-managed Python environment for MAVLink generation.
Changes:
- Detects missing pip and installs it through
ensurepip. - Adds failure diagnostics and applies the check to existing venv paths.
Suppressed comments (1)
cmake/modules/PythonVenv.cmake:114
- For a stale existing venv without pip, this sync runs first. If
uvis unavailable,install_python.pyimmediately invokespython -m pipand the configure fails before_qgc_ensure_pipcan repair the environment. Bootstrap before the sync as well, while retaining the post-sync check in case syncing removes pip.
_qgc_ensure_pip("${_qgc_venv_python}")
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
| _qgc_sync_venv_if_stale("${_qgc_venv_python}") | ||
| _qgc_ensure_pip("${_qgc_venv_python}") |
|
I'm not sure I want some sort of hybrid support for an externally created environment. I'd rather just have a clear failure when it doesn't work. To me it just creates additional maintenance surface area. |
|
Thanks @bytesByHarsh for identifying this problem — the failure mode is real and worth fixing. We've decided to take a different approach in #14784: since QGC's own tooling always creates If you have strong disagreement with this direction, please comment here on why — happy to discuss. |
|
In reality the idea what QGC would automatically fix an environment which it didn't create itself doesn't seem like the greatest idea. |
A hand-rolled 'uv venv' (without --seed) creates a pip-less venv. QGC reuses it and configure later dies inside the mavlink CPM build with an opaque 'Python pip not found' error. Detect the missing pip up front and fail with instructions instead. Replaces mavlink#14767, which auto-bootstrapped pip via ensurepip; a read-only diagnostic avoids CMake silently mutating a user-managed venv.
A hand-rolled 'uv venv' (without --seed) creates a pip-less venv. QGC reuses it and configure later dies inside the mavlink CPM build with an opaque 'Python pip not found' error. Detect the missing pip up front and fail with instructions instead. Replaces #14767, which auto-bootstrapped pip via ensurepip; a read-only diagnostic avoids CMake silently mutating a user-managed venv.
A hand-rolled 'uv venv' (without --seed) creates a pip-less venv. QGC reuses it and configure later dies inside the mavlink CPM build with an opaque 'Python pip not found' error. Detect the missing pip up front and fail with instructions instead. Replaces #14767, which auto-bootstrapped pip via ensurepip; a read-only diagnostic avoids CMake silently mutating a user-managed venv.
|
Yes, agreed! #14784 is better. |
Added a function to ensure pip is installed in a Python virtual environment
Primarily if the virtual environment is managed via
uv.