Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix plugin loading #274

Merged
merged 1 commit into from
Mar 6, 2024
Merged

Fix plugin loading #274

merged 1 commit into from
Mar 6, 2024

Conversation

edwagner
Copy link
Contributor

@edwagner edwagner commented Mar 6, 2024

After the switch to importlib, plugins are retrieved by name, not integer index.
For details see importlib.metadata.EntryPoints.getitem()

I discovered this when trying to run ofxstatement with my plugin and I got an error like:

.../importlib_metadata/__init__.py", line 269, in __getitem__
    raise KeyError(name)
KeyError: 0

I also had to make a tweak to the plugin test to make the mock more in line with importlib.

@coveralls
Copy link

coveralls commented Mar 6, 2024

Coverage Status

coverage: 96.05% (+0.02%) from 96.033%
when pulling c659d45 on edwagner:fix-plugin-loading
into 15f8c23 on kedder:master.

After the switch to importlib, plugins are retrieved by name,
not integer index.
For details see importlib.metadata.EntryPoints.__getitem__()

Also update the mock.patch to match: entry_points() -> EntryPoints
Copy link
Owner

@kedder kedder left a comment

Choose a reason for hiding this comment

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

Oh, what a shame! I thought a working list-plugins was enough to declare it working. Thanks for fixing it!

@kedder kedder merged commit 273ca39 into kedder:master Mar 6, 2024
6 checks passed
@edwagner edwagner deleted the fix-plugin-loading branch March 8, 2024 18:58
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.

3 participants