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

Crashes in Python 3.8 (and prior) due to usage of list[str] type annotation by terminaltables3 #498

Open
zkprisma opened this issue Aug 18, 2024 · 3 comments
Labels

Comments

@zkprisma
Copy link

What happened:

TypeError in terminaltables3\width_and_alignment.py", line 49

What you expected to happen:

to work and give output

Output with --explain

Please provide the output of running the same command with the --explain flag like so

$ howdoi YOUR_COMMAND --explain
C:\Users\zeev.PRISMA\pz\microservices\pz_integrations\zebra\test_utils>howdoi install howdoi --explain
Traceback (most recent call last):
  File "C:\Users\zeev.PRISMA\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\zeev.PRISMA\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\zeev.PRISMA\virtualenvs\pzdev\Scripts\howdoi.exe\__main__.py", line 4, in <module>
  File "c:\users\zeev.prisma\virtualenvs\pzdev\lib\site-packages\howdoi\howdoi.py", line 33, in <module>
    from keep import utils as keep_utils
  File "c:\users\zeev.prisma\virtualenvs\pzdev\lib\site-packages\keep\utils.py", line 12, in <module>
    from terminaltables3 import AsciiTable
..
  File "c:\users\zeev.prisma\virtualenvs\pzdev\lib\site-packages\terminaltables3\width_and_alignment.py", line 49, in <module>
    ) -> list[str]:
TypeError: 'type' object is not subscriptable
@zkprisma zkprisma added the bug label Aug 18, 2024
@gleitz
Copy link
Owner

gleitz commented Aug 20, 2024

Hmm, I wonder if this is an issue with keep upstream?
https://pypi.org/project/keep/

We're currently on 2.9 but it looks like there is now 2.11. Would you try updating the keep version and seeing if you still get the error?

@zkprisma
Copy link
Author

pip install keep==2.9 does resolve the issue

Maybe you want to apply the "We're currently on 2.9" statement in setup.py?
i.e. replace 'keep' with 'keep==2.9' ?

@gleitz
Copy link
Owner

gleitz commented Aug 22, 2024

Hmm, interesting. Did you install howdoi with pip, or are you installing it from source? I was pretty sure that pip was using the correct versions since we specify it in the requirements here.

I see there is also a way to have the setup.py read from the requirements file, which might be a better option.

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

No branches or pull requests

2 participants