petereon / beaupy

A Python library of interactive CLI elements you have been looking for
https://petereon.github.io/beaupy/
MIT License
183 stars 13 forks source link

feat: Support the delete, home, end, up, and down keys in text input #35

Closed MatanRubin closed 1 year ago

MatanRubin commented 1 year ago

Before this commit, the up and down keys would input weird characters during text input, and the home, end, and delete keys did not work as expected. Now, all these keys behave as expected.

MatanRubin commented 1 year ago

Looks like I have some test failures. I'm having some difficulties installing the dependencies after you switched to click, so it's hard for me to debug and resolve the failures. I'll try fixing my environment and then fixing the failing tests.

petereon commented 1 year ago

Looks like I have some test failures. I'm having some difficulties installing the dependencies after you switched to click, so it's hard for me to debug and resolve the failures. I'll try fixing my environment and then fixing the failing tests.

@MatanRubin , feel free to share the difficulties you face, I will gladly try to help and it might also be something I might want to include in documentation.

MatanRubin commented 1 year ago

Seems like installing click and its dependencies fail with errors such as ERROR: Can not execute setup.py since setuptools is not available in the build environment.. I'm trying to install click in a separate project to see if it's related to this project or maybe something's wrong with my environment. I'm working on macOS. Will update when I find something.

petereon commented 1 year ago

I am also working on MacOS but I also manually test on Linux. Might be Python. Have you by any chance compiled your own?

MatanRubin commented 1 year ago

Seems like it's a poetry bug (see https://community.render.com/t/build-can-not-execute-setup-py-since-setuptools-is-not-available/3983/3). After updating poetry to >1.2 installation completed successfully.

MatanRubin commented 1 year ago

@petereon , I tested the two failing tests manually and everything seems to work well. Do you understand why they fail?

Also, I couldn't see how to debug ward tests in PyCharm/Intellij. Any pointers for that so that I could debug tests more easily?

petereon commented 1 year ago

@MatanRubin Found it. .split() defaults to splitting on whitespace, so 'Hello'.split() returns ['Hello'], once I change all the 'Hello'.split() to list('Hello') tests pass.

petereon commented 1 year ago

As for debugging ward tests, I have never tried that and I generally use VS Code, so I can't really speak from experience with PyCharm, but as far as I have checked PyCharm does not support Ward. Only reference to debugging in Ward documentation I found is here.

MatanRubin commented 1 year ago

@MatanRubin Found it. .split() defaults to splitting on whitespace, so 'Hello'.split() returns ['Hello'], once I change all the 'Hello'.split() to list('Hello') tests pass.

Silly me. I knew that, and even did it the right way in other tests :)

Anyways, I pushed a fix.

I also bumped poetry to >1.2 so that other people won't have issues with the bug I saw.

MatanRubin commented 1 year ago

@petereon, the pipeline still seems to fail, but I can't find the details on the failure itself. What am I missing?

petereon commented 1 year ago

@petereon, the pipeline still seems to fail, but I can't find the details on the failure itself. What am I missing?

@MatanRubin Yeah, it's a lint pipeline that's failing because of the repository secrets that are not available in the PR coming from a fork. I found no sane way around it. It's nothing to worry about though.

I am merging. Thanks for a great contribution.