git-ai-commit
git-ai-commit copied to clipboard
`pkg_resources `import fails on Python 3.12 due to missing `setuptools `dependency
Hi, thanks for maintaining this project --- I encountered an issue with Python 3.12.
Summary
git-ai-commit fails to run on Python 3.12 with ModuleNotFoundError: No module named 'pkg_resources'.
Steps to Reproduce
- Install Python 3.12 (clean venv)
pip install git-ai-commit- Run
git-ai-commit --help
Actual Result
...
ModuleNotFoundError: No module named 'pkg_resources'
Root Cause
ai_commit_msg/utils/utils.py imports pkg_resources, which is part of setuptools,
but setuptools is not listed in install_requires in setup.cfg.
Expected Behavior
Installation should include all required dependencies.
Suggested Fix
Short-term (to fix runtime error):
Add setuptools>=65.0 to install_requires in setup.cfg, e.g.:
[options]
install_requires =
setuptools>=65.0
click>=8.0
...
Long-term (to address deprecation):
Replace pkg_resources with the standard library alternative importlib.metadata, since pkg_resources is deprecated and scheduled for removal after 2025-11-30. cf. https://setuptools.pypa.io/en/latest/pkg_resources.html
Environment
python -V
Python 3.12.10
pip show git-ai-commit
Name: git_ai_commit
Version: 1.0.13
Ref
https://github.com/the-cafe/git-ai-commit/blob/8750a213aa7890c4c1e88adbf736df6c34a625f4/ai_commit_msg/services/pip_service.py#L2C1-L3C1
https://github.com/the-cafe/git-ai-commit/blob/8750a213aa7890c4c1e88adbf736df6c34a625f4/setup.cfg#L18
https://github.com/search?q=repo%3Athe-cafe%2Fgit-ai-commit%20pkg_resources%20&type=code