Repository navigation
Drop Python 3.10 support - #7449
Conversation
Python 3.10 reaches end of life in October 2026. Importing reflex on 3.10 already logged a plain warning with no version; route it through console.deprecate so it carries the deprecation (0.10.0) and removal (0.11.0) versions and is deduplicated like every other deprecation. Add a regression test that reloads the package under a faked interpreter version, note the deprecation in the installation docs, and add the changelog fragment. Claude-Session: https://claude.ai/code/session_01THjQbCVaRY5u7AUSDZu7q8
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
All reported issues were addressed across 5 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4ba4376620
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Merging this PR will not alter performance
Comparing Footnotes
|
Python 3.10 reaches end of life in October 2026 and Reflex has warned about it since 0.8.15, so require Python 3.11 or newer across the workspace instead of carrying the deprecation into 0.11.0. Raise requires-python to 3.11 in every package, drop the 3.10 classifier, CI matrix legs and the init-test Docker image, and regenerate uv.lock without the 3.10-only resolution splits. Remove the import-time deprecation warning along with its test and fragment. Delete the runtime shims that existed only for 3.10: the tomli fallback for tomllib, exception add_note guards, the asyncio cancelling() guard in the redis lease check, the TypedDict NotRequired workaround in form validation, the get_type_hints Optional unwrapping in memo parameter analysis, the BaseExceptionGroup lookup via builtins, and the ForwardRef is_class branch. Move the ruff target to py311 and apply its fixes: datetime.UTC, typing imports that no longer need typing_extensions, the TimeoutError alias, PEP 646 star unpacking and fromisoformat's native "Z" parsing. ASYNC109 and UP042 are ignored with reasons: timeouts are explicit parameters of the testing and state-manager APIs, and StrEnum would change how the (str, Enum) members render. Regenerate the playground content hash and the reflex stub hash, and add a breaking-change fragment to every published package. Claude-Session: https://claude.ai/code/session_01THjQbCVaRY5u7AUSDZu7q8
…hash The ruff py311 sweep moved the datetime UTC import to module level in the playwright datetime test, but AppHarness extracts only the app factory's body into the generated app, so the name was undefined at import time. Keep the import inside the factory with the others. Regenerate pyi_hashes.json without the generator's last-run cache so reflex/experimental/memo.pyi carries the hash CI computes. Claude-Session: https://claude.ai/code/session_01THjQbCVaRY5u7AUSDZu7q8
Main's #7449 and #7458 regenerated examples/playground/.content-hash, the only conflicting file; scripts/hash_examples.py regenerated it for the merged playground. Claude-Session: https://claude.ai/code/session_01PXcFKAgnzhgdnSvhuCmxWE
Brings in #7449, which drops Python 3.10 and moves ruff to py311. Claude-Session: https://claude.ai/code/session_01PXcFKAgnzhgdnSvhuCmxWE
PERF203 only applies before Python 3.11, where try/except in a loop costs per iteration. With ruff targeting py311 since #7449 the directive is unused, which RUF100 rejects. Claude-Session: https://claude.ai/code/session_01PXcFKAgnzhgdnSvhuCmxWE
reflex-otel raised its floor to Python 3.11 in #7449 without a news fragment, so the release tooling had nothing to release it with. Add the same fragment the other packages got, and a news/.gitkeep so the directory survives materialization. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_011qWgGrSKMqztQtSRWBP7KK
* Serialize production frontend work sharing one .web directory Two exports (or an export and a prod/preview start) in the same project used to race on .web: the second replaced build/ and env.json while the first was still compiling or zipping, so one of them shipped the other's frontend. Hold an exclusive, reentrant file lock on .web/.reflex-build.lock from compilation through ZIP creation, release it before serving, and never create .web for a backend-only export that has nothing to protect. Split out of #7054 (lock only; the opt-in build cache that needs it follows separately). Claude-Session: https://claude.ai/code/session_018nWB9r2HcC5tkT72UxWgGj * Drop the PERF203 noqa that ruff no longer reports PERF203 only applies before Python 3.11, where try/except in a loop costs per iteration. With ruff targeting py311 since #7449 the directive is unused, which RUF100 rejects. Claude-Session: https://claude.ai/code/session_01PXcFKAgnzhgdnSvhuCmxWE * Consolidate the frontend build lock into path_ops.file_lock The production build lock had its own copy of the platform-specific locking (flock / msvcrt) next to the sidecar-based json_file_lock, with different Windows polling, a different failure mode and a lock file inside .web. Keep one implementation: json_file_lock becomes file_lock, usable for files and directories, and gains the reentrancy and fork handling the build lock needed. Exports and production/preview startup now lock the .web directory through it. The sidecar lives in REFLEX_DIR, so locking never creates .web and the lock inode survives .web being replaced. Backend-only exports therefore always take the lock instead of skipping it when .web is absent, which closes the race the review bots flagged. The lock is released explicitly on Windows before the descriptor closes. Claude-Session: https://claude.ai/code/session_017XAFCkYB3Z8w3S6pgJrLCh * Keep the export race test's lock directory outside the archived app The backend ZIP walks the app root, and REFLEX_DIR sat inside it, so the exporter archived its own held lock file. Windows refuses reads of a byte-range-locked file, failing the zip with PermissionError. Claude-Session: https://claude.ai/code/session_01PXcFKAgnzhgdnSvhuCmxWE --------- Co-authored-by: Claude <[email protected]>
* docs: add a Workflows section for reflex-workflow Thirteen pages under docs/workflows, grouped in the Backend sidebar: an overview, a tutorial, guides to defining workflows, steps, runs, events, schedules, fan-out, concurrency, workers and inspecting runs, an explanation of how the engine works and what it guarantees, and an API reference. Also fixes the package README's wake route, which used an app.api attribute Reflex does not have. * docs: qualify lease-bound claims and complete example imports * docs: retryable webhook response, precise cancel status, and what history records * docs: acknowledge webhooks only on known delivery, guard the cancel status, describe history as committed attempts * reflex-workflow: answer a message whose wake was refused while a held one ran A run holds one event at a time. When the conversation example's turn was running a held wake, a wake for a message that arrived after the turn read the transcript was refused, and nothing read that message until the four-hour reminder. That is what timed out test_a_burst_after_a_restart_is_answered_in_order in CI: a message landing while the previous reply step was still committing is held, and the next one can land in that gap. reply now reads the transcript again under the arrival lock before it waits, as remind already does, and takes another turn for anything new. A message that lands after that read finds the run still stepping, so its wake is held. The regression test drives the race deterministically: it fails on a thirty-second timeout before this change and passes in under a second after. * reflex-workflow: arm every conversation wait in one step that rereads first Checking for unread messages in reply was not enough. When reply found one it took another turn with the earlier wake still held, and the turn that finally ran that wake found nothing new and armed the wait directly: a message whose wake was refused while it ran then waited for the reminder. Every wait is now armed by settle, a step of its own that rereads the transcript under the arrival lock. reply and a turn with nothing new both go through it. The regression test now also drives a message into the turn that runs the stale wake, and fails without this change. The reminder race test waited on the status, which is set as soon as a wait is armed; it now waits until no wake is held and no step is running, since a held wake replaying through settle takes the lock the test holds. * docs: give Workflows its own top-level sidebar section Moved out of the State section, between State and Recipes as masenf suggested, with the guides grouped into Building and Running Workflows. Single pages are one-child groups, as elsewhere in the sidebar: the index that opens the active group counts top-level entries that way. * docs: keep inline code out of link text, which the docs site does not render * Revert "docs: keep inline code out of link text, which the docs site does not render" This reverts commit efcdd2e. * Name this PR's news fragments by its number * docs: wake also waits for the steps it started to finish Matches #7385. * Revert "reflex-workflow: arm every conversation wait in one step that rereads first" This reverts commit 47588c9. * Revert "reflex-workflow: answer a message whose wake was refused while a held one ran" This reverts commit 16cf37e. * docs(workflows): bring the Workflows docs up to date with main - Stop registering the workflow base with rx.ModelRegistry.register. Since #7797 a registered base turns off detection of the app's other DeclarativeBase bases, so reflex db makemigrations would write a revision dropping their tables. Explain detection, when registering is needed, and point MappedAsDataclass bases (the database docs' default) at reflex_workflow.dataclass. Same fix in the package README. - Describe the held event being released once a worker takes it (#7396). - Document OpenTelemetry tracing of step attempts (#7635). - Require Python 3.11 (#7449), spell Cron's default zone as UTC, say wake waits for the work to run (#7382), and import rx in the wake example. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01ESN8DiahHo8P4FLFNr6fHK * docs(workflows): say which bases Reflex detects, and why registering drops others Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01ESN8DiahHo8P4FLFNr6fHK * docs(reflex-workflow): rewrap the README's Reflex setup paragraph Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01ESN8DiahHo8P4FLFNr6fHK --------- Co-authored-by: Masen Furer <[email protected]> Co-authored-by: Claude <[email protected]>
Type of change
Changes To Core Features
Description
Python 3.10 reaches end of life in October 2026, and Reflex has warned about it on import since 0.8.15 (#5868). This PR removes 3.10 support outright so 0.10.0 requires Python 3.11 or newer, rather than carrying the deprecation into 0.11.0.
Version floors and CI
requires-python = ">=3.11"in the root package and every workspace package, plus the docs and playground projects; the 3.10 classifier is removed.python:3.11.uv.lockis regenerated, which drops the 3.10-only resolution splits along withexceptiongroup,backports-asyncio-runnerand thetomlifallback dependency.Runtime shims removed
reflex/__init__.py, with its test and changelog fragment.tomli/tomllibfallbacks in reflex-release and the repo scripts.sys.version_infoguards aroundadd_note, the asynciocancelling()check in the redis lease lookup, the TypedDictNotRequiredworkaround in form validation, theget_type_hintsOptionalunwrapping in memo parameter analysis, theBaseExceptionGrouplookup throughbuiltins, and theForwardRefis_classbranch.Lint target
tool.ruff.target-versionmoves topy311and its fixes are applied:datetime.UTC,typingimports that no longer needtyping_extensions, theTimeoutErroralias, PEP 646*Tsunpacking, andfromisoformatparsingZnatively.ASYNC109andUP042are added to the ignore list with reasons: timeouts are explicit parameters of the testing and state-manager APIs, andStrEnumwould change how(str, Enum)members render instr()and f-strings.Docs and changelog
breakingnews fragment is added to every published package, since each one ships with the new floor..content-hashandpyi_hashes.jsonare regenerated.Test Plan
uv run ruff check .anduv run ruff format --check .pass.uv run pyright reflex testsand pyright over every changed package file report no errors.uv run pytest tests/units: 12217 passed, 180 skipped. The only failures are the bench browser-driver tests, which need a Playwright browser that is not installed in the sandbox and are unaffected by this change.uv lock --checkpasses against the regenerated lock, andreflex-release changelog-check --base-ref origin/mainreports fragments present for every affected package.<source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img alt="Turn on auto-fix" src="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg">