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
ea353ae8
Unverified
Commit
ea353ae8
authored
Jun 18, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix dev constraint parsing
Fixes #206
parent
91b4f2fe
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
1 deletions
+5
-1
poetry/semver/__init__.py
+3
-0
poetry/semver/patterns.py
+1
-1
tests/semver/test_main.py
+1
-0
No files found.
poetry/semver/__init__.py
View file @
ea353ae8
...
@@ -119,6 +119,9 @@ def parse_single_constraint(constraint): # type: (str) -> VersionConstraint
...
@@ -119,6 +119,9 @@ def parse_single_constraint(constraint): # type: (str) -> VersionConstraint
op
=
m
.
group
(
1
)
op
=
m
.
group
(
1
)
version
=
m
.
group
(
2
)
version
=
m
.
group
(
2
)
if
version
==
"dev"
:
version
=
"0.0-dev"
try
:
try
:
version
=
Version
.
parse
(
version
)
version
=
Version
.
parse
(
version
)
except
ValueError
:
except
ValueError
:
...
...
poetry/semver/patterns.py
View file @
ea353ae8
...
@@ -15,5 +15,5 @@ TILDE_CONSTRAINT = re.compile("(?i)^~(?!=)({})$".format(_COMPLETE_VERSION))
...
@@ -15,5 +15,5 @@ TILDE_CONSTRAINT = re.compile("(?i)^~(?!=)({})$".format(_COMPLETE_VERSION))
TILDE_PEP440_CONSTRAINT
=
re
.
compile
(
"(?i)^~=({})$"
.
format
(
_COMPLETE_VERSION
))
TILDE_PEP440_CONSTRAINT
=
re
.
compile
(
"(?i)^~=({})$"
.
format
(
_COMPLETE_VERSION
))
X_CONSTRAINT
=
re
.
compile
(
"^(!=|==)?
\
s*v?(
\
d+)(?:
\
.(
\
d+))?(?:
\
.(
\
d+))?(?:
\
.[xX*])+$"
)
X_CONSTRAINT
=
re
.
compile
(
"^(!=|==)?
\
s*v?(
\
d+)(?:
\
.(
\
d+))?(?:
\
.(
\
d+))?(?:
\
.[xX*])+$"
)
BASIC_CONSTRAINT
=
re
.
compile
(
BASIC_CONSTRAINT
=
re
.
compile
(
"(?i)^(<>|!=|>=?|<=?|==?)?
\
s*({})"
.
format
(
_COMPLETE_VERSION
)
"(?i)^(<>|!=|>=?|<=?|==?)?
\
s*({}
|dev
)"
.
format
(
_COMPLETE_VERSION
)
)
)
tests/semver/test_main.py
View file @
ea353ae8
...
@@ -24,6 +24,7 @@ from poetry.semver import VersionUnion
...
@@ -24,6 +24,7 @@ from poetry.semver import VersionUnion
(
"=1.0"
,
Version
(
1
,
0
,
0
)),
(
"=1.0"
,
Version
(
1
,
0
,
0
)),
(
"1.2.3b5"
,
Version
(
1
,
2
,
3
,
"b5"
)),
(
"1.2.3b5"
,
Version
(
1
,
2
,
3
,
"b5"
)),
(
">= 1.2.3"
,
VersionRange
(
min
=
Version
(
1
,
2
,
3
),
include_min
=
True
)),
(
">= 1.2.3"
,
VersionRange
(
min
=
Version
(
1
,
2
,
3
),
include_min
=
True
)),
(
">dev"
,
VersionRange
(
min
=
Version
(
0
,
0
,
pre
=
"dev"
))),
# Issue 206
],
],
)
)
def
test_parse_constraint
(
input
,
constraint
):
def
test_parse_constraint
(
input
,
constraint
):
...
...
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