christippett / ssm-parameter-store

A simple Python library for getting values from AWS Systems Manager Parameter Store
MIT License
31 stars 9 forks source link

Package depends on setuptools but doesn't specify this in dependencies #8

Open takkaria opened 2 months ago

takkaria commented 2 months ago

I ran into an issue where ssm-parameter-store was failing to run in a Python 3.12 venv because setuptools wasn't installed:

2024-09-27T14:31:10   File "/app/config/settings/base.py", line 24, in <module>
2024-09-27T14:31:10     from ssm_parameter_store import EC2ParameterStore
2024-09-27T14:31:10   File "/usr/local/lib/python3.12/site-packages/ssm_parameter_store/__init__.py", line 2, in <module>
2024-09-27T14:31:10     from .version import __version__
2024-09-27T14:31:10   File "/usr/local/lib/python3.12/site-packages/ssm_parameter_store/version.py", line 1, in <module>
2024-09-27T14:31:10     from pkg_resources import get_distribution, DistributionNotFound
2024-09-27T14:31:10 ModuleNotFoundError: No module named 'pkg_resources'

Since Python 3.8 the preferred way to get the package's installed version is from importlib.metadata import version, which doesn't require extra packages to be installed.

I can make a PR to update to support Python 3.8+ if you are interested in that. (3.8 goes EOL in about a month at the time of writing so at this point it seems pretty safe to rely on it.)

christippett commented 2 months ago

Hey @takkaria, thanks for raising this. I'd absolutely appreciate a PR. It's been awhile since I've worked on this codebase and as you've pointed out there's a few contemporary Python features that it could no doubt benefit from!

I should probably look at the PyPI stats before making a call on what minimum Python version to support, but targeting 3.8+ seems reasonable.

Thank you 😊