aboutcode-org / univers

Parse and compare all the package versions and all the ranges. From debian, npm, pypi, ruby and more. Process all the version range specs and expressions. This project is sponsored by an NLnet project https://nlnet.nl/project/vulnerabilitydatabase/ , the Google Summer of Code, nexB and others generous sponsors!
32 stars 10 forks source link

mypy type hints #143

Open dacevedo12 opened 2 months ago

dacevedo12 commented 2 months ago

would be nice to have type hints added to the library

mypy currently complains due to univers: module is installed, but missing library stubs or py.typed marker

https://peps.python.org/pep-0484/ https://peps.python.org/pep-0561/

TG1999 commented 2 months ago

@dacevedo12 thanks for bringing this to our attention. We will look into this.

pombredanne commented 1 month ago

@dacevedo12 a patch would be mucho welcomed! Would you also be working on a vers implementation in Go at https://github.com/fluidattacks/compare_version/ ?

vers is at https://github.com/package-url/purl-spec/pull/139

dacevedo12 commented 1 month ago

Hi @pombredanne

regarding vers, not really, the project you linked was a workaround attempt.

we needed a universal version comparison solution that could be called from python code, but hadn't yet discovered this great library so we were hacking around subprocess calls to that go cli

@drestrepom

pombredanne commented 1 month ago

@dacevedo12 if you can help with mypy'ing the code this would be awesome! FWIW, Google also use univers in OSV https://github.com/google/osv.dev/tree/master/osv/third_party/univers