Skip to content

Drop more py37 (CI check) #2

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

Closed
wants to merge 57 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
7c4f167
Deprecate RedisGraph (#2927)
dvora-h Sep 11, 2023
317ea3a
Fix protocol checking for search commands (#2923)
dvora-h Sep 11, 2023
c7dc175
Fix typo in redis-stream-example.ipynb (#2918)
AOrazaev Sep 11, 2023
09dcef1
Fix resource warnings in unit tests (#2899)
kristjanvalur Sep 11, 2023
53be0b6
Add 7.2 to supported Redis versions (#2896)
uglide Sep 11, 2023
8c8a529
Fix async sentinel (#2922)
dvora-h Sep 11, 2023
1596ac6
Remove mentions of Tox (#2929)
akx Sep 11, 2023
46b736e
Support timeout = 0 in search query (#2934)
meiravgri Sep 14, 2023
94ae3e0
Fix resource usage and cleanup Mocks in the unit tests (#2936)
kristjanvalur Sep 14, 2023
ba186d2
Remove process-id checks from asyncio. Asyncio and fork() does not m…
kristjanvalur Sep 14, 2023
578fb26
Avoid creating ref cycles (#2932)
hauntsaninja Sep 14, 2023
509c77c
add pagination, sorting and grouping examples to search json example …
elfkuzco Sep 14, 2023
086efb2
Cluster determine slot command name need upper (#2919)
yangbodong22011 Sep 18, 2023
012f7cf
Add `Redis.from_pool()` class method, for explicitly owning and closi…
kristjanvalur Sep 18, 2023
0acd0e7
Add support for multimple values in `RPUSHX` (#2949)
dvora-h Sep 19, 2023
2df75ad
Fix monitor regex bug (#2950)
dvora-h Sep 19, 2023
6207641
Add support for `ModuleCommands` in cluster (#2951)
dvora-h Sep 19, 2023
c46a28d
Provide aclose() / close() for classes requiring lifetime management …
kristjanvalur Sep 20, 2023
ded9f7c
async fixes, remove __del__ and other things (#2870)
kristjanvalur Sep 20, 2023
1b370da
Replace clear_connect_callbacks with _deregister_connect_callback (#2…
dvora-h Sep 21, 2023
56b254e
Save a reference to created async tasks, to avoid tasks potentially d…
anio Sep 21, 2023
2ee7c3c
Type hint improvements (#2952)
chayim Sep 21, 2023
cc4bc1a
Version 5.0.1 (#2958)
dvora-h Sep 21, 2023
24887dc
Bump actions/checkout from 3 to 4 (#2969)
dependabot[bot] Oct 5, 2023
787d731
Bump rojopolis/spellcheck-github-actions from 0.33.1 to 0.34.0 (#2970)
dependabot[bot] Oct 5, 2023
054caf3
fix type hint (#2963)
d184230 Oct 9, 2023
d1dbb15
Don't perform blocking connect inside the BlockingConnectionQueue Con…
kristjanvalur Oct 11, 2023
5391c5f
Creating CODEOWNERS for the examples (#2993)
chayim Oct 11, 2023
df3b9e9
Close various objects created during asyncio tests (#3005)
kristjanvalur Oct 16, 2023
7867c62
Linking to Redis resources (#3006)
chayim Oct 16, 2023
05124de
Add GEOSHAPE field type for index creation of RediSearch (#2957)
sjpotter Oct 16, 2023
14be2da
Better deal with "lost" connections for async Redis (#2999)
kristjanvalur Oct 16, 2023
d3a3ada
Update client.py sleep_time typing for run_in_thread function (#2977)
danielzhangau Oct 16, 2023
c2d5596
Fix BlockingConnectionPool.from_url parsing of timeout in query args …
r0ro Nov 13, 2023
0113034
Fix parsing resp3 dicts (#2982)
kristjanvalur Nov 13, 2023
225881c
Drop typing_extensions dependency (not necessary when targeting Pytho…
akx Sep 4, 2023
9c0fac3
Bump python_requires to >=3.8, drop importlib-metadata shim dependency
akx Sep 4, 2023
87329f7
Cease testing on Python 3.7
akx Sep 4, 2023
6978275
Client Side Caching: Alpha support (#3038)
dvora-h Nov 16, 2023
8875d55
Version 5.1.0a1 (#3044)
dvora-h Nov 16, 2023
58da813
Update ocsp.py (#3022)
AniketP04 Nov 29, 2023
a60d25e
Bump rojopolis/spellcheck-github-actions from 0.34.0 to 0.35.0 (#3060)
dependabot[bot] Dec 3, 2023
ac92e0c
Use `disable_decoding` in async `read_response`. (#3042)
MrDenkoV Dec 3, 2023
eefe3ab
Add "sum" to DUPLICATE_POLICY documentation of TS.CREATE, TS.ADD and …
Pedram-Parsian Dec 3, 2023
8a3ae36
Update advanced_features.rst (#3019)
BackflipPenguin Dec 3, 2023
e13356d
Fix typos. (#3016)
AYMENJD Dec 3, 2023
ce9eb83
Fix parsing of `FT.PROFILE` result (#3063)
dvora-h Dec 4, 2023
3502c4d
Prevent async ClusterPipeline instances from becoming "false-y" in ca…
jakob-keller Dec 11, 2023
50245cd
Update repr of important classes with module name and recommended "< …
kristjanvalur Dec 11, 2023
fd281e0
Make the connection callback methods public again, add documentation …
kristjanvalur Dec 11, 2023
d5a59cd
Fix reported version of deprecations in asyncio.client (#2968)
zware Dec 11, 2023
a1df1cf
Allow the parsing of the asking command to forward original options (…
tbbream Dec 11, 2023
5fec523
Fix Specifying Target Nodes broken hyperlink (#3072)
enjoy-binbin Dec 11, 2023
f6a4b49
Fix return types in json commands (#3071)
parmenashp Dec 11, 2023
53de308
Client side caching invalidations (standalone) (#3089)
dvora-h Jan 1, 2024
19d7206
Merge branch 'master' into drop-more-py37
dvora-h Jan 1, 2024
78c0625
Add 3.8 test
dvora-h Jan 1, 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
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
**/__pycache__
**/*.pyc
.tox
.coverage
.coverage.*
1 change: 0 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ exclude =
*.egg-info,
*.pyc,
.git,
.tox,
.venv*,
build,
docs/*,
Expand Down
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
doctests/* @dmaier-redislabs
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

_Please make sure to review and check all of these items:_

- [ ] Does `$ tox` pass with this change (including linting)?
- [ ] Do tests and lints pass with this change?
- [ ] Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
- [ ] Is the new or changed code fully tested?
- [ ] Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
Expand Down
1 change: 0 additions & 1 deletion .github/wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ thevalueofmykey
timeseries
toctree
topk
tox
triaging
txt
un
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
name: Build docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.9
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
name: Dependency audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: pypa/[email protected]
with:
inputs: requirements.txt dev_requirements.txt
Expand All @@ -40,7 +40,7 @@ jobs:
name: Code linters
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.9
Expand All @@ -57,14 +57,14 @@ jobs:
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']
python-version: ['3.8', '3.9', '3.10', '3.11', '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@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
Expand Down Expand Up @@ -111,15 +111,15 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.11']
python-version: ['3.8', '3.11']
test-type: ['standalone', 'cluster']
connection-type: ['hiredis', 'plain']
protocol: ['3']
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
name: RESP3 [${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}}]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -146,7 +146,7 @@ jobs:
matrix:
extension: ['tar.gz', 'whl']
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.9
Expand All @@ -160,9 +160,9 @@ jobs:
strategy:
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']
python-version: ['3.8', '3.9', '3.10', '3.11', 'pypy-3.8', 'pypy-3.9']
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
build_and_package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: install python
uses: actions/setup-python@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Check Spelling
uses: rojopolis/spellcheck-github-actions@0.33.1
uses: rojopolis/spellcheck-github-actions@0.35.0
with:
config_path: .github/spellcheck-settings.yml
task_name: Markdown
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ redis.egg-info
build/
dist/
dump.rdb
/.tox
_build
vagrant/.vagrant
.python-version
Expand Down
6 changes: 6 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* Fix return types for `get`, `set_path` and `strappend` in JSONCommands
* Connection.register_connect_callback() is made public.
* Fix async `read_response` to use `disable_decoding`.
* Add 'aclose()' methods to async classes, deprecate async close().
* Fix #2831, add auto_close_connection_pool=True arg to asyncio.Redis.from_url()
* Fix incorrect redis.asyncio.Cluster type hint for `retry_on_error`
* Fix dead weakref in sentinel connection causing ReferenceError (#2767)
Expand Down Expand Up @@ -54,6 +58,8 @@
* Fix for Unhandled exception related to self.host with unix socket (#2496)
* 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
30 changes: 1 addition & 29 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,9 @@ It is possible to run only Redis client tests (with cluster mode disabled) by
using `invoke standalone-tests`; similarly, RedisCluster tests can be run by using
`invoke cluster-tests`.

Each run of tox starts and stops the various dockers required. Sometimes
Each run of tests starts and stops the various dockers required. Sometimes
things get stuck, an `invoke clean` can help.

Continuous Integration uses these same wrappers to run all of these
tests against multiple versions of python. Feel free to test your
changes against all the python versions supported, as declared by the
tox.ini file (eg: tox -e py39). If you have the various python versions
on your desktop, you can run *tox* by itself, to test all supported
versions.

### Docker Tips

Following are a few tips that can help you work with the Docker-based
Expand All @@ -97,10 +90,6 @@ To get a bash shell inside of a container:

`$ docker run -it <service> /bin/bash`

**Note**: The term \"service\" refers to the \"services\" defined in the
`tox.ini` file at the top of the repo: \"master\", \"replicaof\",
\"sentinel_1\", \"sentinel_2\", \"sentinel_3\".

Containers run a minimal Debian image that probably lacks tools you want
to use. To install packages, first get a bash session (see previous tip)
and then run:
Expand All @@ -111,23 +100,6 @@ You can see the logging output of a containers like this:

`$ docker logs -f <service>`

The command make test runs all tests in all tested Python
environments. To run the tests in a single environment, like Python 3.9,
use a command like this:

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

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

Our test suite uses `pytest`. You can run a specific test suite against
a specific Python version like this:

`$ docker-compose run test tox -e py37 -- --redis-url=redis://master:6379/9 tests/test_commands.py`

### Troubleshooting

If you get any errors when running `make dev` or `make test`, make sure
Expand Down
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ The Python interface to the Redis key-value store.

---------------------------------------------

## How do I Redis?

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

[Build faster with the Redis Launchpad](https://launchpad.redis.com/)

[Try the Redis Cloud](https://redis.com/try-free/)

[Dive in developer tutorials](https://developer.redis.com/)

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

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

## Installation

Start a redis via docker:
Expand All @@ -42,7 +56,7 @@ Looking for a high-level library to handle object mapping? See [redis-om-python]

## Supported Redis Versions

The most recent version of this library supports redis version [5.0](https://github.com/redis/redis/blob/5.0/00-RELEASENOTES), [6.0](https://github.com/redis/redis/blob/6.0/00-RELEASENOTES), [6.2](https://github.com/redis/redis/blob/6.2/00-RELEASENOTES), and [7.0](https://github.com/redis/redis/blob/7.0/00-RELEASENOTES).
The most recent version of this library supports redis version [5.0](https://github.com/redis/redis/blob/5.0/00-RELEASENOTES), [6.0](https://github.com/redis/redis/blob/6.0/00-RELEASENOTES), [6.2](https://github.com/redis/redis/blob/6.2/00-RELEASENOTES), [7.0](https://github.com/redis/redis/blob/7.0/00-RELEASENOTES) and [7.2](https://github.com/redis/redis/blob/7.2/00-RELEASENOTES).

The table below highlights version compatibility of the most-recent library versions and redis versions.

Expand Down
1 change: 0 additions & 1 deletion dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ packaging>=20.4
pytest==7.2.0
pytest-timeout==2.1.0
pytest-asyncio>=0.20.2
tox==3.27.1
invoke==1.7.3
pytest-cov>=4.0.0
vulture>=2.3.0
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced_features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ running.

The third option runs an event loop in a separate thread.
pubsub.run_in_thread() creates a new thread and starts the event loop.
The thread object is returned to the caller of [un_in_thread(). The
The thread object is returned to the caller of run_in_thread(). The
caller can use the thread.stop() method to shut down the event loop and
thread. Behind the scenes, this is simply a wrapper around get_message()
that runs in a separate thread, essentially creating a tiny non-blocking
Expand Down
2 changes: 1 addition & 1 deletion docs/clustering.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ The ‘target_nodes’ parameter is explained in the following section,
>>> # target-node: default-node
>>> rc.ping()

Specfiying Target Nodes
Specifying Target Nodes
-----------------------

As mentioned above, all non key-based RedisCluster commands accept the
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ["_build", "**.ipynb_checkponts"]
exclude_patterns = ["_build", "**.ipynb_checkpoints"]

# The reST default role (used for this markup: `text`) to use for all
# documents.
Expand Down
47 changes: 35 additions & 12 deletions docs/examples/asyncio_examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"\n",
"## Connecting and Disconnecting\n",
"\n",
"Utilizing asyncio Redis requires an explicit disconnect of the connection since there is no asyncio deconstructor magic method. By default, a connection pool is created on `redis.Redis()` and attached to this `Redis` instance. The connection pool closes automatically on the call to `Redis.close` which disconnects all connections."
"Utilizing asyncio Redis requires an explicit disconnect of the connection since there is no asyncio deconstructor magic method. By default, a connection pool is created on `redis.Redis()` and attached to this `Redis` instance. The connection pool closes automatically on the call to `Redis.aclose` which disconnects all connections."
]
},
{
Expand All @@ -39,9 +39,29 @@
"source": [
"import redis.asyncio as redis\n",
"\n",
"connection = redis.Redis()\n",
"print(f\"Ping successful: {await connection.ping()}\")\n",
"await connection.close()"
"client = redis.Redis()\n",
"print(f\"Ping successful: {await client.ping()}\")\n",
"await client.aclose()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"If you create custom `ConnectionPool` for the `Redis` instance to use alone, use the `from_pool` class method to create it. This will cause the pool to be disconnected along with the Redis instance. Disconnecting the connection pool simply disconnects all connections hosted in the pool."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import redis.asyncio as redis\n",
"\n",
"pool = redis.ConnectionPool.from_url(\"redis://localhost\")\n",
"client = redis.Redis.from_pool(pool)\n",
"await client.close()"
]
},
{
Expand All @@ -53,7 +73,8 @@
}
},
"source": [
"If you supply a custom `ConnectionPool` that is supplied to several `Redis` instances, you may want to disconnect the connection pool explicitly. Disconnecting the connection pool simply disconnects all connections hosted in the pool."
"\n",
"However, If you supply a `ConnectionPool` that is shared several `Redis` instances, you may want to disconnect the connection pool explicitly. use the `connection_pool` argument in that case."
]
},
{
Expand All @@ -69,10 +90,12 @@
"source": [
"import redis.asyncio as redis\n",
"\n",
"connection = redis.Redis(auto_close_connection_pool=False)\n",
"await connection.close()\n",
"# Or: await connection.close(close_connection_pool=False)\n",
"await connection.connection_pool.disconnect()"
"pool = redis.ConnectionPool.from_url(\"redis://localhost\")\n",
"client1 = redis.Redis(connection_pool=pool)\n",
"client2 = redis.Redis(connection_pool=pool)\n",
"await client1.aclose()\n",
"await client2.aclose()\n",
"await pool.aclose()"
]
},
{
Expand All @@ -90,9 +113,9 @@
"source": [
"import redis.asyncio as redis\n",
"\n",
"connection = redis.Redis(protocol=3)\n",
"await connection.close()\n",
"await connection.ping()"
"client = redis.Redis(protocol=3)\n",
"await client.aclose()\n",
"await client.ping()"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/pipeline_examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The responses of the three commands are stored in a list. In the above example, the two first boolean indicates that the `set` commands were successfull and the last element of the list is the result of the `get(\"a\")` comand."
"The responses of the three commands are stored in a list. In the above example, the two first boolean indicates that the `set` commands were successful and the last element of the list is the result of the `get(\"a\")` comand."
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/redis-stream-example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@
"metadata": {},
"source": [
"## delete all\n",
"To remove the messages with need to remote them explicitly with `xdel`."
"To remove the messages with need to remove them explicitly with `xdel`."
]
},
{
Expand Down
Loading