lilydjwg / nvchecker

New version checker for software releases
MIT License
428 stars 69 forks source link

2.15 errors out on some malformed pypi tags #273

Closed antonio-rojas closed 5 months ago

antonio-rojas commented 5 months ago

With 2.15, running nvchecker on this .nvchecker.toml

[python-sympy]
source = 'pypi'
pypi = 'sympy'

throws an error

[E 06-01 10:07:39.089 core:369] python-sympy: unexpected error happened error=InvalidVersion("Invalid version: '0.5.13-hg'")
    Traceback (most recent call last):
      File "/usr/lib/python3.12/site-packages/nvchecker/util.py", line 311, in run_one
        version = await self.func(
                  ^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.12/site-packages/nvchecker_source/pypi.py", line 19, in get_version
        parsed_version = Version(version)
                         ^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.12/site-packages/packaging/version.py", line 200, in __init__
        raise InvalidVersion(f"Invalid version: '{version}'")
    packaging.version.InvalidVersion: Invalid version: '0.5.13-hg'
[E 06-01 10:07:39.090 core:447] python-sympy: no-result error="Invalid version: '0.5.13-hg'"

which the user can't do much about. In 2.14 this was handled gracefully.

lilydjwg commented 5 months ago

In 2.14 this was handled gracefully.

In 2.14 it was ignored because it was not latest.