Created
January 13, 2022 15:09
-
-
Save Sukonnik-Illia/d8ff555c663952179f77bc3dd222c4f1 to your computer and use it in GitHub Desktop.
Run alembic cli from Python Click
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import click | |
from alembic.config import main | |
@click.group() | |
def cli(): | |
"""Hello cli app""" | |
@cli.command( | |
'db', | |
context_settings=dict( | |
ignore_unknown_options=True, | |
allow_extra_args=True, | |
), | |
add_help_option=False | |
) | |
def run_alembic(*args, **kwargs): | |
"""Alembic cli""" | |
main(sys.argv[2:]) | |
cli() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment