[BUG] Crash for a Poetry dependency w/ ^
and a non semver
standard version
#593
Labels
bug
Something isn't working
^
and a non semver
standard version
#593
Describe the bug
grayskull
fails onnannyml=0.12.1
for a dependency that uses caret^
and a nonsemver
standard version^0.8.post1
.grayskull
crashes when trying to coerce it tosemver
while computing the floor for the lower bound during the rendering of^0.8.post1
to>=0.8.post1,<0.9.0
.grayskull/grayskull/strategy/parse_poetry_version.py
Lines 217 to 224 in 77ed4b3
Precisely here:
grayskull/grayskull/strategy/parse_poetry_version.py
Line 220 in 77ed4b3
This happens because
0.8.post1
is PEP 440 standard and notsemver
.From the documentation of Poetry about the tilda operator, it is not clear whether the version used in a caret/tilde operator should or could be following the
semver
standard, but in a more general paragraph:ref: https://python-poetry.org/docs/libraries/#versioning:~:text=Poetry%20requires%20PEP,suitable%20for%20semver.
It's the other way around: one could use a subset of
semver
that is in line with PEP 440 but a version must be coerced to PEP 440.According to PEP 440
0.8.post1
(0.8.0.post1
) is a valid post-release (stable) version, more recent than0.8.0
.It should be accepted and rendered with
>=0.8.0.post1,<0.9.0
.To Reproduce
Steps to reproduce the behavior:
grayskull pypi "nannyml=0.12.1"
Expected behavior
Can create a recipe from
pyproject.toml
. The version^0.8.post1
is rendered to>=0.8.post1,<0.9.0
, or^0.8.post1
to>=0.8.0.post1,<0.9.0
(or^0.8.post1
to>=0.8.0.post1,<0.9.0
).Outputs
Traceback
Environment:
grayskull --version
:2.7.3
The text was updated successfully, but these errors were encountered: