Skip to content

Commit eb3ac2a

Browse files
authored
Merge branch 'master' into auth-support
2 parents 92c4e8b + afc83e1 commit eb3ac2a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+9809
-712
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ _Please make sure to review and check all of these items:_
77
- [ ] Is the new or changed code fully tested?
88
- [ ] Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
99
- [ ] Is there an example added to the examples folder (if applicable)?
10+
- [ ] Was the change added to CHANGES file?
1011

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

.github/release-drafter-config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
name-template: 'Version $NEXT_PATCH_VERSION'
22
tag-template: 'v$NEXT_PATCH_VERSION'
33
autolabeler:
4-
- label: 'chore'
4+
- label: 'maintenance'
55
files:
66
- '*.md'
77
- '.github/*'
88
- label: 'bug'
99
branch:
1010
- '/bug-.+'
11-
- label: 'chore'
11+
- label: 'maintenance'
1212
branch:
13-
- '/chore-.+'
13+
- '/maintenance-.+'
1414
- label: 'feature'
1515
branch:
1616
- '/feature-.+'
@@ -28,7 +28,7 @@ categories:
2828
- 'bugfix'
2929
- 'bug'
3030
- title: '🧰 Maintenance'
31-
label: 'chore'
31+
label: 'maintenance'
3232
change-template: '- $TITLE (#$NUMBER)'
3333
exclude-labels:
3434
- 'skip-changelog'

.github/workflows/codeql-analysis.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ master ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ master ]
20+
21+
jobs:
22+
analyze:
23+
name: Analyze
24+
runs-on: ubuntu-latest
25+
permissions:
26+
actions: read
27+
contents: read
28+
security-events: write
29+
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
language: [ 'python' ]
34+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
35+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
36+
37+
steps:
38+
- name: Checkout repository
39+
uses: actions/checkout@v2
40+
41+
# Initializes the CodeQL tools for scanning.
42+
- name: Initialize CodeQL
43+
uses: github/codeql-action/init@v1
44+
with:
45+
languages: ${{ matrix.language }}
46+
# If you wish to specify custom queries, you can do so here or in a config file.
47+
# By default, queries listed here will override any specified in a config file.
48+
# Prefix the list here with "+" to use these queries and those in the config file.
49+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
50+
51+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
52+
# If this step fails, then you should remove it and run the build manually (see below)
53+
- name: Autobuild
54+
uses: github/codeql-action/autobuild@v1
55+
56+
# ℹ️ Command-line programs to run using the OS shell.
57+
# 📚 https://git.io/JvXDl
58+
59+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
60+
# and modify them (or add more) to build your code if your project
61+
# uses a compiled language
62+
63+
#- run: |
64+
# make bootstrap
65+
# make release
66+
67+
- name: Perform CodeQL Analysis
68+
uses: github/codeql-action/analyze@v1

.github/workflows/integration.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ on:
88
- '**/*.md'
99
branches:
1010
- master
11+
- '[0-9].[0-9]'
1112
pull_request:
1213
branches:
1314
- master
15+
- '[0-9].[0-9]'
1416

1517
jobs:
1618

@@ -48,6 +50,7 @@ jobs:
4850
python-version: ${{ matrix.python-version }}
4951
- name: run tests
5052
run: |
53+
pip install -U setuptools wheel
5154
pip install -r dev_requirements.txt
5255
tox -e ${{matrix.test-type}}-${{matrix.connection-type}}
5356
- name: Upload codecov coverage

.github/workflows/update-changes.yaml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ vagrant/.vagrant
1414
env
1515
venv
1616
coverage.xml
17-
.venv
17+
.venv*
1818
*.xml
1919
.coverage*
2020
docker/stunnel/keys

.mypy.ini

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[mypy]
2+
#, docs/examples, tests
3+
files = redis
4+
check_untyped_defs = True
5+
follow_imports_for_stubs asyncio.= True
6+
#disallow_any_decorated = True
7+
disallow_subclassing_any = True
8+
#disallow_untyped_calls = True
9+
disallow_untyped_decorators = True
10+
#disallow_untyped_defs = True
11+
implicit_reexport = False
12+
no_implicit_optional = True
13+
show_error_codes = True
14+
strict_equality = True
15+
warn_incomplete_stub = True
16+
warn_redundant_casts = True
17+
warn_unreachable = True
18+
warn_unused_ignores = True
19+
disallow_any_unimported = True
20+
#warn_return_any = True
21+
22+
[mypy-redis.asyncio.lock]
23+
# TODO: Remove once locks has been rewritten
24+
ignore_errors = True

CHANGES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
* Create codeql-analysis.yml (#1988). Thanks @chayim
12
* 4.1.3 (Feb 8, 2022)
23
* Fix flushdb and flushall (#1926)
34
* Add redis5 and redis4 dockers (#1871)

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ You can see the logging output of a containers like this:
112112
`$ docker logs -f <service>`
113113

114114
The command make test runs all tests in all tested Python
115-
environments. To run the tests in a single environment, like Python 3.6,
115+
environments. To run the tests in a single environment, like Python 3.9,
116116
use a command like this:
117117

118-
`$ docker-compose run test tox -e py36 -- --redis-url=redis://master:6379/9`
118+
`$ docker-compose run test tox -e py39 -- --redis-url=redis://master:6379/9`
119119

120-
Here, the flag `-e py36` runs tests against the Python 3.6 tox
120+
Here, the flag `-e py39` runs tests against the Python 3.9 tox
121121
environment. And note from the example that whenever you run tests like
122122
this, instead of using make test, you need to pass
123123
`-- --redis-url=redis://master:6379/9`. This points the tests at the

README.md

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ The Python interface to the Redis key-value store.
1313

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

16+
## Python Notice
17+
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 offically remove 3.6.
19+
20+
---------------------------
1621

1722
## Installation
1823

@@ -51,7 +56,7 @@ contributing](https://github.com/redis/redis-py/blob/master/CONTRIBUTING.md).
5156

5257
## Getting Started
5358

54-
redis-py supports Python 3.6+.
59+
redis-py supports Python 3.7+.
5560

5661
``` pycon
5762
>>> import redis
@@ -857,7 +862,8 @@ Monitor object to block until a command is received.
857862
redis-py supports the EVAL, EVALSHA, and SCRIPT commands. However, there
858863
are a number of edge cases that make these commands tedious to use in
859864
real world scenarios. Therefore, redis-py exposes a Script object that
860-
makes scripting much easier to use.
865+
makes scripting much easier to use. (RedisClusters have limited support for
866+
scripting.)
861867

862868
To create a Script instance, use the register_script
863869
function on a client instance passing the Lua code as the first
@@ -950,14 +956,16 @@ C 3
950956

951957
### Cluster Mode
952958

953-
redis-py is now supports cluster mode and provides a client for
959+
redis-py now supports cluster mode and provides a client for
954960
[Redis Cluster](<https://redis.io/topics/cluster-tutorial>).
955961

956962
The cluster client is based on Grokzen's
957963
[redis-py-cluster](https://github.com/Grokzen/redis-py-cluster), has added bug
958964
fixes, and now supersedes that library. Support for these changes is thanks to
959965
his contributions.
960966

967+
To learn more about Redis Cluster, see
968+
[Redis Cluster specifications](https://redis.io/topics/cluster-spec).
961969

962970
**Create RedisCluster:**
963971

@@ -1203,7 +1211,7 @@ Please note:
12031211
- The pipeline gets its 'read_from_replicas' value from the cluster's parameter.
12041212
Thus, if read from replications is enabled in the cluster instance, the pipeline
12051213
will also direct read commands to replicas.
1206-
- The 'transcation' option is NOT supported in cluster-mode. In non-cluster mode,
1214+
- The 'transaction' option is NOT supported in cluster-mode. In non-cluster mode,
12071215
the 'transaction' option is available when executing pipelines. This wraps the
12081216
pipeline commands with MULTI/EXEC commands, and effectively turns the pipeline
12091217
commands into a single transaction block. This means that all commands are
@@ -1213,10 +1221,29 @@ according to their respective destination nodes. This means that we can not
12131221
turn the pipeline commands into one transaction block, because in most cases
12141222
they are split up into several smaller pipelines.
12151223

1216-
1217-
See [Redis Cluster tutorial](https://redis.io/topics/cluster-tutorial) and
1218-
[Redis Cluster specifications](https://redis.io/topics/cluster-spec)
1219-
to learn more about Redis Cluster.
1224+
**Lua Scripting in Cluster Mode**
1225+
1226+
Cluster mode has limited support for lua scripting.
1227+
1228+
The following commands are supported, with caveats:
1229+
- `EVAL` and `EVALSHA`: The command is sent to the relevant node, depending on
1230+
the keys (i.e., in `EVAL "<script>" num_keys key_1 ... key_n ...`). The keys
1231+
_must_ all be on the same node. If the script requires 0 keys, _the command is
1232+
sent to a random (primary) node_.
1233+
- `SCRIPT EXISTS`: The command is sent to all primaries. The result is a list
1234+
of booleans corresponding to the input SHA hashes. Each boolean is an AND of
1235+
"does the script exist on each node?". In other words, each boolean is True iff
1236+
the script exists on all nodes.
1237+
- `SCRIPT FLUSH`: The command is sent to all primaries. The result is a bool
1238+
AND over all nodes' responses.
1239+
- `SCRIPT LOAD`: The command is sent to all primaries. The result is the SHA1
1240+
digest.
1241+
1242+
The following commands are not supported:
1243+
- `EVAL_RO`
1244+
- `EVALSHA_RO`
1245+
1246+
Using scripting within pipelines in cluster mode is **not supported**.
12201247

12211248
### Author
12221249

0 commit comments

Comments
 (0)