Repository navigation
DEV: Detect minor version bumps in make_release.py - #3969
Conversation
Closes py-pdf#3963. `version_bump` always increased the patch version -- "just assume a patch version change" -- so every release with an enhancement had to be corrected by hand at the interactive prompt. The formatted changes already carry the answer: `get_formatted_changes` emits an `### New Features (ENH)` or `### Deprecations (DEP)` section exactly when the release warrants a minor bump. Pass the changes into `version_bump` and key off those two section headers. Checked against the changelog: this rule holds for all 39 releases recorded there, and the function reproduces all 38 version transitions between them. Major bumps stay manual, and the interactive prompt still lets the release manager override the suggestion. Added tests -- make_release.py had none.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3969 +/- ##
=======================================
Coverage 97.94% 97.94%
=======================================
Files 57 57
Lines 11031 11031
Branches 2065 2065
=======================================
Hits 10804 10804
Misses 126 126
Partials 101 101 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This is wrong. Please move the tests to the existing file https://github.com/py-pdf/pypdf/blob/main/tests/scripts/test_make_release.py |
They belong alongside the existing tests for this script, and follow its pytest.importorskip convention rather than a module-level import.
|
You're right, sorry - I did not check tests/scripts/ before adding that file. |
The existing case used a bare ENH, which passes even without the
startswith("### ") guard. A message containing (ENH) exactly as the
header spells it is the case that actually exercises it.
|
Good catch - the case I had used a bare ENH, which passes even without the |
Closes #3963.
version_bumpalways increased the patch version — the comment even says"just assume a patch version change" — so every release with an enhancement
had to be corrected by hand at the interactive prompt.
The formatted changes already carry the answer:
get_formatted_changesemits an
### New Features (ENH)or### Deprecations (DEP)sectionexactly when the release warrants a minor bump. So I pass the changes into
version_bumpand key off those two section headers.I checked the rule against the changelog before implementing it: it holds
for all 39 releases recorded there, and the function reproduces all 38
version transitions between them. Major bumps stay manual, and the
interactive prompt still lets you override the suggestion.
Added tests — make_release.py had none.