Skip to content

Drop Python 2.6 support - #916

Merged
andymccurdy merged 14 commits into
redis:masterfrom
jdufresne:drop-py26
Nov 6, 2018
Merged

andymccurdy merged 14 commits into
redis:masterfrom
jdufresne:drop-py26

Conversation

@jdufresne

@jdufresne jdufresne commented Oct 21, 2017 •

Copy link
Copy Markdown
Contributor

Remove 2.6 workarounds. Update testing configurations. Use modern Python syntax where available:

  • Use set literals
  • Use dict comprehensions
  • Use more generators
  • Use io package for BytesIO
  • Remove from __future__ import with_statement
  • Use unicode literals throughout

Thanks Dustin Ingram for the original patch.


This is a continuation of the work started by @di in #796. I have rebased the patch and addressed a couple other cleanups I saw. I'll happily close this PR if the other work continues.

@hugovk

hugovk commented Oct 27, 2017

Copy link
Copy Markdown

Here's the pip installs for redis from PyPI for the last month, showing low numbers for 2.6:

$ pypinfo --percent --pip redis pyversion
python_version percent download_count
-------------- ------- --------------
2.7              63.2%        849,343
3.5              18.2%        244,235
3.6              12.1%        162,059
3.4               5.6%         75,033
2.6               0.8%         11,297
3.3               0.1%            821
3.7               0.1%            681
3.2               0.0%            203
None              0.0%             56
3.1               0.0%              1

3.3 also went EOL last month and has even lower numbers.

@jdufresne

Copy link
Copy Markdown
Contributor Author

I'm happy to also drop support for Python 3.3 if it is agreeable with the project maintainers. @andymccurdy what do you think?

@Grokzen

Grokzen commented Nov 1, 2017

Copy link
Copy Markdown

@jdufresne you should really split all changes in this MR into separate commits where you in each commit fix each of the lines in your list in the first comment. That would make it much easier to review compared to now where it is just one big commit with 19 files changed.

@jdufresne

Copy link
Copy Markdown
Contributor Author

@Grokzen I've split the commit to several smaller commits. Each commit tries to handle a single focused aspect of the change. Please review.

@zeebonk

zeebonk commented Dec 28, 2017

Copy link
Copy Markdown

There are a couple of functions on the client that accept timedeltas that get converted to seconds/milliseconds by manual calculation, e.g. in client.py:1212

time = time.seconds + time.days * 24 * 3600

With the introduction of timedelta.total_seconds() in py2.7 this can be changed to:

time = int(time.total_seconds())

etc.

@jdufresne

Copy link
Copy Markdown
Contributor Author

@zeebonk, good call. Thanks for reviewing. I've added two new commits. One to use timedelta.total_seconds() and one to remove Python 3.3 support.

I've also rebased all commits to the latest master.

@hugovk

hugovk commented Jun 4, 2018

Copy link
Copy Markdown

Here's pip installs for redis from PyPI for May 2018, Python 2.6 downloads are down 61% since October:

python_version percent download_count
2.7 59.33% 433,625
3.6 23.73% 173,461
3.5 10.09% 73,732
3.4 6.09% 44,484
2.6 0.61% 4,442
3.7 0.08% 574
3.3 0.05% 362
3.2 0.02% 138
None 0.00% 16
3.8 0.00% 1
Total 730,835

Source: pypinfo --start-date 2018-05-01 --end-date 2018-05-31 --percent --markdown redis pyversion

@jdufresne

Copy link
Copy Markdown
Contributor Author

Rebased to resolve merge conflicts.

@andymccurdy

Copy link
Copy Markdown
Contributor

I'm going to look at this tomorrow or over the weekend. I would very much like to drop support for 2.6 and 3.3. Thanks for the work on this.

All supported Python versions support the with statement.
All Python versions can handled ordered placeholders.
Available on all supported Python versions.
Remove workaround for handling unicode with older Pythons.
Python 3.3 is EOL. It is no longer receiving bug fixes, including for
security issues. It has been EOL since 2017-09-29. For additional
details of the status of Python versions, see:

https://devguide.python.org/#status-of-python-branches
Helps pip decide what version of the library to install.

https://packaging.python.org/tutorials/distributing-packages/#python-requires

> If your project only runs on certain Python versions, setting the
> python_requires argument to the appropriate PEP 440 version specifier
> string will prevent pip from installing the project on other Python
> versions.

https://setuptools.readthedocs.io/en/latest/setuptools.html#new-and-changed-setup-keywords

> python_requires
>
> A string corresponding to a version specifier (as defined in PEP 440)
> for the Python version, used to specify the Requires-Python defined in
> PEP 345.
Now that redis-py has removed support for EOL Pythons, can once again
run tests using the latest version of pytest.
@andymccurdy
andymccurdy merged commit 2f20d27 into redis:master Nov 6, 2018
@andymccurdy

Copy link
Copy Markdown
Contributor

@jdufresne @di Thanks so much for the effort on this. Super helpful. Merged.

@jdufresne
jdufresne deleted the drop-py26 branch November 6, 2018 21:32
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.

5 participants