aboutcode-org / aboutcode-org/univers

VersionRange.from_string should retrun a VersionRange with valid constraints sequence

未关闭
#118 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
2-next bug
主要语言
Python
星标
50
派生
29
PR 合并指标
30 天内没有已合并 PR

描述

```python
>>> 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 "", line 1, in
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'))]
>>>
```

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。