Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python-poetry
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
python-poetry
Commits
dd444198
Commit
dd444198
authored
May 17, 2019
by
DanCardin
Committed by
Sébastien Eustace
May 17, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore poorly formed distribution version values. (#917)
parent
a29a456d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletions
+12
-1
poetry/semver/version.py
+5
-1
tests/semver/test_version.py
+7
-0
No files found.
poetry/semver/version.py
View file @
dd444198
...
@@ -196,7 +196,11 @@ class Version(VersionRange):
...
@@ -196,7 +196,11 @@ class Version(VersionRange):
@classmethod
@classmethod
def
parse
(
cls
,
text
):
# type: (str) -> Version
def
parse
(
cls
,
text
):
# type: (str) -> Version
match
=
COMPLETE_VERSION
.
match
(
text
)
try
:
match
=
COMPLETE_VERSION
.
match
(
text
)
except
TypeError
:
match
=
None
if
match
is
None
:
if
match
is
None
:
raise
ParseVersionError
(
'Unable to parse "{}".'
.
format
(
text
))
raise
ParseVersionError
(
'Unable to parse "{}".'
.
format
(
text
))
...
...
tests/semver/test_version.py
View file @
dd444198
...
@@ -3,6 +3,7 @@ import pytest
...
@@ -3,6 +3,7 @@ import pytest
from
poetry.semver
import
EmptyConstraint
from
poetry.semver
import
EmptyConstraint
from
poetry.semver
import
Version
from
poetry.semver
import
Version
from
poetry.semver
import
VersionRange
from
poetry.semver
import
VersionRange
from
poetry.semver.exceptions
import
ParseVersionError
@pytest.mark.parametrize
(
@pytest.mark.parametrize
(
...
@@ -32,6 +33,12 @@ def test_parse_valid(input, version):
...
@@ -32,6 +33,12 @@ def test_parse_valid(input, version):
assert
parsed
.
text
==
input
assert
parsed
.
text
==
input
@pytest.mark.parametrize
(
"input"
,
[(
None
,
"example"
)])
def
test_parse_invalid
(
input
):
with
pytest
.
raises
(
ParseVersionError
):
Version
.
parse
(
input
)
def
test_comparison
():
def
test_comparison
():
versions
=
[
versions
=
[
"1.0.0-alpha"
,
"1.0.0-alpha"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment