aboutcode-org / aboutcode-org/univers

`PyPiVersionRange.from_native` not working

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

描述

https://github.com/nexB/univers/blob/aa2253d17a11be3af36278be37e898c05fdbc4fd/src/univers/version_range.py#L501-L504

and PEP 440 shows an example for version specifier as follows:
```
~= 0.9, >= 1.0, != 1.3.4.*, < 2.0
```
See: https://www.python.org/dev/peps/pep-0440/#version-specifiers

Let's try:
```py
>>> from univers.version_range import PypiVersionRange
>>> rng_from_native = PypiVersionRange.from_native("~= 0.9, >= 1.0, != 1.3.4.*, < 2.0")
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
in
----> 1 rng_from_native = PypiVersionRange.from_native("~= 0.9, >= 1.0, != 1.3.4.*, < 2.0")

~/Contrib/univers/src/univers/version_range.py in from_native(cls, string)
514 operator = spec.operator
515 version = spec.version
--> 516 assert isinstance(version, cls.version_class)
517 comparator = cls.vers_by_native_comparators[operator]
518 constraint = VersionConstraint(comparator=comparator, version=version)

AssertionError:

```

Something is not right

贡献指南

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

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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