click-contrib / click-repl

Subcommand REPL for click apps
MIT License
219 stars 40 forks source link

click v7 breaks click_repl #50

Closed mgdelmonte closed 5 years ago

mgdelmonte commented 5 years ago

click_repl works with click==6.7 but upgrading to click==7.0 breaks it. Sample code:

from __future__ import print_function
import click
import click_repl

@click.group()
def cli():
    print("in cli")

@cli.command()
def test():
    print("in test")

@cli.command()
def repl():
    click_repl.repl(click.get_current_context())

if __name__ == '__main__':
    cli()

Running with click v6.7, the repl works. With click 7.0, the repl exits after the first command.

theazureshadow commented 5 years ago

We hit this issue as well.

theazureshadow commented 5 years ago

Pretty sure it has to do with this PR: https://github.com/pallets/click/pull/1098

theazureshadow commented 5 years ago

Please take a look at my PR #51, which should fix this in a backwards-compatible manner.

theazureshadow commented 5 years ago

@mgdelmonte: Can you try with 0.1.6?

mgdelmonte commented 5 years ago

works great -- thanks!