Skip to content

Instantly share code, notes, and snippets.

@Sukonnik-Illia
Created January 13, 2022 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sukonnik-Illia/d8ff555c663952179f77bc3dd222c4f1 to your computer and use it in GitHub Desktop.
Save Sukonnik-Illia/d8ff555c663952179f77bc3dd222c4f1 to your computer and use it in GitHub Desktop.
Run alembic cli from Python Click
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