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.11 support #57

Closed
ndevenish opened this issue Nov 11, 2022 · 5 comments
Closed

Python 3.11 support #57

ndevenish opened this issue Nov 11, 2022 · 5 comments

Comments

@ndevenish
Copy link

Unfortunately it looks like apischema (no updates since march, looks relatively dead?) is not compatible with python 3.11, because it's using private APIs:

>>> import scanspec
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/env/lib/python3.11/site-packages/scanspec/__init__.py", line 1, in <module>
    from . import regions, specs
  File "/env/lib/python3.11/site-packages/scanspec/regions.py", line 7, in <module>
    from apischema import schema
  File "/env/lib/python3.11/site-packages/apischema/__init__.py", line 30, in <module>
    from . import (  # noqa: F401
  File "/env/lib/python3.11/site-packages/apischema/cache.py", line 6, in <module>
    from apischema.utils import type_dict_wrapper
  File "/env/lib/python3.11/site-packages/apischema/utils.py", line 37, in <module>
    from apischema.typing import (
  File "/env/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' (/env/lib/python3.11/typing.py)
>>>
@coretl
Copy link
Contributor

coretl commented Nov 11, 2022

Depending on apischema now looks like a mistake, @callumforrester is now seeing how painful it would be to move to pydantic instead in #56

@DominicOram
Copy link

We would like to get this fixed soon so that we can move https://github.com/dials/nexgen to Python 3.11. How far along are we with moving to pydantic, anything we can do to help?

@coretl
Copy link
Contributor

coretl commented Nov 24, 2022

@callumforrester what do you reckon?

@callumforrester
Copy link
Contributor

@coretl @DominicOram WIP here: #56
Hoping to get back to this soon, current challenge is in making a tagged union of subclasses, see pydantic/pydantic#4706. If you guys have any ideas RE that discussion, that would be helpful!

@coretl
Copy link
Contributor

coretl commented Dec 21, 2022

@callumforrester released 0.5.5 which supports python 3.11

@coretl coretl closed this as completed Dec 21, 2022
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

4 participants