The Hatch build tool has a versioning feature that can automatically bump the version of a Python project like this:
Simply define the file that holds the version:
[tool.hatch.version]
path = "improv_guide/__about__.py"
And then issue a command to bump the version:
hatch version patch
That will update the version number in __about__.py
But what if I wish to automatically bump the version number in multiple files? For example, I might want to edit the tag in a docker-compose file to have the same number as the project I am building.
Is there a way to specify multiple files I want to change whenever the version is bumped?
I suppose I could use a script and a command-line tool like sed
to edit the files, but I was hoping that Hatch has a 'batteries included' way of solving this problem.