Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs for Fall back to PEP 621 project.version #307

Merged
merged 10 commits into from
Mar 2, 2025
Merged

Conversation

coordt
Copy link
Member

@coordt coordt commented Mar 1, 2025

Tweaks on the documentation for PR #306.

pre-commit-ci bot and others added 4 commits February 24, 2025 19:03
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.9.6 → v0.9.7](astral-sh/ruff-pre-commit@v0.9.6...v0.9.7)
- [github.com/jsh9/pydoclint: 0.6.0 → 0.6.2](jsh9/pydoclint@0.6.0...0.6.2)
…ible

When determining the current version, and if
`tool.bumpversion.current_version` is not set, attempt to retrieve the
version from `project.version` à la PEP 621. If that setting is not
set, or if the version is explicitly marked as dynamically set, then
continue with querying SCM tags.

When updating the configuration during bumping, if we previously
successfully retrieved a PEP 621 version, then update the
`project.version` field in `pyproject.toml` as well. We always update,
even if the true current version was read from
`tool.bumpversion.current_version` instead of `project.version`.

The docs have been updated; specifically, the "multiple replacements in
one file" howto and the reference for `current_version`.

The tests have been adapted: the new `pep621_info` property would
otherwise trip up the old test output, and the `None` default would trip
up the TOML serializer. Additionally, new tests assert that
`project.version` (and correspondingly, the `pep621_info` property) is
correctly honored or ignored, depending on the other circumstances.
If the current version is explicitly left empty during the
`sample-config` questionnaire, the resulting `tool.bumpversion` table
now lacks a `current_version` key, and will fall back to PEP 621
`project.version` (if not dynamic). The instruction text specifically
hints at this new functionality.
Fall back to PEP 621 `project.version` before consulting SCM tags
Copy link

github-actions bot commented Mar 1, 2025

Version hint: minor
Current version: 0.32.2
New version (when merged): 0.33.0

Comment ID: Display the version hint-auto-generated

Copy link

github-actions bot commented Mar 1, 2025

PR Preview Action v1.6.0

🚀 View preview at
https://callowayproject.github.io/bump-my-version/pr-preview/pr-307/

Built to branch gh-pages at 2025-03-02 14:04 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copy link

codecov bot commented Mar 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.99%. Comparing base (b786638) to head (782077d).
Report is 16 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #307      +/-   ##
==========================================
+ Coverage   93.63%   93.99%   +0.35%     
==========================================
  Files          29       29              
  Lines        1918     1948      +30     
  Branches      198      204       +6     
==========================================
+ Hits         1796     1831      +35     
+ Misses         92       89       -3     
+ Partials       30       28       -2     
Flag Coverage Δ
python-3.10 93.99% <100.00%> (+0.35%) ⬆️
python-3.11 93.99% <100.00%> (+0.35%) ⬆️
python-3.12 93.99% <100.00%> (+0.35%) ⬆️
python-3.13 93.99% <100.00%> (+0.35%) ⬆️
python-3.8 93.99% <100.00%> (+0.35%) ⬆️
python-3.9 93.99% <100.00%> (+0.35%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@coordt coordt merged commit 610ced6 into master Mar 2, 2025
18 of 19 checks passed
@coordt coordt deleted the pep621-version branch March 2, 2025 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants