-
-
Notifications
You must be signed in to change notification settings - Fork 867
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
Drop support for Python 2 #709
Conversation
I have rebased to resolve merge conflicts. @jschneier What do you think about this change? It would be nice to get the project compatible with the Django master branch again. |
Another reason this would be nice, Django 3.0 deprecated
By moving to Python3-only, we can safely use |
Any progress on this? |
Now that Python 2.7 is end-of-life and no longer receiving security updates, maybe now is the time? FWIW, here are the download statistics for django-storages for the last month. These where gathered using pypinfo:
Python 2.7 is less than 20% of all downloads. |
@jdufresne I would like to drop Python 2 support this weekend. At minimum I would like to release a version with the features in master. I think I would also be remiss not to enforce the security updates on Python 2 as well. Then another bump for the dropping. |
🎉 Sounds like a good plan to me. Let me know if you need any PR rebased or other work done to assist in the effort. Thanks for maintaining such an important project! |
Hi @jschneier, hope you're doing well. What do you think about moving ahead with the outlined plan above to release the next versions of django-storages? It has now been a month. It would be great to get the Django deprecation messages cleaned up. Let me know if there is anything I can do to help: changes, rebase, new fixes, or anything else. Cheers. |
Python 2 support is nearing end of life. At the end of this year, it will no longer be supported, including for security issues. Django has already dropped support for Python 2 in Django 2.0. Follow upstream to be more compatible with the master branch as tests now pass. For more details, see https://pythonclock.org/ All code changes and clean ups that were noticed were done. Changes include: - Remove str/unicode compatibility shims. - Remove encoding cookies from source files. Python 3 interprets all files as utf-8 by default. - Remove unnecessary __future__ imports. The features are now built-in. - Use modern and simpler super() syntax. - Update the wheel configuration to reflect it is no longer universal. - Update trove classifiers. - And more … Also remove supported for end of life Python 3.4. It went end of life 2019-03-18. Fixes #849
In Python3, these methods default to UTF-8.
Since Python 3.3, IOError has been merged into OSError. FileNotFoundError is a subclass, so its use is fully backwards compatible.
Django deprecated force_text() and smart_text() in favor of force_str() and smart_str() in: django/django@d55e882 Fixes #806
As django-storages is now Python 3 only, handling both bytes & string paths is now unnecessary. In Python 3 with Django, paths are always a string.
Hi @jschneier What do you think about moving ahead with the plan outlined in March. It would be really great to get rid of the emitted deprecation warnings. Please let me know if I can help out in anyway. Either with this PR or with the release. Here are the latest statistics from pypinfo. It shows a drop in the use of Python 2 as a percentage of downloads, now just 12.00%.
|
FWIW, users of Python2 can just use an older version of the library. They're already forced to used old versions of pretty much everything else, including Django. I don't feel like they'd really be affected by this library dropping support for them. |
Let's do it. |
* Drop support for Python 2 Python 2 support is nearing end of life. At the end of this year, it will no longer be supported, including for security issues. Django has already dropped support for Python 2 in Django 2.0. Follow upstream to be more compatible with the master branch as tests now pass. For more details, see https://pythonclock.org/ All code changes and clean ups that were noticed were done. Changes include: - Remove str/unicode compatibility shims. - Remove encoding cookies from source files. Python 3 interprets all files as utf-8 by default. - Remove unnecessary __future__ imports. The features are now built-in. - Use modern and simpler super() syntax. - Update the wheel configuration to reflect it is no longer universal. - Update trove classifiers. - And more … Also remove supported for end of life Python 3.4. It went end of life 2019-03-18. Fixes jschneier#849 * Update uses of force_text → force_str to avoid deprecation warnings Django deprecated force_text() and smart_text() in favor of force_str() and smart_str() in: django/django@d55e882 Fixes jschneier#806 * Remove unnecessary uses of (force|smart)_str As django-storages is now Python 3 only, handling both bytes & string paths is now unnecessary. In Python 3 with Django, paths are always a string. * Replace deprecated IOError with more specific FileNotFoundError Since Python 3.3, IOError has been merged into OSError. FileNotFoundError is a subclass, so its use is fully backwards compatible. * Remove unnecessary 'utf-8' from .encode()/.decode() In Python3, these methods default to UTF-8.
Python 2 support is nearing end of life. At the end of this year, it will no longer be supported, including for security issues.
Django has already dropped support for Python 2 in Django 2.0. Follow upstream to be more compatible with the master branch as tests now pass.
For more details, see https://pythonclock.org/
All code changes and clean ups that were noticed were done. Changes include:
__future__
imports. The features are now built-in.super()
syntax.Also remove supported for end of life Python 3.4. It went end of life 2019-03-18.