Skip to content

Commit 49f6159

Browse files
committed
Merge branch 'master' into add-cluster-scripting
2 parents f16e8dd + 1983905 commit 49f6159

Some content is hidden

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

57 files changed

+9547
-678
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+
- [ ] Is the changes 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/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: 5 additions & 2 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

@@ -34,7 +36,7 @@ jobs:
3436
strategy:
3537
max-parallel: 15
3638
matrix:
37-
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', 'pypy-3.7']
39+
python-version: ['3.6','3.7', '3.8', '3.9', '3.10', 'pypy-3.7']
3840
test-type: ['standalone', 'cluster']
3941
connection-type: ['hiredis', 'plain']
4042
env:
@@ -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
@@ -77,7 +80,7 @@ jobs:
7780
runs-on: ubuntu-latest
7881
strategy:
7982
matrix:
80-
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', 'pypy-3.7']
83+
python-version: ['3.7', '3.8', '3.9', '3.10', 'pypy-3.7']
8184
steps:
8285
- uses: actions/checkout@v2
8386
- name: install python ${{ matrix.python-version }}

.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: 7 additions & 2 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
@@ -1206,7 +1211,7 @@ Please note:
12061211
- The pipeline gets its 'read_from_replicas' value from the cluster's parameter.
12071212
Thus, if read from replications is enabled in the cluster instance, the pipeline
12081213
will also direct read commands to replicas.
1209-
- 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,
12101215
the 'transaction' option is available when executing pipelines. This wraps the
12111216
pipeline commands with MULTI/EXEC commands, and effectively turns the pipeline
12121217
commands into a single transaction block. This means that all commands are

dev_requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@ black==21.11b1
22
flake8==4.0.1
33
flynt~=0.69.0
44
isort==5.10.1
5+
mock==4.0.3
56
pytest==6.2.5
67
pytest-timeout==2.0.1
8+
pytest-asyncio>=0.16.0
79
tox==3.24.4
810
tox-docker==3.1.0
911
invoke==1.6.0
1012
pytest-cov>=3.0.0
1113
vulture>=2.3.0
1214
ujson>=4.2.0
1315
wheel>=0.30.0
16+
uvloop

docs/connections.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,14 @@ Connection Pools
4242
.. autoclass:: redis.connection.ConnectionPool
4343
:members:
4444

45-
More connection examples can be found `here <examples/connection_examples.html>`_.
45+
More connection examples can be found `here <examples/connection_examples.html>`_.
46+
47+
Async Client
48+
************
49+
50+
This client is used for communicating with Redis, asynchronously.
51+
52+
.. autoclass:: redis.asyncio.connection.Connection
53+
:members:
54+
55+
More connection examples can be found `here <examples/asyncio_examples.html>`_

docs/examples.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ Examples
77

88
examples/connection_examples
99
examples/ssl_connection_examples
10+
examples/asyncio_examples
1011
examples/search_json_examples
1112
examples/set_and_get_examples

0 commit comments

Comments
 (0)