Skip to content

Commit

Permalink
Fix versioning of development versions
Browse files Browse the repository at this point in the history
  • Loading branch information
coordt committed Oct 22, 2023
1 parent 5ebb0d7 commit e89599f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ jobs:
- name: Set dev version
shell: bash
run: |
export PR_NUMBER=$(gh pr view --json number -q .number || echo "")
bump-my-version bump dev bumpversion/__init__.py --no-commit --no-configured-files -v
- name: Package
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,15 @@ commit_args = "--no-verify"
tag = true
tag_name = "{new_version}"
allow_dirty = true
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)(\\.(?P<dev>dev)\\d+\\+[-_a-zA-Z0-9]+)?"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)(\\.(?P<dev>post)\\d+\\.dev\\d+)?"
serialize = [
"{major}.{minor}.{patch}.{dev}{distance_to_latest_tag}+{short_branch_name}",
"{major}.{minor}.{patch}.{dev}{$PR_NUMBER}.dev{distance_to_latest_tag}",
"{major}.{minor}.{patch}"
]
message = "Version updated from {current_version} to {new_version}"

[tool.bumpversion.parts.dev]
values = ["release", "dev"]
values = ["release", "post"]

[[tool.bumpversion.files]]
filename = "bumpversion/__init__.py"
Expand Down

0 comments on commit e89599f

Please sign in to comment.