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

Drop support for Python 2.x and Django < 2.2 #2201

Closed
9 tasks done
nijel opened this issue Aug 28, 2018 · 3 comments · Fixed by #3505
Closed
9 tasks done

Drop support for Python 2.x and Django < 2.2 #2201

nijel opened this issue Aug 28, 2018 · 3 comments · Fixed by #3505
Assignees
Labels
enhancement Adding or requesting a new feature.
Milestone

Comments

@nijel
Copy link
Member

nijel commented Aug 28, 2018

This has to be done at some point. Eventually it might become problematic to keep the code compatible with Django 1.11 and current release or simply we want to get rid of all the compatibility code for Python 2.

  • Simplify constructors to use just super()
  • Remove no longer needed explicit inheritance from object
  • Remove no longer needed future imports
  • Increase required Django version and remove no longer needed compatibility code (eg. bulk_create_ignore)
  • Remove six usage
  • Remove usage of python_2_unicode_compatible decorators
  • Use yield from for nesting generators
  • Add check for Python 2 to Weblate to warn users early
  • Remove legacy code like avatar cache cleanup

The furthest date for dropping support Django 1.11 is upstream support and it is supported until at least April 2020.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@nijel nijel added the enhancement Adding or requesting a new feature. label Aug 28, 2018
nijel added a commit that referenced this issue Mar 6, 2019
We want to get rid of Python 2 support in future, so better to tell
people to use Python 3 now.

Issue #2605
Issue #2201

Signed-off-by: Michal Čihař <michal@cihar.com>
@nijel nijel added this to the 4.0 milestone Mar 16, 2019
nijel added a commit that referenced this issue Mar 16, 2019
We want to give users early warning on dropping Python 2 support, this
way hopefully nobody will be suprised when 4.0 is out next year.

Issue #2201

Signed-off-by: Michal Čihař <michal@cihar.com>
@nijel nijel changed the title Drop support for Python 2.x and Django 1.11 Drop support for Python 2.x and Django < 2.2 Apr 3, 2019
@nijel
Copy link
Member Author

nijel commented Apr 3, 2019

This has been scheduled to April 2020 in the 4.0 milestone. It will also not support older Django than 2.2, which will be current LTS release by then.

@nijel nijel pinned this issue Sep 1, 2019
nijel added a commit that referenced this issue Jan 13, 2020
We can get rid of those once we drop support for Django 1.11.

See #2201

Signed-off-by: Michal Čihař <michal@cihar.com>
@nijel
Copy link
Member Author

nijel commented Feb 3, 2020

We might actually go for whatever Django will include django/django#12332 so that we can remove our workaround for that. That will make us skip LTS 2.2, but I don't see a major issue with that.

nijel added a commit that referenced this issue Feb 20, 2020
Since Python 3.3 all builds are wide, so avoid dealing with that for
now.

See actions/setup-python#23
See #2201
@nijel nijel self-assigned this Feb 20, 2020
nijel added a commit that referenced this issue Feb 20, 2020
nijel added a commit that referenced this issue Feb 20, 2020
Those were needed for Python 2.7.

Issue #2201
nijel added a commit that referenced this issue Feb 20, 2020
Support for Python 2 is dropped.

Issue #2201
nijel added a commit that referenced this issue Feb 20, 2020
It is more effective than iterating and yielding every item.

Issue #2201
nijel added a commit that referenced this issue Feb 20, 2020
nijel added a commit that referenced this issue Feb 20, 2020
nijel added a commit that referenced this issue Feb 20, 2020
Avoid using six.

Issue #2201
nijel added a commit that referenced this issue Feb 20, 2020
We no longer need six for that.

Issue #2201
nijel added a commit that referenced this issue Feb 20, 2020
We no longer need six for that.

Issue #2201
nijel added a commit that referenced this issue Feb 20, 2020
Remove usage of six as Python 2 compat is gone.

Issue #2201
nijel added a commit that referenced this issue Feb 20, 2020
We can now use Python 3 names directly.

Issue #2201
nijel added a commit that referenced this issue Feb 20, 2020
nijel added a commit that referenced this issue Feb 20, 2020
It is no longer used.

Issue #2201
nijel added a commit that referenced this issue Feb 20, 2020
Own logic is no longer needed as we require Python 3.5.

Issue #2201
nijel added a commit that referenced this issue Feb 20, 2020
nijel added a commit that referenced this issue Feb 20, 2020
We can use native Django features for this.

Issue #2201
nijel added a commit that referenced this issue Feb 20, 2020
nijel added a commit that referenced this issue Feb 20, 2020
The 0.7.2 has native code for damerau_levenshtein_distance with unicode.

Issue #2201
nijel added a commit that referenced this issue Feb 20, 2020
nijel added a commit that referenced this issue Feb 20, 2020
Now all of them are unicode.

Issue #2201
nijel added a commit that referenced this issue Feb 20, 2020
It is not needed with Python 3.

Issue #2201
nijel added a commit that referenced this issue Feb 20, 2020
With Python 3 the default inheritance does not have to be specified.

Issue #2201
nijel added a commit that referenced this issue Feb 20, 2020
nijel added a commit that referenced this issue Feb 20, 2020
It was only needed for migrating to Python 3.

Issue #2201
@github-actions
Copy link

Thank you for your report, the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see similar problem, please open separate issue.
  • If you are happy with the outcome, consider supporting Weblate by donating.

@nijel nijel unpinned this issue Mar 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adding or requesting a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant