snyk-labs / pysnyk

A Python client for the Snyk API.
https://snyk.docs.apiary.io/
MIT License
85 stars 116 forks source link

[BUG]: importlib-metadata version requirement several major versions behind. #192

Closed whardier closed 8 months ago

whardier commented 1 year ago

Is there an existing issue for this?

Description of the bug

Can you increase the scope for importlib-metadata and matrix test against 4.x, 5.x and 6.x if you need to support 4.x or 5.x for any reason.

If you need to use an older importlib-metadata it is VERY easy to vendor using vendorize and I can provide a pyproject.toml config section for how to enable that.

Steps To Reproduce

Modern opentelemetry - some flake8 tooling (that uses importlib-metadata for entrypoint solving) and others require ~=6.0

Additional Information

No response

whardier commented 1 year ago

For the work that is being done with importlib_metadata here - you can replace it with setuptools-scm and enable it in your pyproject when using setuptools. In your case with poetry there is a plugin for poetry that allows for writing a version tag out to a file that will be included in the output as a python script (replacement or overwrite).

I have often used stuff like _myproject_version.py as a top level file outside of my myproject module area when installed in site-packages in order to support this.

whardier commented 1 year ago

I believe python now also supports this out of the box.. but I'm not entirely sure.