Skip to content

DM-51397 Update DB Session Handling and Typing for Py3.12 #182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: tickets/DM-51337/release
Choose a base branch
from

Conversation

tcjennings
Copy link
Contributor

@tcjennings tcjennings commented Jun 20, 2025

Where possible, use Python 3.12-style generic types. The largest area of impact is the migration away from "async_scoped_session" to "AsyncSession" in the database session dependency and the attendant migration away from a safir-provided sessionmaker.

Where reasonable, refactor inconsistent or incorrect use of TypeAliases. Where there is disagreement between pylance (VS Code) and mypy, endeavor to please both but favor mypy over pylance. In some cases, the new ty static type checker is used to help identify issues or as a tie-breaker (ha ha).

@tcjennings tcjennings changed the base branch from main to tickets/DM-51364/py312 June 20, 2025 16:28
- use py3.12 generic type for AnyAsynSession
- apply consistent type to uses of AsyncSession
- refactor typevar and typealias
@tcjennings tcjennings force-pushed the tickets/DM-51397/py312_types branch from e459dba to 83875e2 Compare June 20, 2025 16:38
@tcjennings tcjennings changed the title DM-51397 Update Typing for Py3.12 DM-51397 Update DB Session Handling and Typing for Py3.12 Jun 20, 2025
- Refactor typealiases in router wrapper module
- Remove "list" from spec_alias fields
- Refactor typing in test modules
- Update types in router tests
- remove default values for TypeAliases
@tcjennings tcjennings force-pushed the tickets/DM-51397/py312_types branch from 5e7423a to 2e21c32 Compare June 20, 2025 19:30
Base automatically changed from tickets/DM-51364/py312 to tickets/DM-51337/release June 23, 2025 16:47
@tcjennings tcjennings marked this pull request as ready for review June 23, 2025 19:26
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