your-tools / tbump

Bump software releases
BSD 3-Clause "New" or "Revised" License
158 stars 22 forks source link

Allow using different config file #90

Closed FlorianLudwig closed 3 years ago

FlorianLudwig commented 3 years ago

I would like specify a config file like:

tbump --config /some/path/config.toml 1.2.3
dmerejkowsky commented 3 years ago

That sounds reasonable, but I got to ask: why?

FlorianLudwig commented 3 years ago

My use case is that I want to generate the config in a script as a temp file.

Mostly, just to not have to have another config file in my projects.

Another way of doing it I thought about was to us thump as a library and provide all the config via python but a quick look into the code didn't seem like it would be that easy :]

dmerejkowsky commented 3 years ago

OK, fair enough. Feel free to open an other feature request for "using tbump as a library"

dmerejkowsky commented 3 years ago

So, funny story: I found a use case ;)

I've started using tbump to bump PKGBUILD files (used by Arch Linux packages), and it turns out I can probably use the same configuration file regardless of the project, using tbump to build PKGBUILDs that are not maintained by me.

So I'll probably implement this one day or an other.

achary commented 3 years ago

I find this feature quite useful to keep the top-level directory of a project tidy and free from tooling-related "clutter". Here is a PR for it: #99

dmerejkowsky commented 3 years ago

Yup. By the way, the use case I had in mind with AUR packages required more changes in tbump, because even if the file and hook configs are the same, I need a place to store the current_version.

maciejmatczak commented 3 years ago

So that sounds like caching should be separate from config.

I had same thought when thinking about using bumpversion in my org. N tools, but the same management model - so how to share the config, but cache current version separately?

With a common config, I can think of either a symlink (tool independent) or an include directive in config (don't know how toml plays with it) - but tool would have to be enhanced + that would open doors to some config merging/inheritance (start from base config, but extendable).

dmerejkowsky commented 3 years ago

I had same thought when thinking about using bumpversion in my org. N tools, but the same management model - so how to share the config, but cache current version separately?

I don't know, but maybe you'll find that copier is a good solution for this problem.

dmerejkowsky commented 3 years ago

Anyway, fixed in #116