wagtail-deprecated / wagtail-react-streamfield

Powerful field for inserting multiple blocks with nesting. (NO LONGER MAINTAINED - See Wagtail 2.13 Release Notes)
https://wagtail.github.io/react-streamfield/public/
BSD 3-Clause "New" or "Revised" License
74 stars 23 forks source link

feat: Allow React Streamfield to work with >=3 Django #56

Closed colinappnovation closed 4 years ago

colinappnovation commented 4 years ago

As others have noticed, using the Streamfield and django >= 3 no longer supports django.utils.six.

Solves: https://github.com/wagtail/wagtail-react-streamfield/issues/55

andsimakov commented 4 years ago

Can anybody accept this, please?

mariod3w commented 4 years ago

@BertrandBordage Please, accept this, we need in our project. Thanks

nkuttler commented 4 years ago

@mariod3w Fwiw, I simply added this to my deploy script:

sed -i "s/from django.utils.six import wraps/from six import wraps/" /path/to/venv/site-packages/wagtail_react_streamfield/monkey_patch.py
zerolab commented 4 years ago

imho, the import should be from functools import wraps since this package requires Wagtail >= 2.6 which only supports Python 3.5+ and six.wraps does the same for Python >= 3.4

Other than that đź‘Ť for merge and new version release

thibaudcolas commented 4 years ago

I’ll merge this tomorrow with @zerolab’s suggestion to use from functools import wraps, unless someone can think of a way why this is bad idea that has escaped us.

Judging by the code it seems pretty clear that there is no reason to use six considering our support targets, https://github.com/benjaminp/six/blob/c0be8815d13df45b6ae471c4c436cce8c192245d/six.py#L836-L837.

thibaudcolas commented 4 years ago

FYI I’ve set up a #react-streamfield channel on the Wagtail Slack if anyone wants to discuss maintenance of this project.

thibaudcolas commented 4 years ago

Thank you all, this is now released on PyPI as v1.3.6. It’s my first time publishing a release on this project so would appreciate if a few of you @colinappnovation @andsimakov @mariod3w @nkuttler tried it out on your projects and reported back.

I’ve also tried it out on https://github.com/thibaudcolas/wagtail_react_streamfield_demo but this is obviously just a toy project set up in a hurry.