Commit 2ab8588b authored by Gaëtan Montury's avatar Gaëtan Montury
Browse files

feat(hatch): use hatch bump on py-release instead bump-my-version

parent f3302e4a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -475,7 +475,7 @@ The Python template supports three packaging systems:

* [Poetry](https://python-poetry.org/): uses Poetry-specific [version](https://python-poetry.org/docs/cli/#version), [build](https://python-poetry.org/docs/cli/#build) and [publish](https://python-poetry.org/docs/cli/#publish) commands.
* [uv](https://docs.astral.sh/uv/): uses [bump-my-version](https://github.com/callowayproject/bump-my-version) as version management, [build](https://docs.astral.sh/uv/guides/publish/#building-your-package) as package builder and [publish](https://docs.astral.sh/uv/guides/publish/) to publish.
* [hatch](https://hatch.pypa.io/latest//): uses [bump-my-version](https://github.com/callowayproject/bump-my-version) as version management, [build](https://hatch.pypa.io/latest/build/) as package builder and [publish](https://hatch.pypa.io/latest/publish/) to publish.
* [hatch](https://hatch.pypa.io/latest//): uses [version](https://hatch.pypa.io/latest/version/#versioning) as version management, [build](https://hatch.pypa.io/latest/build/) as package builder and [publish](https://hatch.pypa.io/latest/publish/) to publish.
* [Setuptools](https://setuptools.pypa.io/): uses [bump-my-version](https://github.com/callowayproject/bump-my-version) as version management, [build](https://pypa-build.readthedocs.io/) as package builder and [Twine](https://twine.readthedocs.io/) to publish.

The publish job is bound to the `publish` stage, is executed on a Git tag matching [semantic versioning pattern](https://semver.org/) and uses the following variables:
+6 −5
Original line number Diff line number Diff line
@@ -966,12 +966,13 @@ variables:
      if [[ -z "$py_next_version" ]]
      then
        py_cur_version=$(hatch version)
        py_next_version=$(py_bump_my_version "$py_cur_version" "$PYTHON_RELEASE_NEXT")
      fi

        log_info "[hatch version] increase \\e[1;94m${PYTHON_RELEASE_NEXT}\\e[0m (from current \\e[1;94m${py_cur_version}\\e[0m)"
        hatch version "$PYTHON_RELEASE_NEXT"
        py_next_version=$(hatch version)
      else
        log_info "[hatch] change version \\e[1;94m${py_cur_version}\\e[0m → \\e[1;94m${py_next_version}\\e[0m"
      _pip install toml-cli
      _run toml set --toml-path pyproject.toml project.version "$py_next_version"
        hatch version "$py_next_version"
      fi

      py_git_tag_commit_release_change "$py_cur_version" "$py_next_version"
    else