Foundational CLI library for new Plugin SDK #848
Replies: 4 comments 5 replies
-
I support using Typer (and FastAPI), but will caution that the stability and future of those projects is largely in the hands of Sebastián Ramírez, a.k.a. tiangolo. It probably won't be a problem, but there's a low bus-factor. Fortunately since Typer is built off of Click, we always have the option of migrating to Click if absolutely necessary without too much difficulty. Also, regarding this point:
That's only true if the user installs the shell completions for |
Beta Was this translation helpful? Give feedback.
-
Maybe I'm missing something here, why does it matter what cli library plugins use? In my mind, plugins would export class implementations (e.g. |
Beta Was this translation helpful? Give feedback.
-
So I am gonna riff but I think its valuable State/PersistencePlugins need state so we need a way for Meltano to persist and return that state. That is hugely beneficial IMO. Think of SSH where we want to cache PID of the tunnel after we spin it up. Or a Slack alert plugin which needs to know when it last sent a message. We have a Meltano db interface which already handles state in (I presume) an abstracted manner. Can we leverage that interface? utility:
capabilities:
- state Expectation:
Plugin InterfaceI struggled to find a right way to interface with a plugin. The SDK needs to make this clear. For example, when we set config in meltano.yml, a plugin has no standardized way to accept the config (a la catalog.json). So a plugin if forced to use env vars which are implicitly loaded by Meltano into the executable env. Both typer and click support using env vars for defaults. So I think it would make sense to dynamically generate Expectation:
This would make ProcessesI found psutil very useful in creating a unified abstract for subprocesses which were either invoked by the wrapper or picked up from a cached PID. 🤷 ThoughtsForcing devs into a standard interface like up/down/status/restart makes sense for services which can then be further abstracted and utilized in interesting ways in Meltano core like ( |
Beta Was this translation helpful? Give feedback.
-
@aaronsteers tl;dr wonder if we shouldn't just roll with click ?
That would be handy for
@aaronsteers I rolled with the typer for my experimentation but fwiw the output style when Mainly because resizing your terminal really breaks help output formatting, and the exception formatting. This mostly looks ok in
Honestly it just happens to be from the FastAPI author, im not sure there's design similarities that translate. fwiw - really easy to see what I mean be terminal "resizes" causes issue by just messing with the demo's in the online docs: |
Beta Was this translation helpful? Give feedback.
-
This came up in a call with @pandemicsyn... and it was previously proposed for the Singer SDK by @edgarrmondragon.
We used Click for
singer-sdk
and also for Meltano Core but there appear to be some clear advantages to usingTyper
as our starting point when we create the new Plugin SDK.Potential Advantages:
Thoughts, suggestions, alternatives?
Beta Was this translation helpful? Give feedback.
All reactions