wyfo / apischema

JSON (de)serialization, GraphQL and JSON schema generation using Python typing.

Home Page:https://wyfo.github.io/apischema/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python 3.11 support

ltworf opened this issue · comments

Hello!

Unfortunately it seems that currently published apischema doesn't run on python 3.11.

still - by the looks of it

  File "/home/maclei/poc/python/jup-poc/dca_poc.py", line 16, in <module>
    from apischema import deserialize, serialize
  File "/home/maclei/poc/python/jup-poc/.venv/lib/python3.11/site-packages/apischema/__init__.py", line 30, in <module>
    from . import (  # noqa: F401
  File "/home/maclei/poc/python/jup-poc/.venv/lib/python3.11/site-packages/apischema/cache.py", line 6, in <module>
    from apischema.utils import type_dict_wrapper
  File "/home/maclei/poc/python/jup-poc/.venv/lib/python3.11/site-packages/apischema/utils.py", line 37, in <module>
    from apischema.typing import (
  File "/home/maclei/poc/python/jup-poc/.venv/lib/python3.11/site-packages/apischema/typing.py", line 98, in <module>
    from typing import _collect_type_vars  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: cannot import name '_collect_type_vars' from 'typing' (/home/maclei/.pyenv/versions/3.11.0/lib/python3.11/typing.py)

Well there haven't been changes since 30 Mar

aah right. It seems that _collect_type_vars is not being used in my use case - and I was able to work around it by commenting out the import and subsequent references. YMMV

I'm deeply sorry for the time it took to get 3.11 support, I'd taken a (too) long break but I'm back now.

hey - no worries. I was looking at this again this morning actually and it looks like _collect_type_vars is available in typing_extensions and 8should* be a straight replacement for what was in typing.

https://pypi.org/project/typing-extensions/