Closed senyai closed 2 years ago
Hey there! Sorry about the long delay, had some things life to handle and I got a bit wrapped up in the new TIM implementation.
The IndexError
issue is something I've run into but I haven't isolated before this issue. It should be relatively easy to fix. The inaccuracy in the README stems from me forgetting to implement a prompt
parameter into the new InputField
, which once again will be fixed relatively soon.
This work is planned after the next release at the moment, but it might come before if things work out differently. The tim-v3
branch has gotten very large in terms of API changes and new functionality, so it makes things easier if I focus on that area for now.
Should be fixed now! Could you please confirm it works on the latest commit?
P.S. Thank you for the code example, it made debugging way easier!
Back from vacation. pytermgui is uninstallable (in fedora):
python -m pip install pytermgui -U
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pytermgui in /home/senyai/.local/lib/python3.10/site-packages (6.4.0)
Collecting pytermgui
Using cached PyTermGUI-7.1.0.tar.gz (18.4 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
WARNING: Generating metadata for package pytermgui produced metadata for project name unknown. Fix your #egg=pytermgui fragments.
WARNING: Discarding https://files.pythonhosted.org/packages/97/45/53ea7da6c280c6555671c34dbf289c14444bf3741b5b3ee0a08ec546824e/PyTermGUI-7.1.0.tar.gz#sha256=1bd01209d5ed223748b704d5cddef404d10744125dbdfc63f06d17589d547ba6 (from https://pypi.org/simple/pytermgui/) (requires-python:>=3.8). Requested unknown from https://files.pythonhosted.org/packages/97/45/53ea7da6c280c6555671c34dbf289c14444bf3741b5b3ee0a08ec546824e/PyTermGUI-7.1.0.tar.gz#sha256=1bd01209d5ed223748b704d5cddef404d10744125dbdfc63f06d17589d547ba6 has inconsistent name: filename has 'pytermgui', but metadata has 'unknown'
Using cached PyTermGUI-7.0.0.tar.gz (18.4 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
WARNING: Generating metadata for package pytermgui produced metadata for project name unknown. Fix your #egg=pytermgui fragments.
WARNING: Discarding https://files.pythonhosted.org/packages/2e/22/0f3f99568aabec709154e7061111257e664bf4fcae49d32162c2d7bbf808/PyTermGUI-7.0.0.tar.gz#sha256=ef7fd086694cb108eb5bea5475d58a35bc9df22d0802c032d6b5d1fccc8febc8 (from https://pypi.org/simple/pytermgui/) (requires-python:>=3.8). Requested unknown from https://files.pythonhosted.org/packages/2e/22/0f3f99568aabec709154e7061111257e664bf4fcae49d32162c2d7bbf808/PyTermGUI-7.0.0.tar.gz#sha256=ef7fd086694cb108eb5bea5475d58a35bc9df22d0802c032d6b5d1fccc8febc8 has inconsistent name: filename has 'pytermgui', but metadata has 'unknown'
That's super odd. What version of pip are you using?
It's 21.3.1 in fedora. I tried pip 22.2 but nothing changed. I've never seen an error like this.
Have you tried running pip cache purge
before installation? Maybe something got corrupted on the way.
No. Will try tomorrow.
Nope
I was able to install latest PyTermGUI on Ubuntu machine and there's no
IndexError
there. Let's leave Fix your #egg=pytermgui fragments
till someone else encounters it, might be something Fedora specific.
I haven't seen it either, but it likely is something to do with the new build system. I have a change reversal (going from PyTermGUI
-> pytermgui
for the package [not module] name) that might target it, so if it's okay with you I might ping you here when that is released.
Thanks for (both) report(s)!
It worked!
python -m pip install PyTermGUI --user
Collecting PyTermGUI
Downloading pytermgui-7.2.0-py3-none-any.whl (172 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 172.7/172.7 kB 2.6 MB/s eta 0:00:00
Requirement already satisfied: typing-extensions in /usr/lib/python3.10/site-packages (from PyTermGUI) (3.10.0.2)
Installing collected packages: PyTermGUI
Successfully installed PyTermGUI-7.2.0
[notice] A new release of pip available: 22.2 -> 22.2.2
[notice] To update, run: python -m pip install --upgrade pip
Nice! Something was wring with the setuptools
way of building from pyproject.toml
, but Hatch
seems to have fixed that.
Let's use example from the README.md
After running this script with python 3.10.5 and pytermgui 6.4.0 I see this image:
which is far off![image](https://user-images.githubusercontent.com/76137/175279689-22a5a28b-0e2e-49a4-bda1-3baa05cf195c.png)
After seeing this image, one can write a lot of
A
into the input box.Then clicking invisible
[ Submit! ]
button will trigger IndexError:I tried gnome-terminal and alacritty which gave me same error and visuals. Hope it help.