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

marshmallow >= 3.1.0 not working in Python<3.5.3 #1409

Closed
lukaszdudek-silvair opened this issue Sep 17, 2019 · 5 comments · Fixed by #1410

Comments

@lukaszdudek-silvair
Copy link

commented Sep 17, 2019

Hello!

I'm getting the following error when using marshmallow 3.1.0 or 3.1.1 with pytest:

============================================== test session starts ===============================================
platform linux -- Python 3.5.2, pytest-5.1.2, py-1.8.0, pluggy-0.13.0
rootdir: ***, inifile: setup.cfg
plugins: cov-2.7.1, asyncio-0.10.0
collected 31 items / 1 errors / 30 selected                                                                      

===================================================== ERRORS =====================================================
______________________________ ERROR collecting tests_async/test_event_executor.py _______________________________
*** imports inside my project ***
    from marshmallow import Schema, fields, decorators
../../.local/share/virtualenvs/gateway-WH935Ska/lib/python3.5/site-packages/marshmallow/__init__.py:1: in <module>
    from marshmallow.schema import Schema, SchemaOpts
../../.local/share/virtualenvs/gateway-WH935Ska/lib/python3.5/site-packages/marshmallow/schema.py:14: in <module>
    from marshmallow import base, fields as ma_fields, class_registry
../../.local/share/virtualenvs/gateway-WH935Ska/lib/python3.5/site-packages/marshmallow/fields.py:434: in <module>
    class Nested(Field):
../../.local/share/virtualenvs/gateway-WH935Ska/lib/python3.5/site-packages/marshmallow/fields.py:480: in Nested
    unknown: str = None,
../../miniconda3/envs/gateway3.5.2/lib/python3.5/typing.py:552: in __getitem__
    dict(self.__dict__), parameters, _root=True)
../../miniconda3/envs/gateway3.5.2/lib/python3.5/typing.py:512: in __new__
    for t2 in all_params - {t1} if not isinstance(t2, TypeVar)):
../../miniconda3/envs/gateway3.5.2/lib/python3.5/typing.py:512: in <genexpr>
    for t2 in all_params - {t1} if not isinstance(t2, TypeVar)):
../../miniconda3/envs/gateway3.5.2/lib/python3.5/typing.py:1077: in __subclasscheck__
    if super().__subclasscheck__(cls):
../../.local/share/virtualenvs/gateway-WH935Ska/lib/python3.5/abc.py:225: in __subclasscheck__
    for scls in cls.__subclasses__():
E   TypeError: descriptor '__subclasses__' of 'type' object needs an argument

The last working version was 3.0.5.

@lafrech

This comment has been minimized.

Copy link
Member

commented Sep 17, 2019

https://stackoverflow.com/a/56010650

Works on PY3.5.3 but not 3.5.2 (your version).

Since we support 3.5.x, we'd need to fix this typing related issue.

Thanks for reporting.

@lafrech lafrech added the bug label Sep 17, 2019
@lukaszdudek-silvair

This comment has been minimized.

Copy link
Author

commented Sep 17, 2019

Thanks for a quick reply! Unfortunately, I'm unable to bump my Python version due to target platform constraints.

ylep added a commit to HumanBrainProject/cortical-voluba that referenced this issue Sep 17, 2019
@sloria sloria changed the title Cannot use marshmallow >= 3.1.0 in pytest marshmallow >= 3.1.0 not working in Python<3.5.3 Sep 17, 2019
@sloria

This comment has been minimized.

Copy link
Member

commented Sep 17, 2019

I was able to reproduce this in the python:3.5.2 Docker image. I've verified #1410 fixes this and I'll release it shortly.

That said, I can't promise we'll continue to support old Python point versions. It will be very costly from a maintenance perspective. These old versions are unsupported and a number of bug fixes and security fixes have been released since 3.5.2.

@sloria sloria closed this in #1410 Sep 17, 2019
@sloria

This comment has been minimized.

Copy link
Member

commented Sep 17, 2019

3.2.0 includes the fix.

@lukaszdudek-silvair

This comment has been minimized.

Copy link
Author

commented Sep 17, 2019

Thanks for a quick reaction!

ylep added a commit to HumanBrainProject/cortical-voluba that referenced this issue Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.