ashleysommer / sanic-plugin-toolkit

Easily create Plugins for Sanic!
MIT License
51 stars 9 forks source link

Explicitly add dependency on `setuptools` #18

Closed thamenato closed 3 years ago

thamenato commented 3 years ago

Inside the config.py file we have an explicit import of pkg_resources which is provided by setuptools.

https://github.com/ashleysommer/sanicpluginsframework/blob/02e0668107714d56a59f1f6ef478e719dfbce957/spf/config.py#L8

Not all Python distribution comes with that bundled which can cause fail at runtime since it cannot find pkg_resources. I'm pinning the version at >=40.0 which is the same one used in pytest and seems like pytest is also a common dependency here.

ashleysommer commented 3 years ago

Hi @thamenato Thanks for the PR.

I did wonder about whether setuptools would be included in common distributions, and my quick research suggested it would probably not be a problem (and hasn't occurred as a problem that any users have brought up yet).

We can definitely add this requirement, and pin it to a minimum version. I'm happy to use >=40.0 for now (as that is what is used in pytest 5.3.x) but in the future I might bump it to a higher version.

Eg, in some of my PEP517/Poetry/pyproject.toml projects I have setuptools pinned to >=40.8 (for some important base-level PEP517 compatibility).

ashleysommer commented 3 years ago

Released a new version with this change, v0.9.4.post1