Skip to content

Replace pkg_resources with importlib.metadata for entry point loading#3

Draft
katoken-0215 wants to merge 3 commits intomasterfrom
feature/migrate-to-importlib
Draft

Replace pkg_resources with importlib.metadata for entry point loading#3
katoken-0215 wants to merge 3 commits intomasterfrom
feature/migrate-to-importlib

Conversation

@katoken-0215
Copy link
Copy Markdown

@katoken-0215 katoken-0215 commented Apr 10, 2026

pkg_resource is deleted in setuptools v82.0.0.
(NEWS.rst)

Use importlib.metadata from the standard library instead.

  • pytest is Passed

Summary by CodeRabbit

リリースノート

  • Chores
    • Python 3.11以上を必須要件として設定しました。Python 3.12、3.13、3.14を公式にサポートします。

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]>
@katoken-0215 katoken-0215 self-assigned this Apr 10, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 10, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e9abf0eb-20ff-4091-ad34-4947d871ef54

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title clearly and accurately describes the main change: replacing pkg_resources with importlib.metadata for entry point loading, which is exactly what the changeset accomplishes.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/migrate-to-importlib

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between cb9d907 and f379c08.

📒 Files selected for processing (1)
  • hieratic/collection.py

Comment thread hieratic/collection.py
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5811f8cf-272a-48bc-880a-5cc336e2eccd

📥 Commits

Reviewing files that changed from the base of the PR and between f379c08 and 9203ebb.

📒 Files selected for processing (1)
  • setup.py

Comment thread setup.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant