Alex Waygood
8d5d2520ac
Use PEP 585 syntax wherever possible ( #6717 )
2021-12-28 11:31:43 +01:00
Sebastian Rittau
e6cb341d94
Update redis stubs to 4.1 ( #6711 )
...
Co-authored-by: Akuli <akuviljanen17@gmail.com >
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-12-27 21:34:34 +02:00
Rich Li
5fe2a26908
redis: Add stubs for lmove and blmove ( #6586 )
2021-12-25 01:50:53 +02:00
Jelle Zijlstra
5205efcaa4
Fix Redis.zpopmin and zpopmax ( #6642 )
...
Co-authored-by: Sebastian Rittau <srittau@rittau.biz >
2021-12-21 07:57:46 -08:00
Stephen Rosen
df0a724c0f
Always import Protocol from typing in stubs ( #6617 )
2021-12-17 13:12:22 +01:00
Akuli
4631b74919
Fix various issues in redis.client ( #6464 )
2021-12-01 17:09:48 +01:00
Akuli
deaa764915
redis: fix several stubtest warnings ( #6378 )
...
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com >
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com >
2021-12-01 12:00:07 +02:00
Akuli
a5bc1e037f
Add mypy error codes to '# type: ignore' comments ( #6379 )
2021-11-26 07:07:56 +01:00
Sebastian Rittau
ab026bfecb
Update redis stubs to version 4 ( #6368 )
2021-11-25 11:05:32 +02:00
Alex Waygood
c685c2d6c6
Reduce use of deprecated typing aliases ( #6358 )
2021-11-23 10:56:43 +01:00
Akuli
0cd1135219
Revert "do not use mypy-specific syntax in '# type: ignore' comments" ( #6338 )
2021-11-18 20:13:07 +02:00
Stéphane Brunner
9c9853967d
Redis Sentinel master_for, slave_for returns a Redis client ( #6269 )
2021-11-12 12:23:12 +01:00
Daniel Huckins
cf78194c76
Annotate Client.decr() and decrby() ( #6179 )
2021-10-16 18:46:52 +02:00
Nikita Sobolev
0e24e1fe66
Add redis/sentinel.pyi ( #6174 )
2021-10-15 12:04:56 +02:00
Akuli
994b69ef8f
Use lowercase tuple where possible ( #6170 )
2021-10-14 17:18:19 -07:00
Sebastian Rittau
9f86972350
Add star to all non-0.1 versions ( #6146 )
2021-10-11 13:41:19 -07:00
Nikita Sobolev
0142ea8b52
Add Redis.memory_purge() ( #6138 )
2021-10-09 17:02:28 +02:00
Nikita Sobolev
90f6727516
Add memory_stats() to Redis ( #6137 )
2021-10-09 11:57:59 +02:00
Steve Dignam
4ef07810c4
redis: include local property on Lock class ( #6083 )
...
The Lock class as a property local that has a token property that sometimes
needs be accessed / set.
```python
lock = redis.lock(key)
lock.local.token = token
lock.extend(10)
```
Technically the type of `local` is `SimpleNamespace | threading.local`
but I think this setup is a bit stricter but satisfies the API.
2021-09-28 21:16:23 -07:00
Jungkook Park
18d4868fce
Fix type of blocking_timeout argument to redis.lock.Lock ( #6019 )
2021-09-10 04:27:05 +02:00
Akuli
8d5452e873
do not use mypy-specific syntax in '# type: ignore' comments ( #5953 )
2021-08-29 03:58:34 -07:00
Akuli
ce11072dbe
Big diff: use lower-case list and dict ( #5888 )
2021-08-08 09:26:35 -07:00
Akuli
ee487304d7
Big diff: Use new "|" union syntax ( #5872 )
2021-08-08 11:05:21 +02:00
nzig
679ddde66e
Add replace parameter for redis restore ( #5668 )
2021-06-21 09:50:06 +02:00
nzig
962a6fd387
Add replace parameter for redis restore ( #5662 )
...
Co-authored-by: Nadav Zingerman <nadav@medigate.io >
2021-06-20 14:01:03 +02:00
Shantanu
7244ea1f71
Test third party stubs with stubtest ( #5615 )
2021-06-13 00:17:40 +02:00
Sebastian Rittau
6a6d5d8fd2
Fix zincrby argument order ( #5608 )
2021-06-09 21:16:34 +03:00
Sebastian Rittau
711580722b
Enable pyright for all Python 3 stubs ( #5597 )
...
* pyright: disable reportUnknownParameterType
Unknown parameter types are preferred over Any annotations for
incomplete stubs. Especially larger stubs are expected to be
incomplete for some time and it would be a shame to lose the
other pyright warnings for those stubs.
* Also disable reportUnknownVariableType
Fix problems with tkinter
* Disable reportUnknownMemberType
Fix pyright problems
2021-06-09 07:14:22 -07:00
n0ob404
2a9f081abb
Add annotations for some redis client methods ( #5559 )
...
Add annotation for move(), persist(), pexpire(), and expireat().
2021-05-31 22:01:11 +02:00
Rich Li
901dd52ec5
Add more redis stubs for sets ( #5490 )
2021-05-18 08:39:03 +02:00
n0ob404
7a9b4f93ba
Add stubs for redis Redis and Pipeline methods ( #5415 )
2021-05-13 09:53:26 +02:00
Ricardo
e3f510e896
redis client: adding __del__ and close ( #5365 )
...
* redis client: adding __del__ and close
2021-05-07 16:48:55 +03:00
Sebastian Rittau
4ac3ccad45
black: enable skip_magic_trailing_comma ( #5252 )
...
* black: enable skip_magic_trailing_comma
* Remove spurious commas
2021-04-27 08:32:32 -07:00
Christopher Dignam
0f8f428e23
[redis] add type for Client.lock ( #5176 )
2021-04-27 08:32:15 +02:00
Sebastian Rittau
45916045c8
Upgrade black to 21.4b0 and reformat ( #5250 )
...
This introduces newlines before decorators.
2021-04-26 13:58:27 +02:00
Shantanu
fc660d6d41
Move typing_extensions to stdlib ( #5233 )
...
I'm not sure what the best way to do this is. This effectively orphans
types-typing-extensions, but maybe that's not really a problem. (We can
yank the package too)
See https://github.com/python/typeshed/pull/5229#issuecomment-822234125
for some details
Co-authored-by: hauntsaninja <>
2021-04-20 21:55:48 -07:00
dearoneesama
8eaffee63a
Fix redis pipe.hset() signature ( #5196 )
2021-04-08 19:03:51 -07:00
dearoneesama
5a3b6c72a7
Fix redis stub hset() to allow only providing mapping ( #5168 )
...
* Fix redis stub hset() to allow only providing mapping
* Fix redis stub hset() and hmset() mapping type
2021-04-04 11:40:29 +03:00
Christopher Dignam
87bcb37d3f
[redis] add more exceptions ( #5174 )
...
* [redis] add more exceptions
2021-04-02 22:06:03 +03:00
Árni Már Jónsson
82cd7d22c6
add stubs for redis.lock ( #5105 )
2021-03-22 19:08:12 -07:00
Guilhem C
6170697b25
redis: add redis.client.Client method stubs ( #5110 )
...
* redis: add setnx function stubs (redis.client.Client.setnx)
* redis: add incr function stubs (redis.client.Client.incr)
2021-03-22 18:53:59 -07:00
Christopher Dignam
10da20293e
[redis] add remaining sorted set types ( #5097 )
2021-03-08 14:59:47 +01:00
Guilhem C
bf583da275
redis: complete redis.utils stubs ( #5067 )
2021-02-25 12:46:12 +01:00
Christopher Dignam
46ac6bf87f
[redis] fix pipeline return types ( #4989 )
...
Pipeline is a subclass of Redis, but instead of the commands returning results, they return Pipeline.
2021-02-23 08:28:01 +01:00
Guilhem C
ad2624551b
redis: complete echo command stub (redis.client.Redis.echo) ( #5033 )
2021-02-22 13:18:45 +01:00
Christopher Dignam
93e2806232
[redis] add overload for blpop and brpop timeout ( #4998 )
...
0 is the default value for the timeout argument for both blpop and brpop. When the timeout is `0`, the return type is non-nullable. Otherwise the return type is optional.
I tested my change with the following code
```python
from typing import Optional, Tuple
import redis
def test_blpop_timeout(r: redis.Redis) -> None:
a: Tuple[bytes, bytes] = r.blpop('')
b: Tuple[bytes, bytes] = r.blpop('',timeout=0)
c: Optional[Tuple[bytes, bytes]] = r.blpop('', timeout=1)
d: Optional[Tuple[bytes, bytes]] = r.blpop('', timeout=1.0)
def test_brpop_timeout(r: redis.Redis) -> None:
a: Tuple[bytes, bytes] = r.brpop('')
b: Tuple[bytes, bytes] = r.brpop('',timeout=0)
c: Optional[Tuple[bytes, bytes]] = r.brpop('', timeout=1)
d: Optional[Tuple[bytes, bytes]] = r.brpop('', timeout=1.0)
```
2021-02-04 20:32:34 -08:00
Ivan Levkivskyi
16ae4c6120
Re-organize directory structure ( #4971 )
...
See discussion in #2491
Co-authored-by: Ivan Levkivskyi <ilevkivskyi@dropbox.com >
2021-01-27 12:00:39 +00:00