Skip to content

fix(extensions): load entry-point plugins on Python 3.9#2194

Merged
vivekchand merged 1 commit into
mainfrom
fix/extensions-py39-entry-points
May 27, 2026
Merged

fix(extensions): load entry-point plugins on Python 3.9#2194
vivekchand merged 1 commit into
mainfrom
fix/extensions-py39-entry-points

Conversation

@vivekchand
Copy link
Copy Markdown
Owner

Bug

extensions.load_plugins() called importlib.metadata.entry_points(group="clawmetry.extensions"). The group= keyword is Python 3.10+. On 3.9 (a supported runtime and a CI matrix row) it raises TypeError, which the surrounding bare except swallows — so load_plugins() silently loaded nothing on 3.9.

Consequence: any package that registers via the clawmetry.extensions entry point (notably the closed-source clawmetry-pro paid layer) would never load on a 3.9 install.

Fix

_select_entry_points(group) uses the .select(group=...) API on 3.10+ and the dict form (entry_points().get(group, [])) on 3.9. No behaviour change on 3.10+.

Verification

  • pytest tests/test_extensions.py → 5 passed (incl. unknown-group, idempotency, emit error-swallowing).
  • With clawmetry-pro installed locally on Python 3.9.6, load_plugins() now discovers and runs its register_all (registered event clawmetry.pro.loaded, is_loaded() == True). It was a silent no-op before this fix.

🤖 Generated with Claude Code

load_plugins() used importlib.metadata.entry_points(group=...), which is a
Python 3.10+ keyword. On 3.9 (a supported runtime + a CI matrix row) that
raises TypeError, caught by the bare except -> load_plugins silently loaded
NOTHING. Any extension package declared via the clawmetry.extensions entry
point (e.g. the closed-source clawmetry-pro paid layer) therefore never
registered on 3.9.

Add _select_entry_points() that uses .select(group=) on 3.10+ and the dict
form on 3.9. Verified: with clawmetry-pro installed, load_plugins() now
discovers + runs its register_all on Python 3.9.6.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vivekchand vivekchand merged commit 656376e into main May 27, 2026
18 checks passed
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