hatch icon indicating copy to clipboard operation
hatch copied to clipboard

`hatch version` should allow for version downgrades

Open warsaw opened this issue 1 year ago • 3 comments

Let's say I accidentally did hatch version minor when I meant to do hatch version patch. Now I'm stuck having to manually edit the file because hatch version won't let me downgrade even when I give an explicit version number.

$ hatch version
4.1.0
$ hatch version minor
Old: 4.1.0
New: 4.2.0
# Oops! I wanted 4.1.1
$ hatch version 4.1.1
# Traceback and then:
ValueError: Version `4.1.1` is not higher than the original version `4.2.0`

I think either hatch should allow downgrades when an explicit version number is given, or add a --force (or some such) option to allow for downgrades when I know what I'm doing.

warsaw avatar May 03 '24 01:05 warsaw

https://hatch.pypa.io/latest/plugins/version-scheme/standard/#options

ofek avatar May 03 '24 01:05 ofek

Yep. It's still valuable to default this to true, it would just be nice to have a temporary override, e.g. --force.

warsaw avatar May 03 '24 01:05 warsaw

Okay so this is specifically about a flag rather than disabling that existing option, sure I can do that

ofek avatar May 03 '24 01:05 ofek