Skip to content

Conversation

@auphofBSF
Copy link

@auphofBSF auphofBSF commented Oct 18, 2022

  • (2✅ of 15⏹️ ) asyncio Tutorials matching sync Tutorials.
  • (2✅ of 15⏹️ ) pytest asyncio tutorial tests
  • ✅above tests and tutorials passing mypy static analysis (see note below)

mypy static test dependencies

The work done in #58 resolves the mypy static type analysis issues "AsyncSession" has incompatible type "SelectOfScalar[Hero]"
with mypy docs_src\tutorial_async before: #58
image
after #58
image

Note the PR #435

This PR subclasses outstanding sqlalchemy dependencies 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 for sqlalchemy imports

Note 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.toml that looked like it was getting there until I ran into
image

The dependency management for 3.6.15 that was working
image

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

SLLau added 9 commits October 18, 2022 11:52
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
@github-actions
Copy link
Contributor

📝 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
@github-actions
Copy link
Contributor

📝 Docs preview for commit 94527a6 at: https://634e048b16d79567f08bfacd--sqlmodel.netlify.app

@codecov
Copy link

codecov bot commented Oct 18, 2022

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
...ect_async/create_tables_async/tutorial001_async.py 100.00% <100.00%> (ø)
...nc/connect_async/delete_async/tutorial001_async.py 100.00% <100.00%> (ø)
...nc/connect_async/insert_async/tutorial001_async.py 100.00% <100.00%> (ø)
...nc/connect_async/select_async/tutorial001_async.py 100.00% <100.00%> (ø)
...nc/connect_async/select_async/tutorial002_async.py 100.00% <100.00%> (ø)
...nc/connect_async/select_async/tutorial003_async.py 100.00% <100.00%> (ø)
...nc/connect_async/select_async/tutorial004_async.py 100.00% <100.00%> (ø)
...nc/connect_async/select_async/tutorial005_async.py 100.00% <100.00%> (ø)
...nc/connect_async/update_async/tutorial001_async.py 100.00% <100.00%> (ø)
...c/tutorial_async/select_async/tutorial001_async.py 100.00% <100.00%> (ø)
... and 13 more

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Contributor

📝 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
@github-actions
Copy link
Contributor

📝 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
@github-actions
Copy link
Contributor

📝 Docs preview for commit 6d00e2c at: https://634f09db47ba242e98b80f08--sqlmodel.netlify.app

@auphofBSF
Copy link
Author

see comments regarding python < 3.9. I believe support for 3.6 should be retired.

@LulzLoL231
Copy link

Great addition, any progress?

@tiangolo tiangolo added the docs Improvements or additions to documentation label Oct 22, 2023
@hakan-77
Copy link

This is a great feature, any progress?

@tiangolo

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2025

This pull request has a merge conflict that needs to be resolved.

@github-actions github-actions bot added the conflicts Automatically generated when a PR has a merge conflict label Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicts Automatically generated when a PR has a merge conflict docs Improvements or additions to documentation investigate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants