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

plugins: cleanup and rename type to group #5412

Merged
merged 1 commit into from
Apr 5, 2022

Conversation

abn
Copy link
Member

@abn abn commented Apr 5, 2022

Minor improvements to plugin implementation to make downstream implementations a bit easier for application plugins. The main change here is the renaming of type property to group. This reflects reality more as this is referring to the entrypoint group the plugin is made available under and avoids shadowing built-in type.

Copy link
Member

@radoering radoering left a comment

Choose a reason for hiding this comment

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

test_plugin_manager.py still uses "plugin" and type instead of group. Maybe, this should be changed, too.

src/poetry/plugins/application_plugin.py Show resolved Hide resolved
@radoering radoering merged commit 748b1c6 into python-poetry:master Apr 5, 2022
@abn abn deleted the plugin-improvements branch April 5, 2022 20:24
@lovesegfault
Copy link
Contributor

I'm not sure whether this PR is to blame, but if I do poetry plugin show I get this:

$ poetry plugin show   

  KeyError

  'export'

  at ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/console/commands/plugin/show.py:55 in handle
       51│             category = "plugins"
       52│             if issubclass(plugin, ApplicationPlugin):
       53│                 category = "application_plugins"
       54│ 
    →  55│             package = packages_by_name[canonicalize_name(entry_point.name)]
       56│             plugins[package.pretty_name]["package"] = package
       57│             plugins[package.pretty_name][category].append(entry_point)
       58│ 
       59│         for name, info in plugins.items():

This is after installing the export plugin.

@abn
Copy link
Member Author

abn commented Apr 6, 2022

@lovesegfault it could be. But I'm not sure. I'd recommend that you consider waiting till #5413 is merged. Also note that the export plugin is now also renamed. The old one will only work with poetry <=1.2.0b1.

I do expect another PR after that to look at the commands. If it remains an issue with the above PR, please create a new issue.

@abn
Copy link
Member Author

abn commented Apr 6, 2022

@lovesegfault had a quick look, and no that issue is not because of this PR. The root cause here is that poetry currently expects the entrypoint name to be the same as the package name. Not entirely sure if this was intentional. Since the export plugin is not named export the current versions of the plugin wont work with the show command.

https://github.com/python-poetry/poetry-plugin-export/blob/ddf3dde33cf3c5d1a0e4c53723d677014b38809e/pyproject.toml#L27-L28

If i replace export with poetry-plugin-export the command works as is.

$ poetry plugin show

  • poetry-plugin-export (1.0.0) Poetry plugin to export the dependencies to various formats
      1 application plugin

      Dependencies
        - poetry (>=1.2.0b1dev0,<2.0.0)

@kasteph kasteph mentioned this pull request May 30, 2022
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants