Repository navigation
Port colcon-python-project wheel installation & uninstallation utilities to colcon-core - #741
Merged
Merged
Conversation
KmoM88
marked this pull request as draft
June 26, 2026 19:27
cottsay
marked this pull request as ready for review
June 30, 2026 14:40
cottsay
self-requested a review
July 17, 2026 17:02
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #741 +/- ##
==========================================
- Coverage 87.66% 87.60% -0.07%
==========================================
Files 74 75 +1
Lines 4442 4581 +139
Branches 771 797 +26
==========================================
+ Hits 3894 4013 +119
- Misses 433 445 +12
- Partials 115 123 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
cottsay
reviewed
Jul 30, 2026
cottsay
left a comment
Member
There was a problem hiding this comment.
I'll probably have more feedback but I've been sitting on these two comments for a while so I thought I'd get them posted so they can be discussed now.
Hoping I'll have time to finish the review soon 🤞
1. Remove dangling symlinks as part of uninstallation 2. Use POSIX paths in RECORD 3. Attempt to preserve executable permissions when extracting files Assisted-by: Gemini 3.5 Flash <gemini@google.com>
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.
Overview
This PR ports the core Python wheel installation and uninstallation engine from the prototype extension
colcon-python-projectintocolcon-core.Previously,
colcon-coreonly supported legacy setuptools-centric installations that required spawningsetup.pyscripts. As Python platforms move away from directsetup.pyinvocations in favor of standard PEP 517/518 packaging structures, this PR introduces the native utilities required to install PEP 427 wheel archives (.whl) and safely clean up existing package distributions from the installation prefix.By implementing this metadata-driven layout manager directly inside
colcon-core, we establish the foundation for native PEP 517 build task execution and modern dependency resolution.Key Features
1. Metadata-Driven Uninstallation (
remove_distributions)install.logor.egg-infosymlinks in the build folder), the uninstallation utility queries the targetinstall_baseprefix usingInstalledDistribution.discover..egg-linkfiles and recursively removes any empty parent directories up to theinstall_base.2. Wheel Layout Extraction & Mapping (
install_wheel)Root-Is-Purelibmetadata inside the wheel'sWHEELfile..data/directory segments (e.g.package-1.0.data/data/...) inside the wheel ZIP, translating them to their platform-agnostic target locations dynamically via_get_install_path.entry_points.txtand usesdistlib.scripts.ScriptMakerto generate executable script wrappers under the scripts folder.INSTALLER: Marked as installed bycolcon-core.RECORD: Finalizes and writes the cryptographic hash signatures (sha256) and sizes of all extracted and generated files.Verification & Testing
This PR introduces comprehensive unit tests under the test suite:
typical-dist-info,typical-egg-info,typical-egg-link).remove_distributionssuccessfully uninstalls standard, legacy, and egg-linked packages, deletes all associated files, and cleans up empty parent directories while leaving non-empty folders untouched.install_wheelextracts files into correct library paths, builds CLI scripts, maps data files toshare/, and writes validINSTALLERandRECORDfiles.Automated Tests
Run the newly added test suites locally: