Commit Graph

73 Commits

Author SHA1 Message Date
Martijn Pieters
013be85f97 Typing cleanup
- Compatibility with older Python versions
  - use `Optional` and `Union` instead of `... | None` and `a | b`
  - use `typing_extensions.Protocol` instead of `typing.Protocol`
  - use `typing.Dict`, `typing.List`, etc. instead of the concrete types.

- Fix backend `.get()` annotations; not all were marked as `Optional[str]`
- Don't return anything from `Backend.set()` methods.
- The `Coder.decode_as_type()` type parameter must be a type to be
  compatible with `ModelField(..., type_=...)`.
- Clean up `Optional[]` use, remove where it is not needed.
- Clean up variable use in decorator, keeping the raw cached value
  separate from the return value from the wrapped endpoint.
- Annotate the wrapper as returning either the original type _or_ a
  Response (returning a 304 Not Modified response).
- Clean up small edge-case where `response` could be `None`.
- Correct type annotation on `JsonCoder.decode()` to match `Coder.decode()`.
2023-05-11 12:31:05 +01:00
Martijn Pieters
3a3964db1b Refresh poetry lock
The older releases in the lock can cause the CI build to fail with
more recent Poetry versions, see python-poetry/poetry#7611. Updating
the lock should remedy this.
2023-04-28 12:27:52 +01:00
long2ice
38ddd063c3 test: add httpx for test 2023-02-15 10:49:35 +08:00
long2ice
d04be274e9 feat: upgrade deps 2023-02-15 10:43:01 +08:00
mkdir700
5c776d20db build: update version of aiohttp 2022-11-05 22:21:35 +08:00
Charl P. Botha
d0c0885eae Add coverage 2022-10-14 21:59:51 +02:00
long2ice
3a481a36ed fix: test 2022-09-11 12:33:10 +08:00
long2ice
cb9259807e feat: make request and response optional 2022-09-10 20:06:37 +08:00
Jinlong Peng
f80bfdb18d upgrade deps 2022-08-07 21:11:47 +08:00
long2ice
8c92cc59ae Fix test 2022-06-26 19:18:34 +08:00
long2ice
824e2e145f Replace aioredis with redis-py 2022-06-17 11:01:47 +08:00
long2ice
9582e04d43 update deps 2022-06-10 08:43:35 +08:00
long2ice
269c1ca616 update deps 2022-03-30 14:19:53 +08:00
Jimmy
d67797a1d5 Add DynamoDB backend 2021-09-29 16:14:28 +02:00
long2ice
37a2fa85db update CONVERTERS 2021-09-17 10:19:56 +08:00
long2ice
6888c10d6c update deps 2021-08-29 22:33:50 +08:00
long2ice
7c7aa26a88 update deps 2021-07-15 10:00:27 +08:00
long2ice
1d0c245a70 - Fix default expire for memcached. (#13)
- Update default key builder. (#12)
2021-03-20 14:42:29 +08:00
long2ice
a42fdaf632 Fix cache key builder. 2021-01-06 10:34:30 +08:00
long2ice
fd3ffa0d21 update memcached 2020-11-09 20:32:23 +08:00
long2ice
dc2ac9cc90 Add default config when init
update JsonEncoder
2020-10-16 16:55:33 +08:00
long2ice
c0259bc699 Add in-memory support. 2020-10-08 15:10:34 +08:00
long2ice
c20bb73f27 first commit 2020-08-26 18:04:57 +08:00