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.10 - Schematics finally broke #628

Open
ahopkins opened this issue Oct 4, 2021 · 4 comments
Open

Python 3.10 - Schematics finally broke #628

ahopkins opened this issue Oct 4, 2021 · 4 comments

Comments

@ahopkins
Copy link

ahopkins commented Oct 4, 2021

Schematics has been ignoring this:

$ python
Python 3.9.7 (default, Aug 31 2021, 13:28:12) 
[GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from collections import Iterable
<stdin>:1: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working

With the release of Python 3.10, it is finally broken:

$ python                
Python 3.10.0rc2 (default, Oct  4 2021, 11:48:47) [GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from collections import Iterable
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'Iterable' from 'collections' (/usr/local/lib/python3.10/collections/__init__.py)
@kjaquier
Copy link

On Python 3.10:

Python 3.10.0 (default, Oct 13 2021, 08:45:17) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import schematics
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/root/.cache/pypoetry/virtualenvs/poetry-demo-il7asoJj-py3.10/lib/python3.10/site-packages/schematics/__init__.py", line 5, in <module>
    from .models import Model, ModelMeta
  File "/root/.cache/pypoetry/virtualenvs/poetry-demo-il7asoJj-py3.10/lib/python3.10/site-packages/schematics/models.py", line 11, in <module>
    from .datastructures import OrderedDict, Context
  File "/root/.cache/pypoetry/virtualenvs/poetry-demo-il7asoJj-py3.10/lib/python3.10/site-packages/schematics/datastructures.py", line 6, in <module>
    from collections import MutableMapping, KeysView, ValuesView, ItemsView
ImportError: cannot import name 'MutableMapping' from 'collections' (/usr/local/lib/python3.10/collections/__init__.py)

@heuripedes
Copy link

heuripedes commented Mar 16, 2022

Ubuntu LTS 22.04 will ship with Python 3.10 in April 2022. Every user of the library would appreciate if someone could merge or adapt PR #595 to solve this issue. Meanwhile the solution is to move on to something else or maintain a fork that doesn't have the problem.

@lucaspolo
Copy link

Hello, is this project still maintained? If not, is there a fork or a good alternative?

@ahopkins
Copy link
Author

Hello, is this project still maintained? If not, is there a fork or a good alternative?

Seems 🪦 to me. I'd suggest migrating to another modelling lib. I am not aware of an alternative offering the same API as this. Maybe try attrs, marshmallow, or pydantic. All of those are very well supported and maintained.

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