git-ai-commit
git-ai-commit copied to clipboard
fix(deprecation): replace pkg_resources before removal in setuptools 81 (2025-11-30)
Hi, thanks for maintaining this project.
Summary
pkg_resources is deprecated and scheduled for removal after 2025-11-30 (setuptools 81).
The git-ai-commit implementation currently imports pkg_resources in multiple modules.
Impact
- The project will fail to run once setuptools >=81 is installed.
- A migration to
importlib.metadata(standard library, Python 3.8+) is required.
Affected Files
ai_commit_msg/utils/utils.pyai_commit_msg/services/pip_service.py- Possibly other modules using
pkg_resources.get_distribution()
Suggested Fix
Replace usages of pkg_resources with importlib.metadata (Python 3.8+).
References
Setuptools deprecation notice: https://setuptools.pypa.io/en/latest/pkg_resources.html
Additional Note
When running git-ai-commit, the following deprecation warning appears at runtime:
$ git-ai-commit.exe
Lib\site-packages\ai_commit_msg\utils\utils.py:2: UserWarning: pkg_resources is deprecated as an API.
See https://setuptools.pypa.io/en/latest/pkg_resources.html.
The pkg_resources package is slated for removal as early as 2025-11-30.
Refrain from using this package or pin to Setuptools<81.
import pkg_resources
Related PR: #83 (adds setuptools dependency) issue: #82 PR: #49