Closed regisz closed 4 years ago
Hi!
Thanks for the report, but I'm not sure about the behaviour you would expect to see?
partial=True
versions are now deprecated, but they were meant to describe a simpler form of range descriptions - Version('1.0', partial=True) == v
should now be replaced with v in SimpleSpec('=1.0')
.
However, if you're using Version(x, partial=True).next_major()
, this would mean that I have missed some relevant use cases for them; could you detail what you're using them for? I wouldn't want to remove features simply because I wasn't aware of some interesting interactions!
Yes, I read about deprecated situation. But, now I use it :).
And, now, the next_major() adds a "-" at the end of the version, so:
the wrong, actual case: Version("1.0.0", partial=True).next_major()
-> Version("2.0.0-", partial=True)
the expected case: Version("1.0.0", partial=True).next_major()
-> Version("2.0.0", partial=True)
(no -)
So, this wrong situation occurs if "partial=True" argument is used.
Indeed. What I'm interested into is: how/why/when do you use partial=True
?
What I'm interested into is: how/why/when do you use partial=True?
:) I do it. Of course, I can workaround partial cases because finally a partial version becomes a completed version, so e.g. 1.0 will be 1.0.0.
But, I am release manager in our firm, and we develop an own app to handle our releasing processes. And we use more version formats, and when I have to complete a partial version, then a nice solution to do it with object oriented style (uses classes, etc.), so I initialize the required class with a partial version string and after I call its complete() method.
Partial version can come from branch names: in one of our repositories we use release/
Thanks for the details! Have you taken a look at Version.coerce()
?
>>> Version.coerce('9.1')
Version('9.1.0')
Cool, it is useful for me (I did not know about this method), and I think I can solve the partial situations easily with this "trick" :). So, then I will be able to use the next major version of this package :).
This issue seems to have been fixed with some ad-hoc explanation; there is still an issue with the docs, hopefully the latest version is clearer here ;)
A "-" sign is added at the end of version if I use next_major/next_minor in case of a partial version.