Upgrade dev tooling and fix docstring style
Merged
MA
3mo ago+207+207+012345678901234567890123456789-168-168-012345678901234567890123456789
Type of change
- Bug fix (non-breaking change which fixes an issue)
Changes To Core Features:
- Have you added an explanation of what your changes do and why you'd like us to include them?
Description
This PR upgrades locked dev tooling and addresses linting issues introduced by the new versions:
Tooling upgrades:
ruff0.15.12 → 0.16.2pyright1.1.408 → 1.1.411typer0.25.1 → 0.27.1
Key changes:
-
Property docstring style (ruff D421): Updated all property docstrings from imperative form ("Get the ...", "Return the ...") to noun phrases ("The ..."). This applies across:
reflex/app.pyreflex/compiler/compiler.pyreflex/experimental/client_state.pyreflex/istate/packages/reflex-base/src/reflex_base/(vars, event, config, registry, plugins)packages/reflex-components-core/src/reflex_components_core/packages/reflex-docgen/src/reflex_docgen/packages/reflex-components-internal/src/reflex_components_internal/
-
Type safety improvements:
- Added
cast()calls inreflex/compiler/compiler.pyandreflex/reflex.pyfor untypedlibsassandtyperAPIs - Fixed type annotation in
packages/reflex-base/src/reflex_base/vars/base.pyfordefault_valuewith explanatory comment - Removed redundant
EventSpecimport from TYPE_CHECKING block inpackages/reflex-base/src/reflex_base/event/processor/base_state_processor.py - Changed
chain_updates()parameter type fromEventSpec | list[EventSpec] | NonetoAnywith updated docstring explaining runtime validation
- Added
-
Code quality fixes:
- Simplified condition in
packages/reflex-base/src/reflex_base/utils/types.py(removed redundantcls is not Nonecheck) - Fixed import organization in
packages/reflex-base/src/reflex_base/vars/datetime.py(movedImportVarto correct location) - Improved control flow in
packages/reflex-base/src/reflex_base/vars/dep_tracking.py(split compound condition for clarity)
- Simplified condition in
-
Test infrastructure:
- Created
tests/units/reflex_cli/v2/utils.pywithas_click_command()helper to reduce duplication across CLI tests - Updated all CLI test files to use the new helper
- Removed redundant
scope="function"parameter frompytest_asyncio.fixturedecorators (already set byloop_scope)
- Created
-
Linting configuration:
- Added
ASYNC119to ignore list (background event handlers holdasync with selfacrossyieldby design) - Added
RUF075to ignore list (state managers deliberately skip write-back whenwithbody raises) - Added
RUF105andRUF201to ignore list (preservenoqacomment readability)
- Added
Test Plan
Existing unit tests pass. The changes are primarily:
- Docstring style updates (no functional impact)
- Type annotations and casts for better type checking
- Test infrastructure refactoring (DRY principle)
- Linting configuration updates
All changes maintain backward compatibility and improve code quality without altering runtime behavior.