Skip to content

Commit

Permalink
Merge pull request #429 from MannLabs/add_bump2version
Browse files Browse the repository at this point in the history
Replace bumpversion with bump-my-version
  • Loading branch information
mschwoer authored Jan 17, 2025
2 parents 64828d2 + 9ee5ac7 commit 6f3aa09
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 40 deletions.
61 changes: 61 additions & 0 deletions .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
[tool.bumpversion]
current_version = "1.9.2"
parse = """(?x)
(?P<major>0|[1-9]\\d*)\\.
(?P<minor>0|[1-9]\\d*)\\.
(?P<patch>0|[1-9]\\d*)
(?:
- # dash separator for pre-release section
(?P<pre_l>[a-zA-Z-]+) # pre_l: pre-release label
(?P<pre_n>0|[1-9]\\d*) # pre_n: pre-release version number
)? # pre-release section is optional
"""
serialize = [
"{major}.{minor}.{patch}-{pre_l}{pre_n}",
"{major}.{minor}.{patch}",
]
search = "{current_version}"
replace = "{new_version}"
regex = false
ignore_missing_version = false
ignore_missing_files = false
tag = false
sign_tags = false
tag_name = "v{new_version}"
tag_message = "Bump version: {current_version} → {new_version}"
allow_dirty = false
commit = true
message = "Bump version: {current_version} → {new_version}"
commit_args = ""
setup_hooks = []
pre_commit_hooks = []
post_commit_hooks = []

[tool.bumpversion.parts.pre_l]
# 'final' is just a dummy, but required to have the versioning compatible with the reusable alphashared workflow
values = ["dev", "final"]
optional_value = "final"

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

[[tool.bumpversion.files]]
filename = "./gui/src/main/modules/profile.js"

[[tool.bumpversion.files]]
filename = "./gui/package.json"

[[tool.bumpversion.files]]
filename = "./release/macos/info.plist"

[[tool.bumpversion.files]]
filename = "./release/linux/control"

[[tool.bumpversion.files]]
filename = "./release/macos/build_package_macos.sh"

[[tool.bumpversion.files]]
filename = "./release/macos/distribution.xml"

[[tool.bumpversion.files]]
filename = "./release/windows/alphadia_innoinstaller.iss"
24 changes: 24 additions & 0 deletions .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Bump the version for releases
# Requires a .bumpversion.toml file in the root of the repository
name: Bump version

on:
workflow_dispatch:
inputs:
bump_type:
description: 'Bump type'
required: true
default: 'patch'
type: choice
options:
- prerelease
- patch
- minor
- major

jobs:
bump-version:
uses: MannLabs/alphashared/.github/workflows/bump_version.yml@v1
secrets: inherit
with:
bump_type: ${{inputs.bump_type}}
1 change: 1 addition & 0 deletions .github/workflows/publish_on_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
# see the documentation of the workflow for more information on the parameters
package_name: alphadia
tag_to_release: ${{ inputs.tag_to_release }}
test_stable: true
secrets:
test_pypi_api_token: ${{ secrets.TEST_PYPI_API_TOKEN }}
pypi_api_token: ${{ secrets.PYPI_API_TOKEN }}
2 changes: 0 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,3 @@ repos:
- id: ruff-format
- id: ruff
args: [ '--fix' ]

exclude: .bumpversion.cfg
36 changes: 0 additions & 36 deletions misc/.bumpversion.cfg

This file was deleted.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ version = {attr = "alphadia.__version__"}
alphadia = "alphadia.cli:run"

[tool.ruff]
extend-exclude = ["misc/.bumpversion.cfg"]
extend-exclude = ["tests"]


[tool.ruff.lint]
select = [
Expand Down
1 change: 1 addition & 0 deletions release/linux/build_installer_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ CPU_OR_GPU=${1:-CPU}

rm -rf dist_pyinstaller build_pyinstaller


WHL_NAME=$(cd dist && ls ./*.whl && cd ..)
pip install "dist/${WHL_NAME}[stable]"

Expand Down
1 change: 1 addition & 0 deletions release/macos/build_installer_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ rm -rf dist_pyinstaller build_pyinstaller

export EAGER_IMPORT=true # TODO check if this can be removed with newest peptdeep version w/out transformer dependency


WHL_NAME=$(cd dist && ls ./*.whl && cd ..)
pip install "dist/${WHL_NAME}[stable]"

Expand Down
1 change: 1 addition & 0 deletions release/windows/build_installer_windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue ./build_pyinstaller
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue ./dist_pyinstaller


$WHL_NAME = (Get-ChildItem -Path "dist" -Filter "*.whl").Name
pip install "dist/$WHL_NAME[stable]"

Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements_development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jupyter_contrib_nbextensions
pyinstaller

twine
bumpversion
bump-my-version
pipdeptree
ipykernel
psutil
Expand Down

0 comments on commit 6f3aa09

Please sign in to comment.