-
-
Notifications
You must be signed in to change notification settings - Fork 321
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 with conflicting entry-point error-code specifications do not auto-load properly [REPLACEMENT ISSUE] #701
Comments
In GitLab by @asottile on Apr 14, 2019, 23:06 yeah not sure if this is documented anywhere but the name has to be unique. The oddity with uninstall / upgrade / ordering is due to setuptools metadata being stored on the filesystem and so you have (~relatively undefined) ordering based on inode. I think this is working as intended right now, though it would maybe be better if some sort of warning / error occurred in this case. This is probably the most relevant line: https://gitlab.com/pycqa/flake8/blob/98beabdcc50ee352a8a5eded1009b0914a3645b9/src/flake8/plugins/manager.py#L276 |
In GitLab by @bskinn on Apr 14, 2019, 23:27 @asottile To be sure I understand you, is it that the And, regardless, yeah, it seems like at minimum a warning should be emitted at execution time for plugin namespace collisions like this. |
In GitLab by @asottile on Apr 14, 2019, 23:34 Actually yeah, now that I found the right docs page (I was looking at the using plugins page earlier!) it does seem to be prominently called out twice there: http://flake8.pycqa.org/en/latest/plugin-development/registering-plugins.html
This was part of the rationale for moving to allowing 3-letter codes in flake8 3.x And yeah, upgrading / downgrading a package likely changes the inode ordering (try running |
In GitLab by @bskinn on Apr 14, 2019, 23:43 Unngh... So... This... collision behavior is intentional?
This seems like a problematically fragile semantics. Is the idea that this would avoid plugins reporting the same error codes? It...seems like a really awkward/incomplete/problematic approach, if so. IMO the entry point name should be, e.g., the package name...MUCH more likely to be unique. If there's a desire to have some sort of machinery in place to avoid multiple things raising the same code, it would make more sense to me for plugins to register the codes they raise via some other parameter in the plugin registration handshake...then it'd be fully granular. |
In GitLab by @bskinn on Apr 14, 2019, 23:44 And <nod>, I have noticed that |
In GitLab by @asottile on Apr 14, 2019, 23:48 It's not so simple unfortunately -- that prefix is used by I'm not sure that the behaviour is ~intentional so-to-speak, though it is at least known and documented. Ideally plugins would select unique reported error codes, though there isn't really any sort of centralized place to manage that (even if there was, that'd box out proprietary / closed-source plugins). |
In GitLab by @bskinn on Apr 14, 2019, 23:56 Hrmmmm...so, the recommended best-practice is for plugin developers to switch to the multi-letter code prefixes? If so, a marketing push to try to coax devs of existing plugins to make that switch might be of some value...counterweighted by the users of the plugins potentially needing to update their configs, I guess. And...as a user, I guess I just have to manually check every time I install a new plugin, that all of the plugins I expect do still show up on a |
In GitLab by @asottile on Apr 14, 2019, 23:58 I think it's more that new plugins should pick the three-letter codes, assuming there aren't existing conflicts |
In GitLab by @bskinn on Apr 15, 2019, 24:00 closed |
In GitLab by @bskinn on Apr 15, 2019, 24:04 <nod>, makes sense. In this case, which project would you recommend I approach first to switch codes, and avoid the collision? -pie is smaller and non-PyCQA, and so seems the more natural one to displace, but -bugbear might be more responsive, being PyCQA? |
In GitLab by @bskinn on Apr 15, 2019, 24:16 Hehe, Good luck with that PR...man, soooo many complex cases to consider...! |
The original issue
could not be created.
This is a dummy issue, replacing the original one. It contains everything but the original issue description. In case the gitlab repository is still existing, visit the following link to show the original issue:
TODO
The text was updated successfully, but these errors were encountered: