Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible with prompt_toolkit version 2.0 #23

Open
zsefvlol opened this issue Jul 6, 2018 · 12 comments
Open

Incompatible with prompt_toolkit version 2.0 #23

zsefvlol opened this issue Jul 6, 2018 · 12 comments

Comments

@zsefvlol
Copy link

zsefvlol commented Jul 6, 2018

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
Copy link
Contributor

lelit commented Aug 8, 2018

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
Copy link
Author

zsefvlol commented Aug 8, 2018

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

@lelit
Copy link
Contributor

lelit commented Aug 9, 2018

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

@marcosfelt
Copy link

marcosfelt commented Aug 29, 2018

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 pushed a commit to marcosfelt/whaaaaat that referenced this issue Aug 29, 2018
Pinned prompt_toolkit to version 1.0.14. Previously, it would install ver 2.0 which has breaking changes.

fixes markfinkGH-23
@tmbo
Copy link

tmbo commented Dec 14, 2018

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
Copy link
Contributor

lelit commented Dec 14, 2018

Thanks, I will surely try it out!

@lelit
Copy link
Contributor

lelit commented Dec 14, 2018

@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
Copy link

tmbo commented Dec 14, 2018

@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
Copy link
Contributor

lelit commented Dec 14, 2018

Great, thank you again.

@lelit
Copy link
Contributor

lelit commented Dec 16, 2018

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

@markfink
Copy link
Owner

so can we close this?

@lelit
Copy link
Contributor

lelit commented Dec 17, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants