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

python 3.8 does not seem to work #14

Open
wjs20 opened this issue Feb 8, 2024 · 0 comments
Open

python 3.8 does not seem to work #14

wjs20 opened this issue Feb 8, 2024 · 0 comments

Comments

@wjs20
Copy link

wjs20 commented Feb 8, 2024

I installed the package with python 3.8 and I got the error message below.

| python
Python 3.8.10 (default, Nov 14 2022, 12:59:47)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from platechain.constants import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ws/git/platechain/src/platechain/__init__.py", line 1, in <module>
    from platechain.chain import chain, parse_plates
  File "/home/ws/git/platechain/src/platechain/chain.py", line 38, in <module>
    class ParsePlateRequest(BaseModel):
  File "/home/ws/.cache/pypoetry/virtualenvs/platechain-H7xkWrxE-py3.8/lib/python3.8/site-packages/pydantic/_internal/_model_construction.py", line 183, in __new__
    set_model_fields(cls, bases, config_wrapper, types_namespace)
  File "/home/ws/.cache/pypoetry/virtualenvs/platechain-H7xkWrxE-py3.8/lib/python3.8/site-packages/pydantic/_internal/_model_construction.py", line 418, in set_model_fields
    fields, class_vars = collect_model_fields(cls, bases, config_wrapper, types_namespace, typevars_map=typevars_map)
  File "/home/ws/.cache/pypoetry/virtualenvs/platechain-H7xkWrxE-py3.8/lib/python3.8/site-packages/pydantic/_internal/_fields.py", line 99, in collect_model_fields
    type_hints = get_cls_type_hints_lenient(cls, types_namespace)
  File "/home/ws/.cache/pypoetry/virtualenvs/platechain-H7xkWrxE-py3.8/lib/python3.8/site-packages/pydantic/_internal/_typing_extra.py", line 212, in get_cls_type_hints_lenient
    hints[name] = eval_type_lenient(value, globalns, localns)
  File "/home/ws/.cache/pypoetry/virtualenvs/platechain-H7xkWrxE-py3.8/lib/python3.8/site-packages/pydantic/_internal/_typing_extra.py", line 224, in eval_type_lenient
    return typing._eval_type(value, globalns, localns)  # type: ignore
  File "/usr/lib/python3.8/typing.py", line 270, in _eval_type
    return t._evaluate(globalns, localns)
  File "/usr/lib/python3.8/typing.py", line 518, in _evaluate
    eval(self.__forward_code__, globalns, localns),
  File "<string>", line 1, in <module>
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

Apparently support for expressing unions of types using the pipe operater was only introduced in python 3.10. So I think this needs to be reflected in the requirements file (At the moment it is set to ^3.8)

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

No branches or pull requests

1 participant