diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f095c16c..1dd9320d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -53,7 +53,8 @@ jobs: - name: "Verify bump version config" run: | - bump2version --dry-run --list release + bump-my-version bump --dry-run release + bump-my-version show-bump # run black separately from flake8 to get a diff - name: "Run black" diff --git a/templates/github/.ci/assets/release_requirements.txt.j2 b/templates/github/.ci/assets/release_requirements.txt.j2 index c064e947..6635a872 100644 --- a/templates/github/.ci/assets/release_requirements.txt.j2 +++ b/templates/github/.ci/assets/release_requirements.txt.j2 @@ -1,3 +1,3 @@ -bump2version +bump-my-version gitpython towncrier diff --git a/templates/github/.github/workflows/create-branch.yml.j2 b/templates/github/.github/workflows/create-branch.yml.j2 index d9019def..03e4aa8f 100644 --- a/templates/github/.github/workflows/create-branch.yml.j2 +++ b/templates/github/.github/workflows/create-branch.yml.j2 @@ -27,7 +27,7 @@ jobs: {{ setup_python() | indent(6) }} - {{ install_python_deps(["bump2version", "packaging", "-r", "plugin_template/requirements.txt"]) | indent(6) }} + {{ install_python_deps(["bump-my-version", "packaging", "-r", "plugin_template/requirements.txt"]) | indent(6) }} {{ set_secrets(path=plugin_name) | indent(6) }} @@ -36,7 +36,7 @@ jobs: run: | # Just to be sure... git checkout {{ plugin_default_branch }} - NEW_BRANCH="$(bump2version --dry-run --list release | sed -Ene 's/^new_version=([[:digit:]]+\.[[:digit:]]+)\..*$/\1/p')" + NEW_BRANCH="$(bump-my-version show new_version --increment release | sed -Ene 's/^([[:digit:]]+\.[[:digit:]]+)\.[[:digit:]]+$/\1/p')" if [ -z "$NEW_BRANCH" ] then echo Could not determine the new branch name. @@ -52,7 +52,7 @@ jobs: - name: Bump version on {{ plugin_default_branch }} branch working-directory: {{ plugin_name }} run: | - bump2version --no-commit minor + bump-my-version bump --no-commit minor - name: Remove entries from CHANGES directory working-directory: {{ plugin_name }} diff --git a/templates/github/.github/workflows/lint.yml.j2 b/templates/github/.github/workflows/lint.yml.j2 index dd88d444..58075c8d 100644 --- a/templates/github/.github/workflows/lint.yml.j2 +++ b/templates/github/.github/workflows/lint.yml.j2 @@ -30,7 +30,8 @@ jobs: - name: "Verify bump version config" run: | - bump2version --dry-run --list release + bump-my-version bump --dry-run release + bump-my-version show-bump {%- if black %} # run black separately from flake8 to get a diff diff --git a/templates/github/.github/workflows/release.yml.j2 b/templates/github/.github/workflows/release.yml.j2 index 85981a48..d33c6e0b 100644 --- a/templates/github/.github/workflows/release.yml.j2 +++ b/templates/github/.github/workflows/release.yml.j2 @@ -31,7 +31,7 @@ jobs: {{ setup_python() | indent(6) }} - {{ install_python_deps(["bump2version", "towncrier"]) | indent(6) }} + {{ install_python_deps(["bump-my-version", "towncrier"]) | indent(6) }} {{ configure_git() | indent(6) }} diff --git a/templates/github/.github/workflows/scripts/release.sh b/templates/github/.github/workflows/scripts/release.sh index 9525f229..a08353cd 100755 --- a/templates/github/.github/workflows/scripts/release.sh +++ b/templates/github/.github/workflows/scripts/release.sh @@ -10,7 +10,8 @@ then exit 1 fi -NEW_VERSION="$(bump2version --dry-run --list release | sed -ne 's/^new_version=//p')" +# The tail is a necessary workaround to remove the warning from the output. +NEW_VERSION="$(bump-my-version show new_version --increment release | tail -n -1)" echo "Release ${NEW_VERSION}" if ! [[ "${NEW_VERSION}" == "${BRANCH}"* ]] @@ -20,7 +21,7 @@ then fi towncrier build --yes --version "${NEW_VERSION}" -bump2version release --commit --message "Release {new_version}" --tag --tag-name "{new_version}" --tag-message "Release {new_version}" --allow-dirty -bump2version patch --commit +bump-my-version bump release --commit --message "Release {new_version}" --tag --tag-name "{new_version}" --tag-message "Release {new_version}" --allow-dirty +bump-my-version bump patch --commit git push origin "${BRANCH}" "${NEW_VERSION}" diff --git a/templates/github/lint_requirements.txt.j2 b/templates/github/lint_requirements.txt.j2 index 251bcf8f..a6f56dd1 100644 --- a/templates/github/lint_requirements.txt.j2 +++ b/templates/github/lint_requirements.txt.j2 @@ -4,7 +4,7 @@ {% if black -%} black==24.3.0 {% endif -%} -bump2version +bump-my-version check-manifest flake8 {% if black -%}