aboutcode-org / aboutcode-org/univers

`PyPiVersionRange.from_native` not working

Abierto
#26 3 comentarios 0 reacciones 0 asignados Ver en GitHub
2-next good first issue
Lenguaje dominante
Python
Estrellas
50
Forks
29
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.