Skip to content

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

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

Merged
merged 3 commits into from
Aug 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
**/__pycache__
**/*.pyc
.tox
.coverage
.coverage.*
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
* (in development)
* Removed support for end of life Python 2.7.
* Provide a development and testing environment via docker. Thanks
@abrookins. #1365
* Added support for the LPOS command available in Redis 6.0.6. Thanks
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ provide an upgrade path for users migrating from 2.X to 3.0.
Python Version Support
^^^^^^^^^^^^^^^^^^^^^^

redis-py 3.0 supports Python 2.7 and Python 3.5+.
redis-py supports Python 3.5+.


Client Classes: Redis and StrictRedis
Expand Down
5 changes: 2 additions & 3 deletions benchmarks/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
import redis
import sys
import timeit
from redis._compat import izip


class Benchmark(object):
class Benchmark:
ARGUMENTS = ()

def __init__(self):
Expand Down Expand Up @@ -34,7 +33,7 @@ def run_benchmark(self):
group_names = [group['name'] for group in self.ARGUMENTS]
group_values = [group['values'] for group in self.ARGUMENTS]
for value_set in itertools.product(*group_values):
pairs = list(izip(group_names, value_set))
pairs = list(zip(group_names, value_set))
arg_string = ', '.join(['%s=%s' % (p[0], p[1]) for p in pairs])
sys.stdout.write('Benchmark: %s... ' % arg_string)
sys.stdout.flush()
Expand Down
12 changes: 3 additions & 9 deletions benchmarks/basic_operations.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
from __future__ import print_function
import redis
import time
import sys
from functools import wraps
from argparse import ArgumentParser

if sys.version_info[0] == 3:
long = int


def parse_args():
parser = ArgumentParser()
Expand Down Expand Up @@ -47,17 +42,17 @@ def run():
def timer(func):
@wraps(func)
def wrapper(*args, **kwargs):
start = time.clock()
start = time.monotonic()
ret = func(*args, **kwargs)
duration = time.clock() - start
duration = time.monotonic() - start
if 'num' in kwargs:
count = kwargs['num']
else:
count = args[1]
print('{} - {} Requests'.format(func.__name__, count))
print('Duration = {}'.format(duration))
print('Rate = {}'.format(count/duration))
print('')
print()
return ret
return wrapper

Expand Down Expand Up @@ -185,7 +180,6 @@ def hmset(conn, num, pipeline_size, data_size):

set_data = {'str_value': 'string',
'int_value': 123456,
'long_value': long(123456),
'float_value': 123456.0}
for i in range(num):
conn.hmset('hmset_key', set_data)
Expand Down
5 changes: 2 additions & 3 deletions benchmarks/command_packer_benchmark.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import socket
from redis.connection import (Connection, SYM_STAR, SYM_DOLLAR, SYM_EMPTY,
SYM_CRLF)
from redis._compat import imap
from base import Benchmark


Expand Down Expand Up @@ -29,7 +28,7 @@ def pack_command(self, *args):
args_output = SYM_EMPTY.join([
SYM_EMPTY.join(
(SYM_DOLLAR, str(len(k)).encode(), SYM_CRLF, k, SYM_CRLF))
for k in imap(self.encoder.encode, args)])
for k in map(self.encoder.encode, args)])
output = SYM_EMPTY.join(
(SYM_STAR, str(len(args)).encode(), SYM_CRLF, args_output))
return output
Expand Down Expand Up @@ -61,7 +60,7 @@ def pack_command(self, *args):
buff = SYM_EMPTY.join(
(SYM_STAR, str(len(args)).encode(), SYM_CRLF))

for k in imap(self.encoder.encode, args):
for k in map(self.encoder.encode, args):
if len(buff) > 6000 or len(k) > 6000:
buff = SYM_EMPTY.join(
(buff, SYM_DOLLAR, str(len(k)).encode(), SYM_CRLF))
Expand Down
26 changes: 12 additions & 14 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-
#
# redis-py documentation build configuration file, created by
# sphinx-quickstart on Fri Feb 8 00:47:08 2013.
#
Expand Down Expand Up @@ -43,8 +41,8 @@
master_doc = 'index'

# General information about the project.
project = u'redis-py'
copyright = u'2016, Andy McCurdy'
project = 'redis-py'
copyright = '2016, Andy McCurdy'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -188,8 +186,8 @@
# (source start file, target name, title, author, documentclass
# [howto/manual]).
latex_documents = [
('index', 'redis-py.tex', u'redis-py Documentation',
u'Andy McCurdy', 'manual'),
('index', 'redis-py.tex', 'redis-py Documentation',
'Andy McCurdy', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -218,8 +216,8 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'redis-py', u'redis-py Documentation',
[u'Andy McCurdy'], 1)
('index', 'redis-py', 'redis-py Documentation',
['Andy McCurdy'], 1)
]

# If true, show URL addresses after external links.
Expand All @@ -232,8 +230,8 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'redis-py', u'redis-py Documentation',
u'Andy McCurdy', 'redis-py',
('index', 'redis-py', 'redis-py Documentation',
'Andy McCurdy', 'redis-py',
'One line description of project.', 'Miscellaneous'),
]

Expand All @@ -246,7 +244,7 @@
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'

epub_title = u'redis-py'
epub_author = u'Andy McCurdy'
epub_publisher = u'Andy McCurdy'
epub_copyright = u'2011, Andy McCurdy'
epub_title = 'redis-py'
epub_author = 'Andy McCurdy'
epub_publisher = 'Andy McCurdy'
epub_copyright = '2011, Andy McCurdy'
188 changes: 0 additions & 188 deletions redis/_compat.py

This file was deleted.

Loading