Skip to content

Backport Redis 7.4 features to the 5.0 branch #3312

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 37 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
5b2a1c2
Prevent async ClusterPipeline instances from becoming "false-y" in ca…
jakob-keller Dec 11, 2023
bc0461c
Update repr of important classes with module name and recommended "< …
kristjanvalur Dec 11, 2023
ee0818e
Fix incorrect asserts in test and ensure connections are closed (#3004)
kristjanvalur Feb 22, 2024
944c3a0
Optimizing cluster initialization changing the checks for cluster-ena…
willianmrs Mar 12, 2024
700f605
Update asyncio_examples.ipynb (#3125)
matrey Mar 14, 2024
29a5db8
Adding twine check prior to package upload (#3198)
chayim May 5, 2024
2239f4b
Support the MAXAGE option for CLIENT KILL (#3187)
gerzse May 9, 2024
cc6e9df
Support NOVALUES parameter for HSCAN (#3157)
gerzse May 9, 2024
4ff01b6
Fix CNs in test certificates (#3226)
gerzse May 14, 2024
9ac3c06
Document XREAD of last message (+) (#3188)
gerzse May 15, 2024
a56503d
Streamline documentation style (#3232)
gerzse May 15, 2024
48df4f6
Update ResponseT type alias (#3227)
willfrey May 20, 2024
ded15f2
Use new Redis logo and website (#3233)
gerzse May 20, 2024
4498cab
Fix typing for address_remap (fixes #3234) (#3235)
daveisfera May 21, 2024
3948063
More robust parsing of memory stats response (#3247)
gerzse May 28, 2024
11f7615
Add missing type hints for backoff.py (#3249)
max-muoto May 28, 2024
153c310
Use standard Redis docker image in CI (#3246)
gerzse Jun 6, 2024
45ed240
Hash field expiration commands (#3218)
gerzse Jun 6, 2024
321d1d8
Timeseries insertion filters for close samples (#3228)
gerzse Jun 12, 2024
868cd6a
Add extra tests for GEO search (#3244)
gerzse Jun 12, 2024
912169e
Support missing and empty values in search (#3231)
gerzse Jun 13, 2024
0785f81
Test special characters escaping in search (#3276)
gerzse Jun 13, 2024
2aacc47
Bump rojopolis/spellcheck-github-actions from 0.36.0 to 0.37.0 (#3260)
dependabot[bot] Jun 13, 2024
02514f7
Add missing asserts in json tests (#3261)
enjoy-binbin Jun 14, 2024
f8db245
Bump actions/stale from 3 to 9 (#3170)
dependabot[bot] Jun 14, 2024
a54fdc5
Improve parsing of XINFO STREAM response (#3282)
Wh1isper Jun 18, 2024
5fadeac
Make sure the CI actually runs RESP3 tests (#3270)
gerzse Jun 19, 2024
5135aab
Add CODECOV token to CI (#3285)
gerzse Jun 19, 2024
15c44a2
Do not restrict pytest dependencies versions (#3286)
gerzse Jun 19, 2024
927fd18
Re-enable Graph tests (#3287)
gerzse Jun 20, 2024
85b290d
Bump rojopolis/spellcheck-github-actions from 0.37.0 to 0.38.0 (#3301)
dependabot[bot] Jul 3, 2024
c7cf587
Add missing type hints for `retry.py` (#3250)
max-muoto Jul 3, 2024
e89cfcc
Add details to the asyncio connection error message (#3211)
dkuser Jul 3, 2024
abab77b
Prepare for Redis 7.4 RC2 (#3303)
gerzse Jul 4, 2024
8bb06c1
Format connection errors in the same way everywhere (#3305)
gerzse Jul 4, 2024
ae91fbe
Fix bug: client side caching causes unexpected disconnections (async …
dvora-h Feb 29, 2024
62fc873
Decode search results at field level (#3309)
uglide Jul 10, 2024
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 .github/wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ bysource
charset
del
dev
docstring
docstrings
eg
exc
firsttimersonly
Expand Down
208 changes: 119 additions & 89 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,100 +23,106 @@ concurrency:
permissions:
contents: read # to fetch code (actions/checkout)

env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
REDIS_IMAGE: redis:7.4-rc2
REDIS_STACK_IMAGE: redis/redis-stack-server:7.4.0-rc2

jobs:
dependency-audit:
name: Dependency audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pypa/[email protected]
with:
inputs: requirements.txt dev_requirements.txt
ignore-vulns: |
GHSA-w596-4wvx-j9j6 # subversion related git pull, dependency for pytest. There is no impact here.
PYSEC-2024-48 # black vulnerability in 22.3.0, can't upgrade due to python 3.7 support, no impact

dependency-audit:
name: Dependency audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pypa/[email protected]
with:
inputs: requirements.txt dev_requirements.txt
ignore-vulns: |
GHSA-w596-4wvx-j9j6 # subversion related git pull, dependency for pytest. There is no impact here.
PYSEC-2024-48 # black vulnerability in 22.3.0, can't upgrade due to python 3.7 support, no impact

lint:
name: Code linters
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
cache: 'pip'
- name: run code linters
run: |
pip install -r dev_requirements.txt
invoke linters

run-tests:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
max-parallel: 15
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9']
test-type: ['standalone', 'cluster']
connection-type: ['hiredis', 'plain']
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
name: Python ${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}} tests
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: run tests
run: |
pip install -U setuptools wheel
pip install -r requirements.txt
pip install -r dev_requirements.txt
if [ "${{matrix.connection-type}}" == "hiredis" ]; then
pip install hiredis
fi
invoke devenv
sleep 10 # time to settle
invoke ${{matrix.test-type}}-tests

- uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: pytest-results-${{matrix.test-type}}-${{matrix.connection-type}}-${{matrix.python-version}}
path: '${{matrix.test-type}}*results.xml'

- name: Upload codecov coverage
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false

- name: View Test Results
uses: dorny/test-reporter@v1
if: success() || failure()
continue-on-error: true
with:
name: Test Results ${{matrix.python-version}} ${{matrix.test-type}}-${{matrix.connection-type}}
path: '*.xml'
reporter: java-junit
list-suites: all
list-tests: all
max-annotations: 10
fail-on-error: 'false'

resp3_tests:
lint:
name: Code linters
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
cache: 'pip'
- name: run code linters
run: |
pip install -r dev_requirements.txt
invoke linters

run-tests:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
max-parallel: 15
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9']
test-type: ['standalone', 'cluster']
connection-type: ['hiredis', 'plain']
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
name: Python ${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}} tests
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: run tests
run: |
pip install -U setuptools wheel
pip install -r requirements.txt
pip install -r dev_requirements.txt
if [ "${{matrix.connection-type}}" == "hiredis" ]; then
pip install hiredis
fi
invoke devenv
sleep 10 # time to settle
invoke ${{matrix.test-type}}-tests

- uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: pytest-results-${{matrix.test-type}}-${{matrix.connection-type}}-${{matrix.python-version}}
path: '${{matrix.test-type}}*results.xml'

- name: Upload codecov coverage
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false

- name: View Test Results
uses: dorny/test-reporter@v1
if: success() || failure()
continue-on-error: true
with:
name: Test Results ${{matrix.python-version}} ${{matrix.test-type}}-${{matrix.connection-type}}
path: '*.xml'
reporter: java-junit
list-suites: all
list-tests: all
max-annotations: 10
fail-on-error: 'false'

resp3_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.11']
test-type: ['standalone', 'cluster']
connection-type: ['hiredis', 'plain']
protocol: ['3']
exclude:
- test-type: 'cluster'
connection-type: 'hiredis'
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
name: RESP3 [${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}}]
steps:
- uses: actions/checkout@v4
Expand All @@ -133,11 +139,35 @@ jobs:
pip install hiredis
fi
invoke devenv
sleep 5 # time to settle
invoke ${{matrix.test-type}}-tests
invoke ${{matrix.test-type}}-tests --uvloop
sleep 10 # time to settle
invoke ${{matrix.test-type}}-tests --protocol=3
invoke ${{matrix.test-type}}-tests --uvloop --protocol=3

- uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: pytest-results-${{matrix.test-type}}-${{matrix.connection-type}}-${{matrix.python-version}}-resp3
path: '${{matrix.test-type}}*results.xml'

- name: Upload codecov coverage
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false

- name: View Test Results
uses: dorny/test-reporter@v1
if: success() || failure()
continue-on-error: true
with:
name: Test Results ${{matrix.python-version}} ${{matrix.test-type}}-${{matrix.connection-type}}-resp3
path: '*.xml'
reporter: java-junit
list-suites: all
list-tests: all
max-annotations: 10
fail-on-error: 'false'

build_and_test_package:
build_and_test_package:
name: Validate building and installing the package
runs-on: ubuntu-latest
needs: [run-tests]
Expand All @@ -154,7 +184,7 @@ jobs:
run: |
bash .github/workflows/install_and_test.sh ${{ matrix.extension }}

install_package_from_commit:
install_package_from_commit:
name: Install package from commit hash
runs-on: ubuntu-latest
strategy:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/pypi-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ jobs:
python setup.py build
python setup.py sdist bdist_wheel

- name: Basic package test prior to upload
run: |
twine check dist/*

- name: Publish to Pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Check Spelling
uses: rojopolis/spellcheck-github-actions@0.36.0
uses: rojopolis/spellcheck-github-actions@0.38.0
with:
config_path: .github/spellcheck-settings.yml
task_name: Markdown
2 changes: 1 addition & 1 deletion .github/workflows/stale-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is marked stale. It will be closed in 30 days if it is not updated.'
Expand Down
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* Update `ResponseT` type hint
* Allow to control the minimum SSL version
* Add an optional lock_name attribute to LockError.
* Fix return types for `get`, `set_path` and `strappend` in JSONCommands
Expand Down Expand Up @@ -61,6 +62,7 @@
* Improve error output for master discovery
* Make `ClusterCommandsProtocol` an actual Protocol
* Add `sum` to DUPLICATE_POLICY documentation of `TS.CREATE`, `TS.ADD` and `TS.ALTER`
* Prevent async ClusterPipeline instances from becoming "false-y" in case of empty command stack (#3061)

* 4.1.3 (Feb 8, 2022)
* Fix flushdb and flushall (#1926)
Expand Down
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,15 @@ The Python interface to the Redis key-value store.

## How do I Redis?

[Learn for free at Redis University](https://university.redis.com/)
[Learn for free at Redis University](https://redis.io/university/)

[Build faster with the Redis Launchpad](https://launchpad.redis.com/)
[Try the Redis Cloud](https://redis.io/try-free/)

[Try the Redis Cloud](https://redis.com/try-free/)
[Dive in developer tutorials](https://redis.io/learn)

[Dive in developer tutorials](https://developer.redis.com/)
[Join the Redis community](https://redis.io/community/)

[Join the Redis community](https://redis.com/community/)

[Work at Redis](https://redis.com/company/careers/jobs/)
[Work at Redis](https://redis.io/careers/)

## Installation

Expand Down Expand Up @@ -159,7 +157,7 @@ The following example shows how to utilize [Redis Pub/Sub](https://redis.io/docs

### Author

redis-py is developed and maintained by [Redis Inc](https://redis.com). It can be found [here](
redis-py is developed and maintained by [Redis Inc](https://redis.io). It can be found [here](
https://github.com/redis/redis-py), or downloaded from [pypi](https://pypi.org/project/redis/).

Special thanks to:
Expand All @@ -171,4 +169,4 @@ Special thanks to:
system.
- Paul Hubbard for initial packaging support.

[![Redis](./docs/logo-redis.png)](https://www.redis.com)
[![Redis](./docs/_static/logo-redis.svg)](https://redis.io)
19 changes: 10 additions & 9 deletions dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
click==8.0.4
black==22.3.0
flake8==5.0.4
click==8.0.4
flake8-isort==6.0.0
flake8==5.0.4
flynt~=0.69.0
invoke==1.7.3
mock==4.0.3
packaging>=20.4
pytest==7.2.0
pytest-timeout==2.1.0
pytest-asyncio>=0.20.2
invoke==1.7.3
pytest-cov>=4.0.0
vulture>=2.3.0
pytest
pytest-asyncio
pytest-cov
pytest-timeout
ujson>=4.2.0
wheel>=0.30.0
urllib3<2
uvloop
vulture>=2.3.0
wheel>=0.30.0
numpy>=1.19.0
Loading
Loading