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

Remove support for end-of-life Python 2.7 #1318

Merged
merged 3 commits into from
Aug 6, 2020
Merged

Remove support for end-of-life Python 2.7 #1318

merged 3 commits into from
Aug 6, 2020

Conversation

jdufresne
Copy link
Contributor

Pull Request check-list

Please make sure to review and check all of these items:

  • Does $ tox pass with this change (including linting)?
  • Does travis tests pass with this change (enable it first in your forked repo and wait for the travis build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.

Description of change

Python 2.7 is end of life. It is no longer receiving bug fixes, including for security issues. Python 2.7 went EOL on 2020-01-01. For additional details on support Python versions, see:

Supported: https://devguide.python.org/#status-of-python-branches
EOL: https://devguide.python.org/devcycle/#end-of-life-branches

Removing support for EOL Pythons will reduce testing and maintenance resources while allowing the library to move towards a modern Python 3 style. Python 2.7 users can continue to use the previous version of redis-py.

Was able to simplify the code:

  • Removed redis._compat module
  • Removed future imports
  • Removed object from class definition (all classes are new style)
  • Removed long (Python 3 unified numeric types)
  • Removed deprecated nonzero method
  • Use simpler Python 3 super() syntax
  • Use unified OSError exception
  • Use yield from syntax

@andymccurdy
Copy link
Contributor

Few PRs would make me happier to merge. I'm jealous that Django and other major Python packages have already made this change. Sadly, https://pypistats.org/packages/redis shows that Python 2 clients are downloading the redis-py package anywhere between 20% and 50% depending on the day. And I know some of the Redis Labs folks are still using Python 2 internally.

I think the best course of action is to pick a date in the future and announce that Python 2 will no longer be supported after that date. Perhaps July 1 2020? That gives everyone about 3 months to port or accept that they won't be getting any new features.

@itamarhaber @RoeyPrat thoughts?

@jdufresne
Copy link
Contributor Author

Thanks @andymccurdy

That plans makes sense to me.

@codecov-io
Copy link

codecov-io commented Apr 11, 2020

Codecov Report

Merging #1318 into master will increase coverage by 0.18%.
The diff coverage is 85.13%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1318      +/-   ##
==========================================
+ Coverage   92.87%   93.06%   +0.18%     
==========================================
  Files          20       19       -1     
  Lines        6543     6375     -168     
==========================================
- Hits         6077     5933     -144     
+ Misses        466      442      -24     
Impacted Files Coverage Δ
redis/connection.py 82.99% <63.04%> (+0.66%) ⬆️
redis/client.py 86.10% <81.17%> (-0.17%) ⬇️
redis/lock.py 100.00% <100.00%> (ø)
redis/sentinel.py 83.68% <100.00%> (ø)
redis/utils.py 72.22% <100.00%> (+3.47%) ⬆️
tests/conftest.py 96.87% <100.00%> (ø)
tests/test_commands.py 99.94% <100.00%> (-0.01%) ⬇️
tests/test_connection.py 100.00% <100.00%> (ø)
tests/test_connection_pool.py 97.84% <100.00%> (ø)
tests/test_encoding.py 98.75% <100.00%> (+1.13%) ⬆️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 05548a3...0d6a93f. Read the comment docs.

@andymccurdy
Copy link
Contributor

Announced today that Python 3.5.x will be the last release that supports Python 2. We'll support bug fixes and security patches in the 3.5.x line through the end of July 2020. redis-py 4.x (the next version) will be Python 3 only.

I'll merge this into master soon and we'll back port any bug fixes/security patches to the 3.5.0 branch.

Python 2.7 is end of life. It is no longer receiving bug fixes,
including for security issues. Python 2.7 went EOL on 2020-01-01. For
additional details on support Python versions, see:

Supported: https://devguide.python.org/#status-of-python-branches
EOL: https://devguide.python.org/devcycle/#end-of-life-branches

Removing support for EOL Pythons will reduce testing and maintenance
resources while allowing the library to move towards a modern Python 3
style. Python 2.7 users can continue to use the previous version of
redis-py.

Was able to simplify the code:

- Removed redis._compat module
- Removed __future__ imports
- Removed object from class definition (all classes are new style)
- Removed long (Python 3 unified numeric types)
- Removed deprecated __nonzero__ method
- Use simpler Python 3 super() syntax
- Use unified OSError exception
- Use yield from syntax
@codecov-commenter
Copy link

codecov-commenter commented Aug 6, 2020

Codecov Report

Merging #1318 into master will increase coverage by 0.02%.
The diff coverage is 77.55%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1318      +/-   ##
==========================================
+ Coverage   85.48%   85.50%   +0.02%     
==========================================
  Files           7        6       -1     
  Lines        3017     2863     -154     
==========================================
- Hits         2579     2448     -131     
+ Misses        438      415      -23     
Impacted Files Coverage Δ
redis/connection.py 82.03% <63.04%> (+0.62%) ⬆️
redis/client.py 85.83% <81.17%> (-0.17%) ⬇️
redis/lock.py 100.00% <100.00%> (ø)
redis/sentinel.py 86.80% <100.00%> (ø)
redis/utils.py 72.22% <100.00%> (+3.47%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c6f13c3...dc664f0. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants