PYTHON-5839 - PyMongo wheels have multiple versions of C extensions#2865
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses PYTHON-5839 by ensuring in-place built C extension artifacts don’t persist between cibuildwheel builds for different Python versions, preventing multiple extension versions from being unintentionally included across wheels.
Changes:
- Replace the old targeted cleanup logic with a generic cleanup that removes
*.soand*.pydartifacts frombson/andpymongo/. - Configure
cibuildwheelviaCIBW_BEFORE_BUILDin the dist workflow to run the cleanup before each wheel build.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
tools/clean.py |
Simplifies cleanup by deleting any *.so/*.pyd under bson and pymongo before each build. |
.github/workflows/dist.yml |
Adds CIBW_BEFORE_BUILD hook so cleanup runs before each cibuildwheel build iteration. |
Contributor
Author
|
Old output: New output: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
PYTHON-5839
Changes in this PR
Clean up built C extensions after each version to prevent them from leaking into the next wheel.
Test Plan
Tested with dist CI checks.
Checklist
Checklist for Author
[ ] Did you update the changelog (if necessary)?[ ] Is there test coverage?[ ] Is any followup work tracked in a JIRA ticket? If so, add link(s).Checklist for Reviewer