Example #1
0
 def __init__(self, name, constraint,
              pip_string):  # type: (str, str) -> None
     self.name = name
     self.constraint = parse_constraint(constraint or "*")
     self.pretty_constraint = constraint
     self.pip_string = pip_string
     self.package = Package(pip_string)
Example #2
0
 def __init__(self, name, constraint):  # type: (str, str) -> None
     self.name = name
     self.constraint = parse_constraint(constraint)
     self.pretty_constraint = constraint
Example #3
0
def test_parse_constraint_wildcard(input_, constraint):
    assert parse_constraint(input_) == constraint
Example #4
0
def test_parse_constraint_tilde(input_, constraint):
    assert parse_constraint(input_) == constraint
Example #5
0
def test_constraints_keep_version_precision(input_, expected):
    assert str(parse_constraint(input_)) == expected
Example #6
0
def test_versions_are_sortable(unsorted, sorted_):
    unsorted = [parse_constraint(u) for u in unsorted]
    sorted_ = [parse_constraint(s) for s in sorted_]

    assert sorted(unsorted) == sorted_
Example #7
0
def test_parse_constraint_multi_wilcard(input_):
    assert parse_constraint(input_) == VersionUnion(
        VersionRange(Version(2, 7, 0), Version(3, 0, 0), True, False),
        VersionRange(Version(3, 2, 0), None, True, False),
    )
Example #8
0
def test_parse_constraint_multi(input_):
    assert parse_constraint(input_) == VersionRange(Version(2, 0, 0),
                                                    Version(3, 0, 0),
                                                    include_min=False,
                                                    include_max=True)
Example #9
0
def test_parse_constraint_caret(input_, constraint):
    assert parse_constraint(input_) == constraint
Example #10
0
def test_parse_constraint(input, constraint):
    assert parse_constraint(input) == constraint
Example #11
0
def test_parse_constraints_negative_wildcard(input, constraint):
    assert parse_constraint(input) == constraint