Skip to content

fix(typing): Correctly handle typing_extensions.TypeAliasType on typing-extensions>4.13.0 (fix #4088)#4089

Merged
provinzkraut merged 5 commits intomainfrom
fix-ta-new-type
Apr 6, 2025
Merged

fix(typing): Correctly handle typing_extensions.TypeAliasType on typing-extensions>4.13.0 (fix #4088)#4089
provinzkraut merged 5 commits intomainfrom
fix-ta-new-type

Conversation

@provinzkraut
Copy link
Copy Markdown
Member

@provinzkraut provinzkraut requested review from a team as code owners April 6, 2025 11:26
@github-actions github-actions bot added area/ci This PR involves changes to the CI/Infra size: small type/bug pr/internal labels Apr 6, 2025
@provinzkraut provinzkraut enabled auto-merge (squash) April 6, 2025 11:26
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.34%. Comparing base (8bcf051) to head (6049ef2).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4089   +/-   ##
=======================================
  Coverage   98.34%   98.34%           
=======================================
  Files         348      348           
  Lines       15829    15833    +4     
  Branches     1749     1749           
=======================================
+ Hits        15567    15571    +4     
  Misses        125      125           
  Partials      137      137           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2025

Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/4089

Copy link
Copy Markdown
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

optional: I would also test type keyword, it also creates a TypeAliasType object, but just to be sure.

@provinzkraut provinzkraut merged commit bf86f7e into main Apr 6, 2025
28 checks passed
@provinzkraut provinzkraut deleted the fix-ta-new-type branch April 6, 2025 11:59
@provinzkraut
Copy link
Copy Markdown
Member Author

Thanks!

optional: I would also test type keyword, it also creates a TypeAliasType object, but just to be sure.

We have a separate test case for that! :)

@pytest.mark.skipif(sys.version_info < (3, 12), reason="type keyword not available before 3.12")
def test_unwrap_type_alias_type_keyword() -> None:
ctx: dict[str, Any] = {}
exec("type IntAlias = int", ctx, None)
annotation = ctx["IntAlias"]
field_definition = FieldDefinition.from_annotation(annotation)
assert field_definition.is_type_alias_type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci This PR involves changes to the CI/Infra pr/internal size: small type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: tests/unit/test_typing.py::test_unwrap_type_alias_type_keyword fails with typing-extensions 4.13.0

2 participants