AcademySoftwareFoundation / rez

An integrated package configuration, build and deployment system for software
https://rez.readthedocs.io
Apache License 2.0
931 stars 329 forks source link

`rez bump` command? #931

Closed dbr closed 4 years ago

dbr commented 4 years ago

I was going to write a small helper script to automate the process of releasing a new version, which for me involves:

..before running rez release. None of the steps are too hard on their own, but adds up to be a little tedious and accident prone (quite often I've forgotten to bump the version string as per #914)

Before I write this as a standalone script, is this something that could potentially be useful as part of rez itself? I'm unsure as seems like it could be useful, but also might be a little too workflow-specific to be in core rez?

instinct-vfx commented 4 years ago

I often use bumpversion to do this. So basically:

This also has the benefit of being able to update versions in multiple places if needed (e.g. in docs, or about boxes, resource files or the likes)

rfletchr commented 4 years ago

you might consider a pre-commit hook.

master=$(git show master:package.py | grep version | cut -d'"' -f 2)
current=$(git show HEAD:package.py | grep version | cut -d'"' -f 2)

if [ "$master" = "$current" ]; then
    echo "version bump required"
    exit 1
fi

it simply compares the 2 versions and errors if master matches your current branch

@instinct-vfx have you tried CMakes configure_file method for doing string substitution?

https://cmake.org/cmake/help/v3.2/command/configure_file.html

My Tool Version: @Version@

said file has the @Version@ token replaced with the value of Version

also for code you can get any packages version from the environment specifically REZ_(PKG)_VERSION

nerdvegas commented 4 years ago

IMO this is outside the scope of rez. Both previous suggestions (separate bumpversion tool, pre-commit hook) sound like reasonable solutions.

Thx A

On Wed, Aug 12, 2020 at 11:52 PM Rob Fletcher notifications@github.com wrote:

you might consider a pre-commit hook.

master=$(git show master:package.py | grep version | cut -d'"' -f 2) current=$(git show HEAD:package.py | grep version | cut -d'"' -f 2) if [ "$master" = "$current" ]; then echo "version bump required" exit 1fi

it simply compares the 2 versions and errors if master matches your current branch

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nerdvegas/rez/issues/931#issuecomment-672883824, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMOUSUFP2VKWUA7N3MMTYDSAKNBPANCNFSM4P25IQOA .

dbr commented 4 years ago

Yep agreed - thanks for the suggestions!