Skip to content

feat: provide TypeVar defaults & provide initial typing for RedisCache#829

Merged
terencehonles merged 1 commit into
jazzband:masterfrom
terencehonles:mypy-updates
Jun 2, 2026
Merged

feat: provide TypeVar defaults & provide initial typing for RedisCache#829
terencehonles merged 1 commit into
jazzband:masterfrom
terencehonles:mypy-updates

Conversation

@terencehonles
Copy link
Copy Markdown
Contributor

No description provided.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 2, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.9%. Comparing base (2c0e853) to head (f402b35).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
django_redis/cache.py 66.7% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master    #829     +/-   ##
========================================
+ Coverage    60.9%   69.9%   +9.1%     
========================================
  Files          25      25             
  Lines        2144    2159     +15     
  Branches      308     173    -135     
========================================
+ Hits         1304    1508    +204     
+ Misses        532     478     -54     
+ Partials      308     173    -135     
Flag Coverage Δ
mypy 69.9% <80.0%> (+9.1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@terencehonles terencehonles merged commit 53a1de3 into jazzband:master Jun 2, 2026
19 checks passed
@terencehonles terencehonles deleted the mypy-updates branch June 2, 2026 11:22
pchopinet pushed a commit to JaaJSoft/workspace that referenced this pull request Jun 5, 2026
Bumps [django-redis](https://github.com/jazzband/django-redis) from
6.0.0 to 7.0.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/jazzband/django-redis/releases">django-redis's
releases</a>.</em></p>
<blockquote>
<h2>7.0.0</h2>
<h1>django-redis 7.0.0 (2026-06-02)</h1>
<h2>Features</h2>
<ul>
<li>Added the ability to pass redis username in the cache options (<a
href="https://redirect.github.com/jazzband/django-redis/issues/657">#657</a>)</li>
<li><code>RedisCache</code> does not attempt to close clients which have
not been initialized. (<a
href="https://redirect.github.com/jazzband/django-redis/issues/796">#796</a>)</li>
<li>Add sorted set operations (zadd, zrange, zrem, etc.) and mixins for
RedisCache (<a
href="https://redirect.github.com/jazzband/django-redis/issues/797">#797</a>)</li>
<li>Centralize configuration in <code>pyproject.toml</code>, drop EoL
Python &amp; Django
versions, and add support &amp; testing for modern Python &amp; Django
versions. (<a
href="https://redirect.github.com/jazzband/django-redis/issues/820">#820</a>)</li>
<li>Provide TypeVar defaults &amp; provide initial typing for
<code>RedisCache</code>. (<a
href="https://redirect.github.com/jazzband/django-redis/issues/829">#829</a>)</li>
</ul>
<h2>Bug Fixes</h2>
<ul>
<li>Fix IntEnum encoding (<a
href="https://redirect.github.com/jazzband/django-redis/issues/602">#602</a>)</li>
<li>Fix incorrect Redis typing that relied on the legacy
<code>types-redis</code> package, and update the public API to avoid
exposing redis-py key types (the encode/decode/make_key methods allow a
different API surface). (<a
href="https://redirect.github.com/jazzband/django-redis/issues/822">#822</a>)</li>
</ul>
<h2>Miscellaneous</h2>
<ul>
<li>Drop support for Django 5.0 (EOL) (<a
href="https://redirect.github.com/jazzband/django-redis/issues/779">#779</a>)</li>
<li>Clean &amp; organize ruff config (<a
href="https://redirect.github.com/jazzband/django-redis/issues/781">#781</a>)</li>
<li>Replace black with ruff format (<a
href="https://redirect.github.com/jazzband/django-redis/issues/782">#782</a>)</li>
<li>Update <code>RedisCache.close</code> to not forward
<code>kwargs</code> to the client implementation. (<a
href="https://redirect.github.com/jazzband/django-redis/issues/788">#788</a>)</li>
<li>Rename 'name' parameter to 'key' in all sorted set methods for
better consistency with Redis terminology (<a
href="https://redirect.github.com/jazzband/django-redis/issues/811">#811</a>)</li>
<li>Fix hash method parameters: rename 'name' → 'key', 'key' → 'field'
to align with Redis/Valkey terminology. Add version parameter to hlen()
and hkeys(). Fix make_key() to only apply to hash key, not fields. (<a
href="https://redirect.github.com/jazzband/django-redis/issues/812">#812</a>)</li>
<li>pre-commit autoupdate (<a
href="https://redirect.github.com/jazzband/django-redis/issues/819">#819</a>)</li>
<li>Use <code>from __future__ import annotations</code> to postpone
evaluation of annotations. (<a
href="https://redirect.github.com/jazzband/django-redis/issues/823">#823</a>)</li>
<li>Increase mypy strictness, fix typing configuration, and fix type
errors. (<a
href="https://redirect.github.com/jazzband/django-redis/issues/824">#824</a>)</li>
<li>This change updates the compose configuration, and moves it to
<code>tests</code>
directory as it is only for testing. (<a
href="https://redirect.github.com/jazzband/django-redis/issues/825">#825</a>)</li>
<li>Remove code handling unsupported Django versions (<a
href="https://redirect.github.com/jazzband/django-redis/issues/826">#826</a>)</li>
<li>Increase mypy type coverage &amp; update strictness overrides to
only target specific modules (<a
href="https://redirect.github.com/jazzband/django-redis/issues/827">#827</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/jazzband/django-redis/blob/master/CHANGELOG.rst">django-redis's
changelog</a>.</em></p>
<blockquote>
<h1>django-redis 7.0.0 (2026-06-02)</h1>
<h2>Features</h2>
<ul>
<li>Added the ability to pass redis username in the cache options
(<code>[#657](jazzband/django-redis#657)
&lt;https://github.com/jazzband/django-redis/issues/657&gt;</code>_)</li>
<li><code>RedisCache</code> does not attempt to close clients which have
not been initialized.
(<code>[#796](jazzband/django-redis#796)
&lt;https://github.com/jazzband/django-redis/issues/796&gt;</code>_)</li>
<li>Add sorted set operations (zadd, zrange, zrem, etc.) and mixins for
RedisCache
(<code>[#797](jazzband/django-redis#797)
&lt;https://github.com/jazzband/django-redis/issues/797&gt;</code>_)</li>
<li>Centralize configuration in <code>pyproject.toml</code>, drop EoL
Python &amp; Django
versions, and add support &amp; testing for modern Python &amp; Django
versions.
(<code>[#820](jazzband/django-redis#820)
&lt;https://github.com/jazzband/django-redis/issues/820&gt;</code>_)</li>
<li>Provide TypeVar defaults &amp; provide initial typing for
<code>RedisCache</code>.
(<code>[#829](jazzband/django-redis#829)
&lt;https://github.com/jazzband/django-redis/issues/829&gt;</code>_)</li>
</ul>
<h2>Bug Fixes</h2>
<ul>
<li>Fix IntEnum encoding
(<code>[#602](jazzband/django-redis#602)
&lt;https://github.com/jazzband/django-redis/issues/602&gt;</code>_)</li>
<li>Fix incorrect Redis typing that relied on the legacy
<code>types-redis</code> package, and update the public API to avoid
exposing redis-py key types (the encode/decode/make_key methods allow a
different API surface).
(<code>[#822](jazzband/django-redis#822)
&lt;https://github.com/jazzband/django-redis/issues/822&gt;</code>_)</li>
</ul>
<h2>Miscellaneous</h2>
<ul>
<li>Drop support for Django 5.0 (EOL)
(<code>[#779](jazzband/django-redis#779)
&lt;https://github.com/jazzband/django-redis/issues/779&gt;</code>_)</li>
<li>Clean &amp; organize ruff config
(<code>[#781](jazzband/django-redis#781)
&lt;https://github.com/jazzband/django-redis/issues/781&gt;</code>_)</li>
<li>Replace black with ruff format
(<code>[#782](jazzband/django-redis#782)
&lt;https://github.com/jazzband/django-redis/issues/782&gt;</code>_)</li>
<li>Update <code>RedisCache.close</code> to not forward
<code>kwargs</code> to the client implementation.
(<code>[#788](jazzband/django-redis#788)
&lt;https://github.com/jazzband/django-redis/issues/788&gt;</code>_)</li>
<li>Rename 'name' parameter to 'key' in all sorted set methods for
better consistency with Redis terminology
(<code>[#811](jazzband/django-redis#811)
&lt;https://github.com/jazzband/django-redis/issues/811&gt;</code>_)</li>
<li>Fix hash method parameters: rename 'name' → 'key', 'key' → 'field'
to align with Redis/Valkey terminology. Add version parameter to hlen()
and hkeys(). Fix make_key() to only apply to hash key, not fields.
(<code>[#812](jazzband/django-redis#812)
&lt;https://github.com/jazzband/django-redis/issues/812&gt;</code>_)</li>
<li>pre-commit autoupdate
(<code>[#819](jazzband/django-redis#819)
&lt;https://github.com/jazzband/django-redis/issues/819&gt;</code>_)</li>
<li>Use <code>from __future__ import annotations</code> to postpone
evaluation of annotations.
(<code>[#823](jazzband/django-redis#823)
&lt;https://github.com/jazzband/django-redis/issues/823&gt;</code>_)</li>
<li>Increase mypy strictness, fix typing configuration, and fix type
errors.
(<code>[#824](jazzband/django-redis#824)
&lt;https://github.com/jazzband/django-redis/issues/824&gt;</code>_)</li>
<li>This change updates the compose configuration, and moves it to
<code>tests</code>
directory as it is only for testing.
(<code>[#825](jazzband/django-redis#825)
&lt;https://github.com/jazzband/django-redis/issues/825&gt;</code>_)</li>
<li>Remove code handling unsupported Django versions
(<code>[#826](jazzband/django-redis#826)
&lt;https://github.com/jazzband/django-redis/issues/826&gt;</code>_)</li>
<li>Increase mypy type coverage &amp; update strictness overrides to
only target specific modules
(<code>[#827](jazzband/django-redis#827)
&lt;https://github.com/jazzband/django-redis/issues/827&gt;</code>_)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/jazzband/django-redis/commit/0ee6b11bb1affb0eda01b027eccb2d3af19d0b9f"><code>0ee6b11</code></a>
release 7.0 (<a
href="https://redirect.github.com/jazzband/django-redis/issues/830">#830</a>)</li>
<li><a
href="https://github.com/jazzband/django-redis/commit/fcc882bd431521e0829d16a0a6aa152fbb2c952d"><code>fcc882b</code></a>
feat: Allow cache OPTIONS to specify USERNAME (<a
href="https://redirect.github.com/jazzband/django-redis/issues/657">#657</a>)</li>
<li><a
href="https://github.com/jazzband/django-redis/commit/85c5c3d44af4dca2cf33e0989d331eecb609a37c"><code>85c5c3d</code></a>
fix: fix encoding IntEnum values (<a
href="https://redirect.github.com/jazzband/django-redis/issues/602">#602</a>)</li>
<li><a
href="https://github.com/jazzband/django-redis/commit/8558af4203246968568f5ee562b165d2cf7a7861"><code>8558af4</code></a>
feat: update <code>RedisCache.close</code> to check for client before
closing (<a
href="https://redirect.github.com/jazzband/django-redis/issues/796">#796</a>)</li>
<li><a
href="https://github.com/jazzband/django-redis/commit/53a1de3a5286edfd0123cbcfe2c0d63a93ef7fab"><code>53a1de3</code></a>
feat: provide TypeVar defaults &amp; provide initial typing for
<code>RedisCache</code> (<a
href="https://redirect.github.com/jazzband/django-redis/issues/829">#829</a>)</li>
<li><a
href="https://github.com/jazzband/django-redis/commit/308e2e155871fbd74c6ae814cc6905c0ec030d0d"><code>308e2e1</code></a>
feat: remove **kwargs from self.client.close() call in
RedisCache.close() (<a
href="https://redirect.github.com/jazzband/django-redis/issues/788">#788</a>)</li>
<li><a
href="https://github.com/jazzband/django-redis/commit/2c0e8538270ecb064c95456a013fe8b672a7dad7"><code>2c0e853</code></a>
feat: increase mypy type coverage &amp; move strictness overrides to
specific mod...</li>
<li><a
href="https://github.com/jazzband/django-redis/commit/8fb199e922b574116568d44c689f39c446d070a1"><code>8fb199e</code></a>
feat: remove code handling unsupported Django versions (<a
href="https://redirect.github.com/jazzband/django-redis/issues/826">#826</a>)</li>
<li><a
href="https://github.com/jazzband/django-redis/commit/5d54a256cb214d2e1ff4eae421dc6a77fe6794e2"><code>5d54a25</code></a>
tests: move &amp; update compose configuration (<a
href="https://redirect.github.com/jazzband/django-redis/issues/825">#825</a>)</li>
<li><a
href="https://github.com/jazzband/django-redis/commit/ca1f36898901d3a0d6acac088cc73c8f6d686f87"><code>ca1f368</code></a>
feat: increase mypy strictness, fix typing configuration, and fix type
errors...</li>
<li>Additional commits viewable in <a
href="https://github.com/jazzband/django-redis/compare/6.0.0...7.0.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=django-redis&package-manager=uv&previous-version=6.0.0&new-version=7.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant