gurock / trcli

TR CLI (trcli) is a command line tool for interacting with TestRail.
Mozilla Public License 2.0
48 stars 39 forks source link

trcli fails to run on python 3.8 #187

Closed chrisdavi closed 6 months ago

chrisdavi commented 7 months ago

TestRail CLI Version

1.6.3

CLI Environment

Ubuntu 20.04, Python 3.8.10

TestRail Version

7.41.8092

TestRail Instance Type

Professional Server

Current behavior

Created a virtual environment, used pip to install trcli. After installation, running trcli throws a stacktrace

(test) { ~ } » trcli
Traceback (most recent call last):
  File "/home/dev/.virtualenvs/bleh/bin/trcli", line 5, in <module>
    from trcli.cli import cli
  File "/home/dev/.virtualenvs/bleh/lib/python3.8/site-packages/trcli/cli.py", line 19, in <module>
    from trcli.data_classes.data_parsers import FieldsParser
  File "/home/dev/.virtualenvs/bleh/lib/python3.8/site-packages/trcli/data_classes/data_parsers.py", line 49, in <module>
    class FieldsParser:
  File "/home/dev/.virtualenvs/bleh/lib/python3.8/site-packages/trcli/data_classes/data_parsers.py", line 52, in FieldsParser
    def resolve_fields(fields: Union[list[str], dict]) -> (dict, str):
TypeError: 'type' object is not subscriptable

Desired behavior

Expected behavior would be for trcli to print a help page.

More Details

No response

bitcoder commented 7 months ago

Unfortunately, we don't provide support for Python 3.8. As mentioned on the documentation We recommend using Python 3.10 or newer.

chrisdavi commented 7 months ago

I understand.

Recommending 3.10 and above is a bit softer than saying that it only works on 3.10 and above though. Perhaps now you have positive confirmation that it definitely doesn't work below that version, a python_requires='>3.10.0' can be added to setup.py.

In any case, thank you for looking at the issue.

chrisdavi commented 7 months ago

I was able to get it working locally by replacing all the list type annotations with List imported from typing. Is this a thing y'all would be interested in me working through your PR / testing process or meh?

bitcoder commented 6 months ago

hi @chrisdavi , if you can make a quick PR and the changes are small/self-contained maybe we can include them. Nevertheless, I cannot fully commit that Python 3.8 will be supported on the future.

bitcoder commented 6 months ago

@chrisdavi , can you please update the PR with the latest changes from main?

chrisdavi commented 6 months ago

Synced.