-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
Version management workflow #113
Comments
Good thing you brought this up. Version management could definitely be improved. At the time being, release and version bump is all manual labor. But since releasing is not done often, it wasn't a big priority on the to-do list. Currently, the version is being tracked in 3 files:1.
|
I'd appreciate your opinion on this. I feel like I'm overlooking something, but if we create a new
The script should accept "the bump rule to update the version" (patch, minor, major, etc) as a parameter, or no params (in this case it could output the same of Also considering that poetry is part of fastapi-mvc pre-requisites, so no additional dependencies are required, wouldn't this do the trick? Update: hypotetical related GitHub actions https://github.com/rochacbruno/fastapi-project-template/blob/main/.github/workflows/release.yml, https://github.com/commitizen-tools/commitizen/blob/master/.github/workflows/bumpversion.yml, etc
|
The way I see it, a script for bumping version could be implemented in two ways (at least at first glance). First is what you've proposed. This would definitely work and would be pretty easy to implement thanks to the poetry bump version feature (btw., I wasn't aware of this, thanks for bringing it to my attention!) Few notes from my site:
Maybe name
Wouldn’t Other than that, I think it's good to go. A quick draft (I haven't actually run this): #!/usr/bin/env bash
if [ -n "$DEBUG" ]; then
set -x
fi
set -o errexit
set -o nounset
set -o pipefail
POETRY_HOME="${POETRY_HOME:=${HOME}/.poetry}"
"$POETRY_HOME"/bin/poetry version "$1"
VERSION=$("$POETRY_HOME"/bin/poetry version -s)
echo "$VERSION" > TAG
# package_name needs to be somehow extracted.
# One can find this value in `fastapi-mvc.ini` file under the project root.
cat << EOT > package_name/version.py
"""fastapi-mvc-example version."""
__version__ = "$VERSION"
EOT Tradeoffs:
The second option would be using just Coreutils. You either provide a version as a parameter or have one plain text file with the version. And then just run Tradeoffs:
|
A third option could be implementing this as |
Thanks for the explanation! 🙏 I already configured a bump command for make very similar to yours and it works well. I'd like to contribute with some sort of PR, but as Mr. obvious always says: time is scarce. Because there would be something more to clarify and decide. Anyway, this ticket will stay as a draft reference, feel free to keep it open or close as you want. |
No problem, glad you have this sorted. As it goes to the actual feature for bumping version, I will create an issue for that with implementation details within a few days. But first, I need to test a few solutions. I'll let you know once it's ready if you'd like to contribute. |
Issue
Hi, thanks for this wonderful tool, it's a very nice starting point for my projects.
I just wonder how the release process could be. I mean, with
poetry version
I can bump the version defined inpyproject.toml
->[tool.poetry]
->version
, but I wonder how to update theTAG
file as well, automatically. And also, how to refreshCHANGELOG.md
accordingly with (semantic) commit messages?Any recommended workflow?
UPDATE:
btw, I also see we have a
version.py
to keep up-to-date.The text was updated successfully, but these errors were encountered: