Replace pkg_resources with importlib.metadata for entry point loading#3
Replace pkg_resources with importlib.metadata for entry point loading#3katoken-0215 wants to merge 3 commits intomasterfrom
Conversation
pkg_resources (setuptools) is a heavy dependency for simple entry point lookups. Use importlib.metadata from the standard library instead. Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@hieratic/collection.py`:
- Around line 177-178: The call to entry_points(group=group) is not supported on
Python 3.8/3.9; either require Python>=3.10 in packaging or add a runtime
fallback: import from importlib.metadata (or importlib_metadata for older
runtimes), call entry_points() into a variable (eps) and then handle both return
shapes — if eps has a .select method use eps.select(group=group), else if eps is
a mapping try eps.get(group, []) or iterate eps and filter by .group == group —
then set entry_point = next((x for x in that candidates list if x.name == name),
None); update references to entry_points, eps and entry_point accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 736ad565-298e-4298-bfca-3b7976dd526f
📒 Files selected for processing (1)
hieratic/collection.py
Made-with: Cursor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@setup.py`:
- Around line 38-44: The setup.py declares support for Python 3.14 in the
classifiers but there is no CI/test configuration to validate that; either add a
CI job that runs the test matrix including 3.14 (e.g., create a GitHub Actions
workflow that uses actions/setup-python with "3.14" in the matrix and runs the
existing test commands) or remove the 'Programming Language :: Python :: 3.14'
classifier from setup.py and ensure python_requires remains correct; locate the
classifier list in setup.py (the classifiers variable and the python_requires
line) and apply one of the two fixes consistently.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
pkg_resource is deleted in setuptools v82.0.0.
(
NEWS.rst)Use
importlib.metadatafrom the standard library instead.pytestis PassedSummary by CodeRabbit
リリースノート