Skip to content

ref(deps): Drop hard redis-py-cluster dependency to allow redis>=4#730

Merged
cmanallen merged 4 commits into
mainfrom
ref/drop-redis-py-cluster
Jun 24, 2026
Merged

ref(deps): Drop hard redis-py-cluster dependency to allow redis>=4#730
cmanallen merged 4 commits into
mainfrom
ref/drop-redis-py-cluster

Conversation

@cmanallen

Copy link
Copy Markdown
Member

Drop hard redis-py-cluster dependency to allow redis>=4. Mirrors the behavior of https://github.com/getsentry/sentry-redis-tools/blob/main/sentry_redis_tools/clients.py.

redis-py-cluster (EOL) pins redis<4.0.0, so any consumer of
taskbroker-client is transitively blocked from upgrading to redis>=4.1,
where cluster support is built in as redis.RedisCluster.

The package only uses RedisCluster as a type annotation in
scheduler/storage.py (never constructs it), so:

- Import RedisCluster from `redis` when available (>=4.1), falling back
  to `rediscluster` for redis<4 installs that opt into the new `cluster`
  extra.
- Move redis-py-cluster from a hard dependency to an optional `cluster`
  extra so default installs no longer cap redis below 4.
- De-parametrize the `RedisCluster[str] | StrictRedis[str]` annotation:
  redis>=4 ships py.typed with non-generic client classes, so the
  subscripted form is a type error ("Expected no type arguments"). The
  bare union type-checks cleanly on both redis 3.x and 4.x.

Verified: import resolves to redis.cluster.RedisCluster on redis 8.0.1
and falls back to rediscluster on redis 3.4.1; pyright reports 0 errors
on the bare annotation under redis>=4 bundled types.
@cmanallen cmanallen requested a review from a team as a code owner June 24, 2026 17:44

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit bddfe55. Configure here.

Comment thread clients/python/src/taskbroker_client/scheduler/storage.py Outdated
@cmanallen cmanallen merged commit 21ae975 into main Jun 24, 2026
37 of 39 checks passed
@cmanallen cmanallen deleted the ref/drop-redis-py-cluster branch June 24, 2026 18:30
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