zestsoftware / zest.releaser

Python software releasing made easy and repeatable
https://zestreleaser.readthedocs.io
GNU General Public License v2.0
198 stars 62 forks source link

Choose next version in non interractive mode #291

Closed gawel closed 6 years ago

gawel commented 6 years ago

Hi,

First thanks for this great piece of code. I've discovered zest.releaser years ago and never stopped using it. And I never had any problems! It's just magic.

Today I have many software to release at the same time. And I'd like to decide the new version by myself, without using interactive mode. I've read the code and as I can see there is no way to do that. Am I wrong ?

Ideally, I'd like something like:

$ NEXT_VERSION=x.x.x fullrelease --no-input
reinout commented 6 years ago

What you describe? No, that's not supported as far as I know. There are a couple of options:

Btw, the NEXT_VERSION env variable trick sounds handy, but it probably means we have to support it for all options :-)

gawel commented 6 years ago

Passing params to cli via env vars is a popular feature those days :)

But yeah, I didn't notice that you can write extensions. It should feet my needs. I'll dig into it. Thanks!

I'm closing this issue. I can open another one for this env vars feature if you want.

hgrecco commented 5 years ago

What do you thing of this for BumpVersion?

class BumpVersionEnv(BumpVersion):

    def __init__(self, *args, **kwargs):
        super().__init__()
        new_version = os.getenv('NEXT_VERSION')
        if new_version:
            self.data['new_version'] = new_version

Seems to work as expected but I am not sure that is the right way.

To make it work in fullrelease, would Prereleaser._grab_version be the right place to touch?