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

Update prompt_toolkit to be compatible with ipython #344

Open
1 task done
FantasqueX opened this issue Dec 19, 2023 · 6 comments · May be fixed by #347
Open
1 task done

Update prompt_toolkit to be compatible with ipython #344

FantasqueX opened this issue Dec 19, 2023 · 6 comments · May be fixed by #347
Labels
Enhancement New feature or request

Comments

@FantasqueX
Copy link

Question

Hi, thanks for this wonderful library. My issue when using questionary is that the latest questionary requires prompt_toolkit<=3.0.36 https://github.com/tmbo/questionary/blob/master/pyproject.toml#L36 while another popular tool ipython requires prompt_toolkit>=3.0.41 https://github.com/ipython/ipython/blob/main/setup.cfg#L38. Because of pip's terrible dependency management, I cannot make questionary and ipython be both happy.

I saw you referred to an issue prompt-toolkit/python-prompt-toolkit#1726, however it's not convenient to reproduce with a not well-maintained library(jellex). I wonder whether you can check 3.0.42 prompt_toolkit is compatible with questionary or provide a small reproducible code with questionary. Thank you.

What have you already tried?

Took a look at prompt-toolkit/python-prompt-toolkit#1726

Read the documentation

  • I have checked to ensure that my question is not answered by the documentation.
@FantasqueX FantasqueX added the Question Further information is requested label Dec 19, 2023
@gsakkis
Copy link

gsakkis commented Dec 27, 2023

I also ran into this with ipython.

Because of pip's terrible dependency management, I cannot make questionary and ipython be both happy.

What terrible dependency management? There are two packages with conflicting requirements, what is pip (or any other dependency manager) supposed to do other than error out mentioning the conflict?

@FantasqueX FantasqueX changed the title Update prompt_toolkit to be compatible with ipythonr Update prompt_toolkit to be compatible with ipython Dec 27, 2023
@kiancross kiancross added Enhancement New feature or request and removed Question Further information is requested labels Dec 29, 2023
@kiancross
Copy link
Collaborator

I've marked this as an enhancement. Happy to review any PRs for this.

@FantasqueX FantasqueX linked a pull request Dec 30, 2023 that will close this issue
2 tasks
FantasqueX added a commit to FantasqueX/questionary that referenced this issue Dec 30, 2023
Currently one test will fail with latest prompt_toolkit(3.0.43).
test_blank_line_fix will throw RuntimeError: no running event loop.
By bisecting commit, the culprit is
prompt-toolkit/python-prompt-toolkit@a775996.
This commit replaces custom `get_event_loop` with `asyncio.get_event_loop`. The former will creator a new loop if `asyncio.get_running_loop` fails while the latter won't.
I mimic the changes in the examples to use `asyncio.run` and the test
passes. I'm not sure whether more changes are needed.

Fixes: tmbo#344
FantasqueX added a commit to FantasqueX/questionary that referenced this issue Dec 30, 2023
Currently one test will fail with latest prompt_toolkit(3.0.43).
test_blank_line_fix will throw RuntimeError: no running event loop.
By bisecting commit, the culprit is
prompt-toolkit/python-prompt-toolkit@a775996.
This commit replaces custom `get_event_loop` with `asyncio.get_event_loop`. The former will creator a new loop if `asyncio.get_running_loop` fails while the latter won't.
I mimic the changes in the examples to use `asyncio.run` and the test
passes.

Fixes: tmbo#344
FantasqueX added a commit to FantasqueX/questionary that referenced this issue Jan 9, 2024
Currently one test will fail with latest prompt_toolkit(3.0.43).
test_blank_line_fix will throw RuntimeError: no running event loop.
By bisecting commit, the culprit is
prompt-toolkit/python-prompt-toolkit@a775996.
This commit replaces custom `get_event_loop` with `asyncio.get_event_loop`. The former will creator a new loop if `asyncio.get_running_loop` fails while the latter won't.
I mimic the changes in the examples to use `asyncio.run` and the test
passes.

Fixes: tmbo#344
FantasqueX added a commit to FantasqueX/questionary that referenced this issue Jan 26, 2024
Currently one test will fail with latest prompt_toolkit(3.0.43).
test_blank_line_fix will throw RuntimeError: no running event loop.
By bisecting commit, the culprit is
prompt-toolkit/python-prompt-toolkit@a775996.
This commit replaces custom `get_event_loop` with `asyncio.get_event_loop`.
The former will creator a new loop if `asyncio.get_running_loop` fails while the latter won't.
I mimic the changes in the examples to use `asyncio.run` and the test
passes.

Fixes: tmbo#344
@florian6973
Copy link

Also faced this issue. Would be very much appreciated :)

@Em1lyK
Copy link

Em1lyK commented Mar 6, 2024

I'm facing this issue as well

@tosilswc
Copy link

PLEASE merge FantasqueX fork into the official repository, the dependency issue is fixed by substituting the official package with the fork.

@danieltomasz
Copy link

This might be related prompt-toolkit/python-prompt-toolkit#1809

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

Successfully merging a pull request may close this issue.

7 participants