aboutcode-org / aboutcode-org/univers

`PyPiVersionRange.from_native` not working

Aperta
#26 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
2-next good first issue
Lingua principale
Python
Stelle
50
Fork
29
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.