CITGuru / PyInquirer

A Python module for common interactive command line user interfaces
MIT License
1.91k stars 236 forks source link

Upgrading to prompt_toolkit 2.0 #14

Open oldboldpilot opened 5 years ago

oldboldpilot commented 5 years ago

Will it take a lot to upgrade this to work with prompt_toolkit 2.0? Is there any help I can render to make that happen?

CITGuru commented 5 years ago

I am afraid to say that won't happen anytime soon. Cos upgrading to 2.0, will require a lot of work and rewiring. prompt_toolkit 2.0 was rewritten from scratch and they totally ditch Token and many other things PyInquirer depends on. What I could suggest is we create PyInquirer2 from scratch that will work with prompt_toolkit 2.0. And that will only happen once I am able to complete all TODO we still have left. I have thought of this sometime ago and that's the only solution. So people could choose the version they want.

oldboldpilot commented 5 years ago

That sounds fair, will be willing to work on PyInquirer2 then, it does not seem like a bad idea. Thanks for responding so quickly :+1:

CITGuru commented 5 years ago

You welcome, I'll be glad to work with you in the nearest future :handshake:

rigogsilva commented 5 years ago

Let's get this going. I'd be willing to help out. Mostly to get the autocomplete functionality.

Apreche commented 5 years ago

Just discovered PyInquirer, and it's not working for me because iPython uses prompt-toolkit 2, and that causes a conflict.

CITGuru commented 5 years ago

@rigogsilva Thanks for that, I'd be glad if we could work on it. @Apreche Yeah, you can't use PyInquirer on iPython cos, PyInquirer still uses Prompt toolkit 1.0

CITGuru commented 5 years ago

And talking about Pompt toolkit 2.0, I actually devoted my free time to read the doc and went through the source code. Though some huge changes are made but not as I expected, PyInquirer rely on Token which is from prompt toolkit Pygments for coloring alot. In 2.0 we can still use it in a better and creative. I actually like the way they structure the new style_from_dict. Off course there are some other changes I need to point out.

I have been busy lately cos my remote company is pushing out new products these past months and has not been easy for core Python and Rust developers.

So PyInquirer 1.0.3 will be released soon, I'll already draft the release, I just need time to fix some issues. You can check out https://github.com/CITGuru/PyInquirer/issues/ and look at the ones you can suggest fix for.

The dev branch commits has been merged into master. So you can now install from master.

PyInquirer 2 development will be pushed to github for contribution on the release date of PyInquirer 1.0.3.

Read about Prompt toolkit 2.0 - https://python-prompt-toolkit.readthedocs.io/

Thanks

tmbo commented 5 years ago

Yes, happy to help out as well - letโ€™s get this going ๐Ÿš€

tmbo commented 5 years ago

@CITGuru how willing are you to move quick on this? We depend on this library for one of our larger projects, but the usage of prompt_toolkit is a dealbreaker because of ipythons dependency on prompt_toolkit2.

As said, I am very happy to help out. I've been looking into it and it is actually rather straight forward. I don't understand why the development for this is waiting for a minor release (why not create a bugfix branch for 1.0.x) instead of going full steam on this.

I know this is a side project for you, therefore I completely understand if you let me know that you just do not have enough time to move this project forward.

My team needs to move fast on this, but since you have been putting so much work into maintaining this library, I also do not want to step on your tows. We'll have a prompt toolkit 2 ready version by the end of the week, the question is if it is going to be part of this project or a fork.

CITGuru commented 5 years ago

I really appreciate your concerns and understanding. I know how we feel when our projects depend on a good and promising project. But what turn us off is when the project is poorly maintained, I mean, that was the whole idea of PyInquirer. So I am looking at the best way to create time for managing this project.

While we wait for PyInquirer 2, I decided to release PyInquirer 1.0.3 bugfix release earlier as expected. @tmbo Its out now

tmbo commented 5 years ago

That's great news :rocket: and I'd be way happier keeping this project going then to create a fork.

I know it is challenging to balance open source, your job and your private life - so let's find ways to make this work.

You mentioned that you already started working on prompt toolkit 2 support, do you mind pushing that code so that we can properly branch of from there? If not thats fine as well, and I'll just create a PR against master.

CITGuru commented 5 years ago

@tmbo I'll be working on it this weekend so I should be able to push up what I have by monday, if all goes as scheduled

tmbo commented 5 years ago

I did convert the list and confirm views locally, so let me know if you need them.

CITGuru commented 5 years ago

@tmbo Really, can you push up to a branch, so I can look at your approach. Trying to create a style where we could use prompt_toolkit plugin.

tmbo commented 5 years ago

sure - I'll create WIP PR

tmbo commented 5 years ago

@CITGuru I've pushed the list & confirm prompts as part of #31

CITGuru commented 5 years ago

@tmbo Thanks. I found something weird, still don't know how, but it seems prompt_toolkit 1 works with the changes you made for prompt_toolkit

CITGuru commented 5 years ago

@tmbo Was able to convert input, editor to prompt_toolkit2. So no standard design yet, still converting others, rawlist,expand, password (this should be fairly easy), checkbox

CITGuru commented 5 years ago

I should be done by tomorrow, its weekend here Saturday precisely, wanna rest more and back to it as soon as wake up. See ya

tmbo commented 5 years ago

Let me know if you need help converting any one of these.

tmbo commented 5 years ago

It would be great if you share your code so we can help you and collaborate on this project. Do you mind pushing your changes to a branch?

If you can't do all the work on your own, e.g. because you are short on time, you need to make sure others can help you.

tmbo commented 5 years ago

Because I could not wait for this to drag on further, I created a separate library https://github.com/tmbo/questionary based on prompt toolkit 2. I tried to avoid this, but we needed to move faster for our project https://github.com/rasahq/rasa_core which uses the library.

woile commented 5 years ago

fantastic @tmbo I was also needing something like that. Thanks a lot!

tecosaur commented 5 years ago

is PyInquirer going to move to prompt toolkit 2 any time soon? Or should I stop holding out hope and more to questionary?

rednafi commented 4 years ago

Prompt toolkit 0.1.14 is completely breaking ipython notebook. Pyinquirer 2.0 is nowhere to be found and the library already seems fragmented. Then there is questionary. Thanks for your awesome work nonetheless.

woile commented 4 years ago

For people with problems with prompt toolkit < 2.0, there are currently 2 solutions which kinda fit:

rednafi commented 4 years ago

@Woile questionary seems awesome, built on Pyinquirer. It can directly be adopted as pyinquirer 2.0. However, the development seems slow there which is quite understandable. Maybe we can create some traction there. Thanks for the info...:)

tmbo commented 4 years ago

@rednafi well, development is "slow" as there isn't a lot to develop at the moment. if there are features / bugs you are running into please create an issue ๐Ÿ˜ƒ

rednafi commented 4 years ago

@tmbo questionary is working like a charm. Doesn't conflict with jupyter notebook which has a prompt_toolkit 2.0.9 dependency. Thanks!!

doylejg commented 4 years ago

Just wanted to bump this thread. Are we still waiting on pyinquirer2.0 or is the accepted solution to just move to questionary ?

LuRenJiasWorld commented 4 years ago

I'm glad to help developing PyInquirer2 as well. Please feel free to contact me if you are ready to work. My email is loli@lurenjia.in.

yanlend commented 4 years ago

Upgrading the dependency to newer versions of prompt_toolkit would be required for us. Is it still going to happen or are you recommending the move to questionary?

jonathanslenders commented 3 years ago

Hi everyone, this PR should upgrade to prompt_toolkit 3: https://github.com/CITGuru/PyInquirer/pull/118 Note that it also means that Python 2 support will be dropped.

CITGuru commented 3 years ago

Please read this, Looking for maintainer/successor. https://github.com/CITGuru/PyInquirer/issues/159

o-nikolas commented 2 years ago

Hey folks, now that @jonathanslenders's PR to support prompt_toolkit 3 has been merged, can a release be cut so that we can make use of this contribution?