Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VersionRange.from_string should retrun a VersionRange with valid constraints sequence #118

Open
keshav-space opened this issue Aug 31, 2023 · 0 comments
Labels
2-next bug Something isn't working

Comments

@keshav-space
Copy link
Member

>>> from univers.versions import SemverVersion
>>> from univers.version_range import VersionRange
>>> 
>>> range = VersionRange.from_string("vers:npm/>=1.2.3|>1.2.4")
>>> 
>>> SemverVersion("1.2.5") in range
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "../univers/src/univers/version_range.py", line 219, in __contains__
    return contains_version(version, self.constraints)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "../univers/src/univers/version_constraint.py", line 542, in contains_version
    raise Exception(f"Invalid constraints sequence: {constraints }")
Exception: Invalid constraints sequence: [VersionConstraint(comparator='>=', version=SemverVersion(string='1.2.3')), VersionConstraint(comparator='>', version=SemverVersion(string='1.2.4'))]
>>>
@keshav-space keshav-space added the bug Something isn't working label Aug 31, 2023
keshav-space added a commit to aboutcode-org/purldb that referenced this issue Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2-next bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants