whaaaaat icon indicating copy to clipboard operation
whaaaaat copied to clipboard

Incompatible with prompt_toolkit version 2.0

Open zsefvlol opened this issue 6 years ago • 12 comments

As prompt_toolkit 2.0 is not compatible with 1.0 (upgrade guide). whaaaaat can not be imported right now. Errors below.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/whaaaaat/__init__.py", line 6, in <module>
    from prompt_toolkit.token import Token
ImportError: cannot import name Token

Temporary fix:

pip uninstall prompt-toolkit
pip install -Iv prompt_toolkit==1.0.15

zsefvlol avatar Jul 06 '18 10:07 zsefvlol

I saw the pt2 branch, but wasn't able to try it out, maybe because it targets a pre-release of pt2 (the req.txt seems to reference a commit that's been rebased, so it does not exist anymore?) Do you have any plan of resurrecting it?

lelit avatar Aug 08 '18 20:08 lelit

Just checkout the master branch, it should be on version 2 now. https://github.com/jonathanslenders/python-prompt-toolkit

zsefvlol avatar Aug 08 '18 23:08 zsefvlol

Yes, I know, 2.0.4 is official now: but the pt2 branch does not seem to work with that neither.

lelit avatar Aug 09 '18 05:08 lelit

You might want to pin prompt_toolkit in requirements.txt to version 1.0.15 until you can update the library to ver 2.0.

marcosfelt avatar Aug 29 '18 02:08 marcosfelt

I've been working on a fork of this stale project which runs on prompt toolkit 2: https://github.com/tmbo/questionary (does not work with prompt_toolkit 1 though, as it really is either or)

tmbo avatar Dec 14 '18 17:12 tmbo

Thanks, I will surely try it out!

lelit avatar Dec 14 '18 17:12 lelit

@tmbo, why have you discarded previous history? I would have expected some acknowledgement to at least markfink...

Anyway, is questionary completely API-compatible with whaaaat?

lelit avatar Dec 14 '18 17:12 lelit

@lelit my work is based on https://github.com/CITGuru/PyInquirer, so I acknowledged the work of Oyetoke Toby. But you are right, I have added Mark Fink to the Readme as well, let me know if I am missing someone.

https://github.com/tmbo/questionary#contributors (is there a better place to put this?)

The API is compatible for the prompt types implemented (it is compatible to PyInquierer, but I think that one is in turn API compatible).

tmbo avatar Dec 14 '18 17:12 tmbo

Great, thank you again.

lelit avatar Dec 14 '18 17:12 lelit

@tmbo, just to say thank you again: FYI, basically replacing imports was enough to port my tinject tool to questionary :smiley:

lelit avatar Dec 16 '18 13:12 lelit

so can we close this?

markfink avatar Dec 17 '18 09:12 markfink

That's up to you, obviously: the existence of an PTv2-compatible alternative library does not actually change the fact that whaaaaat is not PTv2-ready. If you do not foresee it reaching that state (in other words, if the pt2 branch is not going to evolve), the yes, and maybe make it official to avoid reopening similar issue. Thanks for the work you have done, either way.

lelit avatar Dec 17 '18 13:12 lelit