Repository navigation
Replies: 1 comment
|
I'm currently running into the same issue, trying to pull apart the CLI code from the API code. So I can invoke it from my wrapper script. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
In my last discussion, I talked about how the Pyinfra architecture is quite coupled with UI elements. I'd like to start a discussion about how the project's architecture could evolve to make its API surface more stable for the future
Well, first things first: My use-case
I currently utilize Pyinfra as the core execution API for my own system management project (akin to a platform, with secret management and such). That being said, when I utilized Pyinfra, I realized that it has a tight coupling with UI elements:
As per the code above, I have to capture Pyinfra's logging output in order to capture diffs, commands, and facts. These could be put in the OperationMeta object as well as the logger, in order to make API usage easier
This is a coupling that makes API usage more brittle and susceptible to unsuspecting breaking changes (e.g., different strings being passed to the logger)
I know this is already a known issue, and it started being worked on by @wowi42 in #1616, making an amazing step forward by removing all calls to click in the API
looking forward to V4
I've realized that @JakkuSakura is doing huge work on #1482 by dropping paramiko and using asyncio instead. This can be awesome for quite a few different reasons, but it still is a major breaking change that should be looked at closely.
I think we could use this breaking change window to discuss API decoupling and how to manage packaging for Pyinfra. Currently, it installs both the CLI and the API all in one, making packaging it with different interfaces harder (requiring additional dependencies such as click even when running purely headless).
As such, I'd like to make a few questions for the maintainers, in order to be as helpful as I can be with this project, and I believe can help other contributors to make the project grow:
All reactions