-
Notifications
You must be signed in to change notification settings - Fork 286
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
Add plugin support for loaders. #3657
Conversation
The test failure is genuine and is caused by |
@rhattersley Welcome back 😄 ... where's this PR at? Good for review or still WIP? |
It needs a technical review really. e.g. Is the native-namespace mechanism something we're happy to run with? Is Once the technical stuff is settled, then we can sort out documentation, what's new, ... etc. |
For an example plugin (with super-simple, modern packaging) see SciTools/iris-abf. 😁 |
FWIW, I've updated the iris-abf package to include tests, use black formatting, and apply CI via GitHub actions. The tests are brand new tests, with a small amount of "fruitiness" to work around an absence of iris in the test environment due to the inability to do "pip install iris". Hence, I couldn't just grab the tests from here. Installing iris would effectively require conda, which would complicate iris-abf and draw it away from the wholesome poetry, PEP 517, PEP 518, GitHub-actions goodness that it's currently using. This "I can't pip install iris" chicken-and-egg problem is one of the things this PR is seeking to address, but clearly more work is required elsewhere as well ... e.g. I'm looking at you, pyke & cf-units. 😒 |
Interesting.
|
Thanks for the questions @pp-mo - some critical thinking is exactly what this PR needs!
Yes - normally, "pip install iris-abf" would place the abf.py module into an existing Iris installation. You can remove it again cleanly with "pip uninstall iris-abf". So far so good.... ish.
No. 😞 I had rather hoped this would Just Work™️ as allowing for a single namespace package to be provided across multiple directories is one of their main use cases! Installing locally places the abf.py module into I'm thinking these namespace package shennanigans are perhaps a bit too bleeding edge. It would be lot a simpler, more robust, easier to understand, predicatable, etc. etc. to just go with the plain old naming convention approach. In which case we just rename |
I still think we should implement this, but probably just a simple naming strategy as discussed above, so leaving this in place as an issue / reminder. |
Related: #4798 |
Possibly other example that would be ready to try: the NAME loader |
In order to maintain a backlog of relevant PRs, we automatically label them as stale after 500 days of inactivity. If this PR is still important to you, then please comment on this PR and the stale label will be removed. Otherwise this PR will be automatically closed in 28 days time. |
Closed by #5144 |
This suggestion uses
iris.io.plugins
as a namespace package. Each plugin would need to provide one or more modules that install into the same namespace package. All the plugin modules get imported wheniris
is imported (strictly speaking, wheniris.fileformats
is imported), and the contents of anyFORMAT_SPECIFICATIONS
iterables get added to the FORMAT_AGENT.NB. This is just an iniitial technical suggestion (e.g. it has no documentation!) and place to host the general discussion.