Commit c4628986 authored by Jim Fulton's avatar Jim Fulton

Fixed: spaces in version constriants (e.g. ``< 2``) weren't handled

       correctly.
parent d212d82d
...@@ -18,6 +18,9 @@ Fixed: initialization code wasn't included in interpeter scripts. ...@@ -18,6 +18,9 @@ Fixed: initialization code wasn't included in interpeter scripts.
Fixed: macro inheritance bug, https://github.com/buildout/buildout/pull/37 Fixed: macro inheritance bug, https://github.com/buildout/buildout/pull/37
Fixed: spaces in version constriants (e.g. ``< 2``) weren't handled
correctly.
2.0.0a7 (2013-01-12) 2.0.0a7 (2013-01-12)
==================== ====================
......
...@@ -1299,7 +1299,7 @@ def bad_constraint(constraint, requirement): ...@@ -1299,7 +1299,7 @@ def bad_constraint(constraint, requirement):
"requirement, %r.", constraint, str(requirement)) "requirement, %r.", constraint, str(requirement))
raise IncompatibleConstraintError("Bad constraint", constraint, requirement) raise IncompatibleConstraintError("Bad constraint", constraint, requirement)
_parse_constraint = re.compile(r'([<>]=?)(\S+)').match _parse_constraint = re.compile(r'([<>]=?)\s*(\S+)').match
_comparef = { _comparef = {
'>' : lambda x, y: x > y, '>' : lambda x, y: x > y,
'>=': lambda x, y: x >= y, '>=': lambda x, y: x >= y,
......
...@@ -2666,6 +2666,7 @@ def test_constrained_requirement(): ...@@ -2666,6 +2666,7 @@ def test_constrained_requirement():
... ('x>1', '2', 'x==2'), ... ('x>1', '2', 'x==2'),
... ('x>3', '2', IncompatibleConstraintError), ... ('x>3', '2', IncompatibleConstraintError),
... ('x>1', '>2', 'x>2'), ... ('x>1', '>2', 'x>2'),
... ('x>1', '> 2', 'x>2'),
... ('x>1', '>=2', 'x>=2'), ... ('x>1', '>=2', 'x>=2'),
... ('x<1', '>2', IncompatibleConstraintError), ... ('x<1', '>2', IncompatibleConstraintError),
... ('x<=1', '>=1', 'x>=1,<1,==1'), ... ('x<=1', '>=1', 'x>=1,<1,==1'),
...@@ -2677,7 +2678,9 @@ def test_constrained_requirement(): ...@@ -2677,7 +2678,9 @@ def test_constrained_requirement():
... ('x<3', '2', 'x==2'), ... ('x<3', '2', 'x==2'),
... ('x<1', '2', IncompatibleConstraintError), ... ('x<1', '2', IncompatibleConstraintError),
... ('x<3', '<2', 'x<2'), ... ('x<3', '<2', 'x<2'),
... ('x<3', '< 2', 'x<2'),
... ('x<3', '<=2', 'x<=2'), ... ('x<3', '<=2', 'x<=2'),
... ('x<3', '<= 2', 'x<=2'),
... ('x>3', '<2', IncompatibleConstraintError), ... ('x>3', '<2', IncompatibleConstraintError),
... ('x>=1', '<=1', 'x<=1,>1,==1'), ... ('x>=1', '<=1', 'x<=1,>1,==1'),
... ('x<3', '>1', 'x>1,<3'), ... ('x<3', '>1', 'x>1,<3'),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment