Commit 26f8ff9
committed
Allow guess_next_simple_semver to ignore unneeded parts
guess_next_simple_semver previously would error on trying to convert the
'rc0' part of a version such as '1.2.0rc1' to an int, even if it was
told to retain only the first two parts. (It would actually only error
on Python 2, where the conversion to int was non-lazy)
Now if it's told to retain only the first two parts, it won't try to
convert anything after the first two dots to an int, so it won't error.
The outcome is the same as if the bit after the second dot was a valid
int (which was going to be ignored anyway, we just now don't error on
it).
This is useful for the release-branch-semver scheme, which wants to be
able to find the next minor version even if the most recent version is a
release candidate.1 parent e62d4aa commit 26f8ff9
1 file changed
+6
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | 18 | | |
25 | 19 | | |
26 | 20 | | |
| |||
249 | 243 | | |
250 | 244 | | |
251 | 245 | | |
252 | | - | |
253 | | - | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
254 | 249 | | |
255 | 250 | | |
256 | | - | |
257 | | - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
258 | 254 | | |
259 | 255 | | |
260 | 256 | | |
| |||
0 commit comments