Skip to content

Upgrade fakeredis to 2.32.1 from PyPI and move to main dependencies#186

Merged
chrisguidry merged 2 commits intomainfrom
fakeredis-2.32.1
Nov 6, 2025
Merged

Upgrade fakeredis to 2.32.1 from PyPI and move to main dependencies#186
chrisguidry merged 2 commits intomainfrom
fakeredis-2.32.1

Conversation

@chrisguidry
Copy link
Copy Markdown
Owner

Version 2.32.1 was released to PyPI on November 6, 2025, including the xpending_range fix that returns all 4 required fields (message_id, consumer, time_since_delivered, times_delivered). This allows us to:

  • Switch from the git dependency to a proper PyPI version
  • Move fakeredis from dev to main dependencies (it's used for the memory:// backend feature, not just testing)
  • Remove the temporary workaround and associated comments

The memory backend is now a production-ready feature with clean dependency management.

Changes

  • Added fakeredis[lua]>=2.32.1 to main dependencies
  • Removed git reference from dev dependencies
  • Cleaned up workaround comments

Testing

  • All 4 memory backend tests pass with PyPI version
  • All 398 tests pass with 100% coverage
  • All prek hooks pass

Related: cunla/fakeredis-py#427

🤖 Generated with Claude Code

Version 2.32.1 was released to PyPI on November 6, 2025, including the xpending_range fix that returns all 4 required fields (message_id, consumer, time_since_delivered, times_delivered). This allows us to:

- Switch from the git dependency to a proper PyPI version
- Move fakeredis from dev to main dependencies (it's used for the memory:// backend feature, not just testing)
- Remove the temporary workaround and associated comments

The memory backend is now a production-ready feature with clean dependency management.

## Changes

- Added `fakeredis[lua]>=2.32.1` to main dependencies
- Removed git reference from dev dependencies
- Cleaned up workaround comments

## Testing

- All 4 memory backend tests pass with PyPI version
- All 398 tests pass with 100% coverage
- All prek hooks pass

Related: cunla/fakeredis-py#427

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Nov 6, 2025

📚 Documentation has been built for this PR!

You can download the documentation directly here:
https://github.com/chrisguidry/docket/actions/runs/19141170513/artifacts/4488789536

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Nov 6, 2025

Claude finished @chrisguidry's task —— View job


🔍 PR Review: Upgrade fakeredis to 2.32.1

I've completed my review of this pull request. The changes look good overall - this is a clean upgrade that properly moves fakeredis from a development git dependency to a production PyPI dependency.

Review Checklist

  • Review dependency changes in pyproject.toml
  • Examine test file modifications
  • Check for complete removal of workarounds
  • Review new test utility additions
  • Verify test coverage remains at 100%

✅ Strengths

Clean dependency management:

  • Properly moved fakeredis[lua]>=2.32.1 from dev to main dependencies (line 28 in pyproject.toml)
  • Correctly removed the git dependency reference
  • This reflects the production use of fakeredis for the memory:// backend feature

High-quality test improvements:

  • Excellent refactoring of test utilities - the new waiting.py module provides robust polling utilities with proper timeouts
  • The wait functions (wait_for_execution_state, wait_for_progress_data, wait_for_worker_assignment) are well-documented with proper type hints
  • Replaced flaky asyncio.sleep() calls with deterministic state polling, significantly improving test reliability

Code organization:

  • Good file naming: renamed utils.py to run.py (more descriptive)
  • Consistent import updates across all 10 test files
  • Proper test coverage with pragma: no branch and pragma: no cover annotations where appropriate

📝 Observations

Test stability improvements:
The changes in test_watch.py are particularly noteworthy - replacing fixed sleep durations with active polling makes the tests more reliable and potentially faster. For example:

  • Line 91: await wait_for_execution_state(docket, "slower-task", ExecutionState.RUNNING) instead of await asyncio.sleep(0.05)
  • Line 198-200: await wait_for_progress_data(docket, "initial-progress", min_current=1, min_total=20) instead of await asyncio.sleep(1.5)

Memory backend support:
The test in test_memory_backend.py confirms the memory:// URL feature works correctly with the PyPI version of fakeredis.

✅ Approval

This PR successfully completes the migration from a git dependency to the official PyPI release. The code quality is excellent, test coverage remains at 100%, and the test improvements enhance reliability. No security issues or bugs were identified.

The CI checks all pass:

  • All 398 tests pass
  • 100% test coverage maintained
  • Documentation builds successfully
  • Code quality checks pass

Great work on both the dependency upgrade and the test improvements! 🎉

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Nov 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (7acf0eb) to head (54880ab).
⚠️ Report is 20 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #186   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           37        38    +1     
  Lines         6400      6443   +43     
  Branches       312       319    +7     
=========================================
+ Hits          6400      6443   +43     
Flag Coverage Δ
python-3.10 100.00% <100.00%> (ø)
python-3.11 99.02% <100.00%> (+<0.01%) ⬆️
python-3.12 100.00% <100.00%> (ø)
python-3.13 100.00% <100.00%> (ø)
python-3.14 100.00% <100.00%> (ø)

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

Files with missing lines Coverage Δ
tests/cli/run.py 100.00% <ø> (ø)
tests/cli/test_clear.py 100.00% <100.00%> (ø)
tests/cli/test_module.py 100.00% <100.00%> (ø)
tests/cli/test_snapshot.py 100.00% <100.00%> (ø)
tests/cli/test_striking.py 100.00% <100.00%> (ø)
tests/cli/test_tasks.py 100.00% <100.00%> (ø)
tests/cli/test_url_validation.py 100.00% <100.00%> (ø)
tests/cli/test_version.py 100.00% <100.00%> (ø)
tests/cli/test_watch.py 100.00% <100.00%> (ø)
tests/cli/test_worker.py 100.00% <100.00%> (ø)
... and 2 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Collaborator

@desertaxle desertaxle left a comment

Choose a reason for hiding this comment

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

!!!

@zzstoatzz zzstoatzz self-requested a review November 6, 2025 15:02
Copy link
Copy Markdown
Collaborator

@zzstoatzz zzstoatzz left a comment

Choose a reason for hiding this comment

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

giddy up!

@chrisguidry
Copy link
Copy Markdown
Owner Author

Gonna toss some unrelated test fixes here to make our coverage and flakes a little better

The Python 3.12 + Valkey 8.0 + redis-py >=5 test leg was intermittently failing with 99% coverage because line 891 in cli.py wasn't being hit. This happened when the watch command connected before progress data was written to Redis.

Tests were using fixed asyncio.sleep() calls hoping data would be ready, but timing varies across environments. Replaced these with active polling that queries Redis directly until conditions are met.

## Changes

**Added test utilities:**
- `tests/cli/waiting.py` - Three helpers that poll Redis state:
  - `wait_for_progress_data()` - Waits for progress current/total values
  - `wait_for_execution_state()` - Waits for specific execution state (RUNNING, etc.)
  - `wait_for_worker_assignment()` - Waits for worker to claim task

**Updated tests:**
- Modified 5 tests in `tests/cli/test_watch.py` to use polling helpers instead of fixed sleeps
- Tests now explicitly wait for the exact Redis conditions they need

**Renamed files:**
- `tests/cli/utils.py` → `tests/cli/run.py` (clearer name for CLI runner utility)
- Updated imports across all CLI test files

## Benefits

- Tests run faster (only wait as long as needed)
- More reliable across different timing environments
- Test intent is now explicit about what conditions they're waiting for
- Should eliminate the intermittent coverage failures

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@chrisguidry chrisguidry merged commit 3f4d09a into main Nov 6, 2025
25 checks passed
@chrisguidry chrisguidry deleted the fakeredis-2.32.1 branch November 6, 2025 15:45
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.

4 participants