Skip to content

Commit 397e8e3

Browse files
authored
Merge branch 'master' into xautoclaim_start_id_type
2 parents eccf390 + 4b0543d commit 397e8e3

File tree

2 files changed

+16
-119
lines changed

2 files changed

+16
-119
lines changed

.github/workflows/integration.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ on:
1313
branches:
1414
- master
1515
- '[0-9].[0-9]'
16+
schedule:
17+
- cron: '0 1 * * *' # nightly build
1618

1719
jobs:
1820

@@ -22,7 +24,7 @@ jobs:
2224
steps:
2325
- uses: actions/checkout@v2
2426
- name: install python
25-
uses: actions/setup-python@v3
27+
uses: actions/setup-python@v4
2628
with:
2729
python-version: 3.9
2830
cache: 'pip'
@@ -37,7 +39,7 @@ jobs:
3739
strategy:
3840
max-parallel: 15
3941
matrix:
40-
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', 'pypy-3.7']
42+
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', 'pypy-3.7', 'pypy-3.8']
4143
test-type: ['standalone', 'cluster']
4244
connection-type: ['hiredis', 'plain']
4345
env:
@@ -46,7 +48,7 @@ jobs:
4648
steps:
4749
- uses: actions/checkout@v2
4850
- name: install python
49-
uses: actions/setup-python@v3
51+
uses: actions/setup-python@v4
5052
with:
5153
python-version: ${{ matrix.python-version }}
5254
cache: 'pip'

README.md

Lines changed: 11 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -9,51 +9,31 @@ The Python interface to the Redis key-value store.
99
[![codecov](https://codecov.io/gh/redis/redis-py/branch/master/graph/badge.svg?token=yenl5fzxxr)](https://codecov.io/gh/redis/redis-py)
1010
[![Total alerts](https://img.shields.io/lgtm/alerts/g/redis/redis-py.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/redis/redis-py/alerts/)
1111

12-
[Installation](#installation) | [Contributing](#contributing) | [Getting Started](#getting-started) | [Connecting To Redis](#connecting-to-redis)
12+
[Installation](#installation) | [Contributing](#contributing) | [Getting Started](#getting-started) | [Connecting To Redis](#connecting-to-redis) | [Contributing](https://github.com/redis/redis-py/blob/master/CONTRIBUTING.md)
1313

1414
---------------------------------------------
1515

1616
## Python Notice
1717

18-
redis-py 4.2.x will be the last generation of redis-py to support python 3.6 as it has been [End of Life'd](https://www.python.org/dev/peps/pep-0494/#schedule-last-security-only-release). Async support was introduced in redis-py 4.2.x thanks to [aioredis](https://github.com/aio-libs/aioredis-py), which necessitates this change. We will continue to maintain 3.6 support as long as possible - but the plan is for redis-py version 5+ to officially remove 3.6.
18+
redis-py 4.3.x will be the last generation of redis-py to support python 3.6 as it has been [End of Life'd](https://www.python.org/dev/peps/pep-0494/#schedule-last-security-only-release). Async support was introduced in redis-py 4.2.x thanks to [aioredis](https://github.com/aio-libs/aioredis-py), which necessitates this change. We will continue to maintain 3.6 support as long as possible - but the plan is for redis-py version 4.4+ to officially remove 3.6.
1919

2020
---------------------------
2121

2222
## Installation
2323

24-
redis-py requires a running Redis server. See [Redis's
25-
quickstart](https://redis.io/topics/quickstart) for installation
26-
instructions.
27-
28-
redis-py can be installed using pip similar to other
29-
Python packages. Do not use sudo with pip.
30-
It is usually good to work in a
31-
[virtualenv](https://virtualenv.pypa.io/en/latest/) or
32-
[venv](https://docs.python.org/3/library/venv.html) to avoid conflicts
33-
with other package managers and Python projects. For a quick
34-
introduction see [Python Virtual Environments in Five
35-
Minutes](https://bit.ly/py-env).
36-
3724
To install redis-py, simply:
3825

3926
``` bash
4027
$ pip install redis
4128
```
4229

43-
or from source:
30+
Looking for a high-level library to handle object mapping? See [redis-om-python](https://github.com/redis/redis-om-python)!
4431

45-
``` bash
46-
$ python setup.py install
32+
redis-py requires a running Redis server. Assuming you have docker
33+
```bash
34+
docker run -p 6379:6379 -it redis/redis-stack-server:latest
4735
```
4836

49-
View the current documentation [here](https://readthedocs.org/projects/redis/).
50-
51-
## Contributing
52-
53-
Want to contribute a feature, bug fix, or report an issue? Check out
54-
our [guide to
55-
contributing](https://github.com/redis/redis-py/blob/master/CONTRIBUTING.md).
56-
5737
## Getting Started
5838

5939
redis-py supports Python 3.7+.
@@ -81,91 +61,6 @@ encoding argument for the redis.Redis class.
8161
The encoding will be used to automatically encode any
8262
strings passed to commands, such as key names and values.
8363

84-
85-
--------------------
86-
87-
### MSET, MSETNX and ZADD
88-
89-
These commands all accept a mapping of key/value pairs. In redis-py 2.X
90-
this mapping could be specified as **args* or as `**kwargs`. Both of
91-
these styles caused issues when Redis introduced optional flags to ZADD.
92-
Relying on `*args` caused issues with the optional argument order,
93-
especially in Python 2.7. Relying on `**kwargs` caused potential
94-
collision issues of user keys with the argument names in the method
95-
signature.
96-
97-
To resolve this, redis-py 3.0 has changed these three commands to all
98-
accept a single positional argument named mapping that is expected to be
99-
a dict. For MSET and MSETNX, the dict is a mapping of key-names -\>
100-
values. For ZADD, the dict is a mapping of element-names -\> score.
101-
102-
MSET, MSETNX and ZADD now look like:
103-
104-
``` pycon
105-
def mset(self, mapping):
106-
def msetnx(self, mapping):
107-
def zadd(self, name, mapping, nx=False, xx=False, ch=False, incr=False):
108-
```
109-
110-
All 2.X users that use these commands must modify their code to supply
111-
keys and values as a dict to these commands.
112-
113-
### ZINCRBY
114-
115-
redis-py 2.X accidentally modified the argument order of ZINCRBY,
116-
swapping the order of value and amount. ZINCRBY now looks like:
117-
118-
``` python
119-
def zincrby(self, name, amount, value):
120-
```
121-
122-
All 2.X users that rely on ZINCRBY must swap the order of amount and
123-
value for the command to continue to work as intended.
124-
125-
### Encoding of User Input
126-
127-
redis-py 3.0 only accepts user data as bytes, strings or numbers (ints,
128-
longs and floats). Attempting to specify a key or a value as any other
129-
type will raise a DataError exception.
130-
131-
redis-py 2.X attempted to coerce any type of input into a string. While
132-
occasionally convenient, this caused all sorts of hidden errors when
133-
users passed boolean values (which were coerced to \'True\' or
134-
\'False\'), a None value (which was coerced to \'None\') or other
135-
values, such as user defined types.
136-
137-
All 2.X users should make sure that the keys and values they pass into
138-
redis-py are either bytes, strings or numbers.
139-
140-
### Locks
141-
142-
redis-py 3.0 drops support for the pipeline-based Lock and now only
143-
supports the Lua-based lock. In doing so, LuaLock has been renamed to
144-
Lock. This also means that redis-py Lock objects require Redis server
145-
2.6 or greater.
146-
147-
2.X users that were explicitly referring to *LuaLock* will have to now
148-
refer to *Lock* instead.
149-
150-
### Locks as Context Managers
151-
152-
redis-py 3.0 now raises a LockError when using a lock as a context
153-
manager and the lock cannot be acquired within the specified timeout.
154-
This is more of a bug fix than a backwards incompatible change. However,
155-
given an error is now raised where none was before, this might alarm
156-
some users.
157-
158-
2.X users should make sure they're wrapping their lock code in a
159-
try/catch like this:
160-
161-
``` python
162-
try:
163-
with r.lock('my-lock-key', blocking_timeout=5) as lock:
164-
# code you want executed only after the lock has been acquired
165-
except LockError:
166-
# the lock wasn't acquired
167-
```
168-
16964
## API Reference
17065

17166
The [official Redis command documentation](https://redis.io/commands)
@@ -1250,7 +1145,7 @@ Using scripting within pipelines in cluster mode is **not supported**.
12501145
**RedisCluster specific options**
12511146

12521147
require_full_coverage: (default=False)
1253-
1148+
12541149
When set to False (default value): the client will not require a
12551150
full coverage of the slots. However, if not all slots are covered,
12561151
and at least one node has 'cluster-require-full-coverage' set to
@@ -1260,14 +1155,14 @@ Using scripting within pipelines in cluster mode is **not supported**.
12601155
When set to True: all slots must be covered to construct the
12611156
cluster client. If not all slots are covered, RedisClusterException
12621157
will be thrown.
1263-
1158+
12641159
read_from_replicas: (default=False)
12651160

12661161
Enable read from replicas in READONLY mode. You can read possibly
12671162
stale data.
12681163
When set to true, read commands will be assigned between the
12691164
primary and its replications in a Round-Robin manner.
1270-
1165+
12711166
dynamic_startup_nodes: (default=True)
12721167

12731168
Set the RedisCluster's startup nodes to all of the discovered nodes.
@@ -1277,12 +1172,12 @@ Using scripting within pipelines in cluster mode is **not supported**.
12771172
listed in the CLUSTER SLOTS output.
12781173
If you use dynamic DNS endpoints for startup nodes but CLUSTER SLOTS lists
12791174
specific IP addresses, it is best to set it to false.
1280-
1175+
12811176
cluster_error_retry_attempts: (default=3)
12821177

12831178
Retry command execution attempts when encountering ClusterDownError
12841179
or ConnectionError
1285-
1180+
12861181
reinitialize_steps: (default=10)
12871182

12881183
Specifies the number of MOVED errors that need to occur before

0 commit comments

Comments
 (0)