markfink / whaaaaat

Inquirer.js port to Python (https://www.npmjs.com/package/inquirer). people blame me for staling this project. I do not have time to work on this right now - whaaaaat do you want me to do? take it offline?
MIT License
83 stars 9 forks source link

Incompatible with prompt_toolkit version 2.0 #23

Open zsefvlol opened 5 years ago

zsefvlol commented 5 years ago

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
lelit commented 5 years ago

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?

zsefvlol commented 5 years ago

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

lelit commented 5 years ago

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

marcosfelt commented 5 years ago

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.

tmbo commented 5 years ago

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)

lelit commented 5 years ago

Thanks, I will surely try it out!

lelit commented 5 years ago

@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?

tmbo commented 5 years ago

@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).

lelit commented 5 years ago

Great, thank you again.

lelit commented 5 years ago

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

markfink commented 5 years ago

so can we close this?

lelit commented 5 years ago

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.