univers icon indicating copy to clipboard operation
univers copied to clipboard

mypy type hints

Open dacevedo12 opened this issue 1 year ago • 4 comments

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/

dacevedo12 avatar Sep 19 '24 14:09 dacevedo12

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

TG1999 avatar Sep 19 '24 15:09 TG1999

@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

pombredanne avatar Sep 24 '24 10:09 pombredanne

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

dacevedo12 avatar Sep 24 '24 12:09 dacevedo12

@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

pombredanne avatar Oct 01 '24 16:10 pombredanne