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

Package metadata of plugins installed through pip 10+ not found by OctoPrint #2625

Closed
foosel opened this Issue May 4, 2018 · 5 comments

Comments

2 participants
@foosel
Owner

foosel commented May 4, 2018

Problem

Starting with pip 10, a pip install for a VCS URL (which apparently also includes https zip file URLs) will now build a wheel of the installed URL via python setup.py bdist_wheel and install that instead of running python setup.py install. That means that instead of dumping the package metadata into an egg-info/PKG-INFO it will now be dumped into dist-info/METADATA (see PEP 376).

OctoPrint's current way of retrieves a plugin package's metadata when going through the plugin entry point results involves a custom implementation of pkginfo.Installed which takes the entry point object and tries to find the correct metadata file from that based on some path traversing. This only includes looking at .egg-info files and directories though and hence no metadata will be found for plugins installed from wheels.

The result of that is a lack of metadata normally retrieved from the package data (such as license, homepage URL, author and such) and also an inability to detect what plugin was installed during finalization of the plugin manager's install routine, causing a warning popup.

Plugins continue to function just fine though, it's just the metadata that doesn't get read properly. Hence this should be classified as non critical bug.

Solution

OctoPrint's plugin manager needs to be adjusted so it can also fetch metadata for packages installed from wheels.

A first throw at this has been done with c3eebdb, however this seems overly complicated on second glance considering we have access to a Distribution object on the entry point object itself. A second throw at simplifying this will be made shortly.

@foosel foosel added this to the 1.3.9 milestone May 4, 2018

@foosel foosel self-assigned this May 4, 2018

foosel added a commit that referenced this issue May 4, 2018

Plugin subsystem: Use entry_point.dist to fetch metadata
Support egg "PKG-INFO" and wheel "METADATA" files in metadata folder. Less
guess work throughout the include path this way.

Better solution for #2625 than c3eebdb

@foosel foosel added the status:solved label May 4, 2018

@foosel

This comment has been minimized.

Owner

foosel commented May 4, 2018

Open question: Why can't the plugin manager detect the plugin on install? The lack of metadata shouldn't be causing this and that smells of a bug in hiding.

@ntoff

This comment has been minimized.

Contributor

ntoff commented May 4, 2018

I assume this is why I got a popup "installation of: unknown was successful, however a restart of octoprint is necessary" when installing from a zip file?

I should mention this wasn't a "warning" popup, it was just the normal plugin installation popup.

@foosel

This comment has been minimized.

Owner

foosel commented May 5, 2018

Yep, exactly. Did you still get it with the current maintenance branch or was that against 1.3.8?

@ntoff

This comment has been minimized.

Contributor

ntoff commented May 5, 2018

1.3.8 release on my custom install on linux mint

@foosel

This comment has been minimized.

Owner

foosel commented Jul 25, 2018

1.3.9 has just been released.

@foosel foosel closed this Jul 25, 2018

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