cookiejar / cookietemple

A collection of best practice cookiecutter templates for all domains and languages with extensive Github support ⛺
https://cookietemple.com
Apache License 2.0
156 stars 10 forks source link

questionary to replace click prompts and choices (done) -> fix create tests #284

Closed Zethson closed 4 years ago

Zethson commented 4 years ago

https://github.com/CITGuru/PyInquirer/blob/master/README.rst

Could make our click prompts and especially the choices much nicer and interactive.

Advantages and disadvantages when it comes to scaling.

Let's discuss this.

Zethson commented 4 years ago

@filipdutescu Just added you here since we want to discuss this with you at some later point.

Zethson commented 4 years ago

Draft is up on questionary branch.

PyInquirer is awful maintained and has some issues.

Questionary seems to be perfectly fine.

Mixing click and questionary results in weird behavior when echo -e <- it aborts after the questionary prompts. No damn clue why.

-> We would need to replace every click prompt with questionary prompts.

Think this would be fine, since it would to a more consistent style anyways.

@Imipenem

Zethson commented 4 years ago

Only thing I dislike are the default values, but we can discuss that on Discord.

Zethson commented 4 years ago

Just a note for me, we can easily code this ourselves.

Zethson commented 4 years ago
def unsafe_ask(self, patch_stdout: bool = False) -> Any:
    """Ask the question synchronously and return user response.
    Does not catch keyboard interrupts."""

    if patch_stdout:
        with prompt_toolkit.patch_stdout.patch_stdout():
            return self.application.run()
    else:
        return self.application.run()

-> can also use the unsafe ask

Zethson commented 4 years ago

I have to fix all workflows and tests to close this.

Zethson commented 4 years ago

Now we have to figure out how to do the tests.

Zethson commented 4 years ago

@Imipenem I doubt that we'll get an answer haha.

What was your "hardcore" mocking idea about the tests again?

And the respective advantages and disadvantages?

Zethson commented 4 years ago

https://github.com/tmbo/questionary/issues/49#issuecomment-652574068

We got an answer and should discuss this over the next couple of days.