Commit Graph

59 Commits

Author SHA1 Message Date
dependabot[bot]
bd179f530f Bump ruff from 0.0.281 to 0.0.282 (#251)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.0.281 to 0.0.282.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/BREAKING_CHANGES.md)
- [Commits](https://github.com/astral-sh/ruff/compare/v0.0.281...v0.0.282)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-02 08:19:24 +00:00
dependabot[bot]
f614bc2de5 Bump ruff from 0.0.276 to 0.0.281 (#250)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.0.276 to 0.0.281.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/BREAKING_CHANGES.md)
- [Commits](https://github.com/astral-sh/ruff/compare/v0.0.276...v0.0.281)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-01 08:52:18 +00:00
dependabot[bot]
e881a2a4d7 Bump ruff from 0.0.274 to 0.0.276 (#230)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.0.274 to 0.0.276.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/BREAKING_CHANGES.md)
- [Commits](https://github.com/astral-sh/ruff/compare/v0.0.274...v0.0.276)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-04 08:31:06 +00:00
dependabot[bot]
0df52ec740 Bump ruff from 0.0.272 to 0.0.274 (#212)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.0.272 to 0.0.274.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/BREAKING_CHANGES.md)
- [Commits](https://github.com/astral-sh/ruff/compare/v0.0.272...v0.0.274)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-21 09:10:20 +00:00
dependabot[bot]
37baa6cd0d Bump ruff from 0.0.271 to 0.0.272 (#200)
Bumps [ruff](https://github.com/charliermarsh/ruff) from 0.0.271 to 0.0.272.
- [Release notes](https://github.com/charliermarsh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/BREAKING_CHANGES.md)
- [Commits](https://github.com/charliermarsh/ruff/compare/v0.0.271...v0.0.272)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-08 09:12:43 +00:00
dependabot[bot]
e8cfa24c6e Bump ruff from 0.0.270 to 0.0.271 (#199)
Bumps [ruff](https://github.com/charliermarsh/ruff) from 0.0.270 to 0.0.271.
- [Release notes](https://github.com/charliermarsh/ruff/releases)
- [Changelog](https://github.com/charliermarsh/ruff/blob/main/BREAKING_CHANGES.md)
- [Commits](https://github.com/charliermarsh/ruff/compare/v0.0.270...v0.0.271)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-07 09:14:17 +00:00
dependabot[bot]
09e0da20b0 Bump ruff from 0.0.267 to 0.0.270 (#184)
Bumps [ruff](https://github.com/charliermarsh/ruff) from 0.0.267 to 0.0.270.
- [Release notes](https://github.com/charliermarsh/ruff/releases)
- [Changelog](https://github.com/charliermarsh/ruff/blob/main/BREAKING_CHANGES.md)
- [Commits](https://github.com/charliermarsh/ruff/compare/v0.0.267...v0.0.270)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-25 09:13:17 +00:00
Martijn Pieters
fbdaa62e24 💄 Pull version from installation metadata (#172)
The version string in the `__init__` module is needed to support
towncrier, but that does mean there are now two locations for the
project version: pyproject.toml and the `__init__.py` file. Use
`importlib.metadata` to pull the version from the installation metadata.
2023-05-17 17:09:52 +00:00
Martijn Pieters
42cb99d4eb 📣 Start managing the changelog with towncrier
This PR includes a workflow that validates that future PRs include
a changelog entry (unless the `skip-changelog` label is present on the
PR, or the PR is a dependabot PR).

Use 'poetry run towncrier create` to create entries for the changelog.
2023-05-17 17:31:03 +01:00
Martijn Pieters
282fcc7cea 📦 Move PyPI release workflow into the main workflow.
This ensures that any releases are fully tested before publication.

The workflow first builds the distribution files (sdist, wheel) before
using a deployment environment to publish these to PyPI, using the
GitHub actions OpenID support to authenticate with PyPI.
2023-05-17 11:33:25 +01:00
dependabot[bot]
189f997228 Bump coverage from 6.5.0 to 7.2.5
Bumps [coverage](https://github.com/nedbat/coveragepy) from 6.5.0 to 7.2.5.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/6.5.0...7.2.5)

---
updated-dependencies:
- dependency-name: coverage
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-16 13:46:35 +00:00
dependabot[bot]
621103c2b8 Bump aiobotocore from 1.4.2 to 2.5.0
Bumps [aiobotocore](https://github.com/aio-libs/aiobotocore) from 1.4.2 to 2.5.0.
- [Release notes](https://github.com/aio-libs/aiobotocore/releases)
- [Changelog](https://github.com/aio-libs/aiobotocore/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiobotocore/compare/1.4.2...2.5.0)

---
updated-dependencies:
- dependency-name: aiobotocore
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-16 13:17:50 +00:00
Martijn Pieters
230c24a4e0 Give tests and examples separate ruff configs (#158)
This allows more fine-grained lint rule adjustments, and allows
the examples to treat fastapi_cache as a 'third party' module, just
like users of the library would use it.
2023-05-16 12:42:12 +00:00
Martijn Pieters
d938bbe4d2 Add flake8-comprehensions linter (#157) 2023-05-16 12:18:53 +00:00
Martijn Pieters
50e3f91a87 Add flake8-bandit linting (#156)
The linter has been used in the past, so most assertions for these were
already there but needed to be updated to use `noqa: S` instead of
`nosec: B` annotations.
2023-05-16 12:11:10 +00:00
Martijn Pieters
f7db5cceb1 Add pyupgrade linter
This ensures we use the best syntax for the minimal Python version used.
The linter found one issue, fixed with the auto-fixer.
2023-05-16 13:00:18 +01:00
Martijn Pieters
d2947d01b5 Clean up pyproject.toml
- remove usused dependency
- use poetry syntax to specify minimal python versions
- simplify path selections in mypy and pyright
- correct pytest section name
2023-05-16 12:47:47 +01:00
Martijn Pieters
1d9e126037 Switch to ruff to handle linting and formatting
Ruff handles black, flake8 and isort in one package, and is way faster.
The isort rules had not been enforced, so this commit includes a lot
of import resorting changes.

I switched to flake8-bugbear and the standard black-compatible line
length of 80 + 10% (so max 88 characters), so some line reflowing is
included too.

Finally, because bugbear rightly points out that `setattr()` is less
performant, I've switched the `__signature__` assigment back to using
a direct assignment with type ignore comment.
2023-05-16 12:18:24 +01:00
Martijn Pieters
293a06467a Use poetry-core as the build system
Poetry core is the lighter-weight build system for poetry; this makes
installing the project faster.
2023-05-16 11:03:53 +01:00
Martijn Pieters
0e9a8baeb2 Add tox configuration
Tox manages test environments for all supported Python versions, as
well as linting and formatting tools. On GitHub, the test and lint
steps are kept as close as possible to the Makefile equivalents.
2023-05-16 10:49:17 +01:00
Martijn Pieters
31d0b007cd CI: use a separate step to run linters
This makes it easier to separate linter dependencies from older Python
releases.
2023-05-15 17:30:06 +01:00
Martijn Pieters
0763cd7b95 Add pyright strict type checking 2023-05-11 12:57:28 +01:00
Martijn Pieters
ad1eae2b4b Set python version for mypy
This lets you catch compatibility issues regardless of the current python version used for development.
2023-05-11 12:57:27 +01:00
Martijn Pieters
941cd044c7 Full mypy --strict type checking pass 2023-05-11 12:34:08 +01:00
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
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
long2ice
59a47b7fae chore: set version 0.2.0 2023-01-11 21:20:41 +08:00
mkdir700
5c776d20db build: update version of aiohttp 2022-11-05 22:21:35 +08:00
long2ice
566d30b790 Merge pull request #88 from vvanglro/feat/cache_html
feat: support cache jinja2 template response
2022-11-03 19:42:47 +08:00
squaresmile
f3f134a318 Added typing to the decorator 2022-10-25 08:58:44 +07:00
Charl P. Botha
d0c0885eae Add coverage 2022-10-14 21:59:51 +02:00
vvanglro
7e64cd6490 feat: support cache jinja2 template response 2022-09-28 17:37:05 +08: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
81d2bf2cc6 update version and changelog 2021-11-12 09:37:02 +08:00
long2ice
70f53566aa Merge pull request #40 from jimtheyounger/feature/add-dynamodb-backend
Add dynamodb backend support
2021-10-29 10:45:28 +08:00
long2ice
4faa5b7101 update workflows 2021-10-19 11:56:51 +08:00
long2ice
c3be2eca19 Fix default json coder for datetime. 2021-10-09 16:51:05 +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
767241be41 - Fix redis cache.
- Encode key builder.
2021-07-26 16:33:22 +08:00
long2ice
de1bde39fd update version 2021-07-23 09:38:47 +08:00
David Velez
3dc2b53e41 Updated changelog and version for the project. 2021-07-22 10:47:02 -05: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