-
Notifications
You must be signed in to change notification settings - Fork 4
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
Refactor mara flask CLI commands #42
Comments
I did a bit discovering in the code and came on the folllowing idea: When the When the For example:import click
@click.group
def pipeline():
pass
@pipeline.command
def run(...):
# ...
pass
MARA_CLICK_COMMANDS = [pipeline] would then result in the following CLI command: flask pipeline run Using a custom script named mara pipeline run |
I had similar ideas a few years ago (https://github.com/jankatins/mara-cli + https://github.com/jankatins/mara-config/) but entry points were quite slow at that point. Not sure if that got better since. |
Maybe I don't get your point here about the entry points ... I never experienced performance issues with entrypoints. I see people using it in all sort of projects About the config (mara-config): I see that that is something which we should tackle. I really like the idea how superset does it: It has a Another thing I have in mind is to replace |
The cli commands returned by the function
MARA_CLICK_COMMANDS
are automatically added to the Mara Flask App (code see here).There is a default way in Flask to add extra commands from a module by using a entry_point in the module package with name
flask.commands: [...]
. See here. This functionality is already available since 1.0.0 (pallets/flask#2259)I suggest to deprecate the current pattern of using the
MARA_CLICK_COMMANDS
function in advance to the flask standard way of dealing with this.In addition, I suggest to redesign the command names / and keep the old names only for upgrade compatibility. The command
flask mara_pipelines.ui.run
could be e.g. changed into<my_mara_app> pipeline run
by using a click group.The text was updated successfully, but these errors were encountered: