-
-
Notifications
You must be signed in to change notification settings - Fork 783
Examples and tests for async support in SQLModel
#471
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
base: main
Are you sure you want to change the base?
Examples and tests for async support in SQLModel
#471
Conversation
squashed wip commits based on `docs_src/tutorial` Goals --------- convert to async as working examples ensure static typing with mypy passes
refactor: mypy issues with annotations refactor: simplify async session using SQLmodel to pass mypy use typdef Annotation see https://pydantic-docs.helpmanual.io/usage/schema/#typingannotated-fields
doc: TODO depend on PR435 refactor: simply session start
only addresses async tests, does not try to fix other tests use: `mypy docs_src\tutorial_async` and `mypy tests\test_async_tutorial`
pytest.asyncio dropped support for python 3.6 with version 0.17.0 (22-01-13) as Python 3.6 EOL (23 Dec 2021)
also references tests and major PR dependencies
|
📝 Docs preview for commit 1151d85 at: https://634df5df2d0196544d59a3e1--sqlmodel.netlify.app |
current pydantic 1.10.2 see pydantic/pydantic#4358 Fix imports indirectly from pydantic typing #4358
|
📝 Docs preview for commit 94527a6 at: https://634e048b16d79567f08bfacd--sqlmodel.netlify.app |
|
📝 Docs preview for commit 1846878 at: https://634e5720ac7f9d1fde6279d9--sqlmodel.netlify.app |
async tutorials not supported with mypy static type checking if python version before 3.9
|
📝 Docs preview for commit 5aed51e at: https://634e81e23c20c3463fe7cccb--sqlmodel.netlify.app |
flake8 not compatible with 22Oct1 release of importlib_metadata v5 see PyCQA/flake8#1701 set importlib_metadata to 4.13.0
|
📝 Docs preview for commit 6d00e2c at: https://634f09db47ba242e98b80f08--sqlmodel.netlify.app |
|
see comments regarding python < 3.9. I believe support for 3.6 should be retired. |
|
Great addition, any progress? |
|
This is a great feature, any progress? |
|
This pull request has a merge conflict that needs to be resolved. |
mypystatic analysis (see note below)mypy static test dependencies
The work done in #58 resolves the


mypystatic type analysis issues"AsyncSession" has incompatible type "SelectOfScalar[Hero]"with
mypy docs_src\tutorial_asyncbefore: #58after #58
Note the PR #435
This PR subclasses outstanding
sqlalchemydependencies and also provides some additional tutorial and pytest tests. I have not assessed those tutorials or tests, I have marked in each tutorial that this PR provides the TODO's to change on PR #435 or equivalent being merged, removing the requirement forsqlalchemyimportsNote on python < 3.9
Python 3.6 support should be retired even 3.7 is EOL 2021/12, have got a clean lint and test running for 3.7 but 3.6 required major dependency surgery on

pyproject.tomlthat looked like it was getting there until I ran intoThe dependency management for 3.6.15 that was working

Summary
I believe there is great value in the existing sync tutorials and so have proceeded with converting those to async tutorials as this provides a simple base for adding, extending and checking coverage