Fixup eachdist.py handling of package names - #5417
Merged
Merged
Conversation
While at it also introduce tests
Checking for substrings is not precise enough, let's check for the metadata we have in pyproject.toml.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes release-time version bump issues in scripts/eachdist.py where a package name that is a prefix of another package name could be matched and updated incorrectly. This improves correctness of release tooling and adds CI coverage for the regression.
Changes:
- Tightened package filtering for version-file updates by matching
project.nameinstead of substring matching on paths. - Tightened dependency-update regexes to avoid prefix collisions (and added support for optional extras like
pkg[extra]). - Added a dedicated
test-scriptstox env + GitHub Actions job, along with unit tests foreachdist.py.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
scripts/eachdist.py |
Fixes overly-broad package/regex matching that could bump the wrong package when names overlap by prefix. |
scripts/tests/test_eachdist.py |
Adds regression tests covering the prefix-matching scenarios for deps and version-file updates. |
scripts/tests/test-requirements.txt |
Adds dependencies needed to run the new script tests under tox. |
tox.ini |
Introduces test-scripts tox environment wired to run scripts/tests. |
.github/workflows/misc.yml |
Runs the new test-scripts tox environment in CI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
We have an annoying bug in eachdist.py that we get at release time when it bumps wrongly some packages because their name is a subset for another. It looks like this was two different issues and not just one: a not strict enough regexp and not strict enough check of the package name when looping over them.
Fixes #5227
Closes #5237
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Does This PR Require a Contrib Repo Change?
Checklist: