jazzband / django-push-notifications

Send push notifications to mobile devices through GCM or APNS in Django.
MIT License
2.26k stars 613 forks source link

Breaking change in Django 3.0. Need to add six to continue Python 2 support. #542

Closed jonathan-golorry closed 4 years ago

jonathan-golorry commented 4 years ago

Django 2.0 dropped official support for python 2, but left in some compatibility APIs for 3rd party apps.

Django 3.0 removed those compatibility APIs (1 month before python 2 end-of-life): https://docs.djangoproject.com/en/3.0/releases/3.0/#removed-private-python-2-compatibility-apis

Projects using Django 3.0 and django-push-notifications 1.6.1 fail to run:

File ".../push_notifications/models.py", line 3, in <module>
    from django.utils.encoding import python_2_unicode_compatible
ImportError: cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding'

This affects: 1) https://github.com/jazzband/django-push-notifications/blob/f0d6b792a3b7ed8ab53fe69091a06f8ff843858e/push_notifications/fields.py#L7 2) https://github.com/jazzband/django-push-notifications/blob/a45f71d58e0d85bb63519f0c12f2526516188177/push_notifications/models.py#L4 3) https://github.com/jazzband/django-push-notifications/blob/a45f71d58e0d85bb63519f0c12f2526516188177/push_notifications/conf/legacy.py#L2 4) https://github.com/jazzband/django-push-notifications/blob/a45f71d58e0d85bb63519f0c12f2526516188177/push_notifications/conf/app.py#L2

It looks like these are only using string_types and python_2_unicode_compatible, which are both available from the standard "six" package. Is there a preference on adding six as a requirement vs vendoring it?

andylamp commented 4 years ago

sorry to reopen this but when are you planning to update pypi with a new release of the package containing the fixes of the last few patches?

Achint08 commented 4 years ago

when is this getting updated on pypi?

jonathan-golorry commented 4 years ago

I'm not the person to ask. I think @jleclanche is the only one with pypi access.

bertonha commented 4 years ago

@jleclanche any provision to release a version on PyPi django 3.0 compatible ?

andylamp commented 4 years ago

@jonathan-golorry is there any reason only one person has access to pypi for this project?