Skip to content
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

Passing version as a command-line parameter to prerelease and fullrelease #368

Open
TSNoble opened this issue Apr 10, 2021 · 2 comments
Open

Comments

@TSNoble
Copy link

TSNoble commented Apr 10, 2021

I'm using zest in a project and was wondering if it'd be possible to pass --version=a.b.c as a command-line parameter to the prerelease / fullrelease commands? I'm using zest as part of an automated release Github Actions workflow, so it'd be super handy to be able to pass the desired version directly from the workflow input to the command, rather than implementing some kind of custom logic or using different workflows for major/minor releases.

I'd be happy to submit a PR making the change if that sounds sensible!

@TSNoble TSNoble changed the title Passing version as a command-line parameter Passing version as a command-line parameter to prerelease and fullrelease Apr 10, 2021
@mauritsvanrees
Copy link
Member

We do not have many command line options, we only have options for verbose, help, and no-input, neither of which I use. :-) I prefer to just answer the questions, mostly just pressing Enter to accept the default answers.

But the bumpversion command has some options. And we have issue #367 where someone wants to copy those options to the postrelease command. And now we have the current issue.

I guess the trickiest may be that you end up getting values from too many places, making it harder to see where a command got a value from:

  • from answers to questions that we ask
  • from setup.cfg
  • from ~/.pypirc
  • from parsing setup.py (version)
  • from an environment variable (TWINE options, PYTHON_PATH)
  • from command line options

For most of those, it gives a default value, and we still ask a question about it, for which you can accept the default, or override it.
For command line options, we should probably treat those as not overridable. So when you pass --version=1.2.3, we no longer ask you which version you want.

During the postrelease phase, we should do nothing with this version option. But calling postrelease --version=1.3.0 may still make sense, similar to issue #367 where postrelease --feature is wanted. Well, maybe worry about that later.

@reinout Are you okay with adding more command line options to zest.releaser?

@reinout
Copy link
Collaborator

reinout commented May 5, 2021

The --version is one that might be useful.
Though I'd have to ask which version it is: the one we're releasing as (prerelease, release) or the one we want to bump the version to (postrelease).

Brainstorming: is there a way to do it in a more generic way? We have those nice documented data dictionaries (https://zestreleaser.readthedocs.io/en/latest/entrypoints.html#common-data-dict-items), is there something we can do with that? fullrelease --postrelease-new_version=1.1 to set new_version in the postrelease data dict?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants