Skip to content

fix: restore Redis as optional dependency#312

Merged
sabuhish merged 2 commits into
sabuhish:masterfrom
faverl:fix/redis-optional-dependency
May 7, 2026
Merged

fix: restore Redis as optional dependency#312
sabuhish merged 2 commits into
sabuhish:masterfrom
faverl:fix/redis-optional-dependency

Conversation

@faverl
Copy link
Copy Markdown
Contributor

@faverl faverl commented May 5, 2026

What

redis was removed from the list of required dependencies and restored as an optional dependency under the [redis] extra, the same behavior it had in version 1.6.2.

Reason

In version 1.6.3, redis>=7.4.0,<8.0.0 was added as an unconditional dependency along with its existing optional entry, causing it to always be installed with fastapi-mail, regardless of whether the Redis functionality was needed.

@sabuhish
Copy link
Copy Markdown
Owner

sabuhish commented May 6, 2026

Hi, thanks for PR, totally agreed. But you still did not remove it from pyproject.toml file, it will be downloaded.
`

@faverl
Copy link
Copy Markdown
Contributor Author

faverl commented May 7, 2026

Hi, thanks for the review!

Just to clarify the intent of this PR — Redis was already an optional dependency. The [project.optional-dependencies] entry has existed for a long time:

[project.optional-dependencies]
redis = ["redis"]

The issue is that in commit cbd97a4, this line was added to the main dependencies array:
"redis (>=7.4.0,<8.0.0)"

That broke the optional behavior — Redis started being installed by default, even those who didn't need it.

This PR is not introducing Redis as optional. It's restoring the previous, intentional behavior:

Removed redis (>=7.4.0,<8.0.0) from the main dependencies array.
Moved the version constraint into the existing optional entry, so it now reads:
redis = ["redis>=7.4.0,<8.0.0"]

Redis is still fully supported via:
pip install fastapi-mail[redis]

@sabuhish sabuhish merged commit 15f8e39 into sabuhish:master May 7, 2026
2 checks passed
@faverl faverl deleted the fix/redis-optional-dependency branch May 7, 2026 15:28
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.

2 participants