Skip to content

Commit 2f0c8a7

Browse files
fix: Fix star import from typeapi (#39)
* fix: Fix star import from `typeapi` * black fmt * fix fmt
1 parent 5bc42f1 commit 2f0c8a7

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

.changelog/_unreleased.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[[entries]]
2+
id = "0285c33d-85e6-4d72-bf09-7f8812b75e36"
3+
type = "fix"
4+
description = "Fix star import from `typeapi`"
5+
author = "@NiklasRosenstein"

src/typeapi/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
from .typehint import (
44
AnnotatedTypeHint,
55
ClassTypeHint,
6+
ClassVarTypeHint,
67
ForwardRefTypeHint,
78
LiteralTypeHint,
89
TupleTypeHint,
10+
TypeAliasTypeHint,
911
TypeHint,
1012
TypeVarTypeHint,
1113
UnionTypeHint,

src/typeapi/__init___test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def test_import() -> None:
2+
exec("from typeapi import *")

src/typeapi/utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ def get_type_hint_origin_or_none(hint: object) -> "Any | None":
5252
and hasattr(hint, "__orig_bases__")
5353
and getattr(hint, "__module__", None) in TYPING_MODULE_NAMES
5454
):
55-
5655
if hint.__name__ == "Annotated" and hint.__args__: # type: ignore
5756
from typing_extensions import Annotated
5857

src/typeapi/utils_test.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626

2727
def test__typing_List__introspection():
28-
2928
# Origin:
3029

3130
if sys.version_info[:2] <= (3, 6):
@@ -99,7 +98,6 @@ def test__typing_Collection__origin():
9998
],
10099
)
101100
def test__mapping_types__introspection(hint: object, origin_type: type, mutable: bool):
102-
103101
# Origin:
104102

105103
if sys.version_info[:2] <= (3, 6):
@@ -242,7 +240,6 @@ class SubGeneric(MyGeneric[T], AnotherGeneric[int], int):
242240
argvalues=[(typing_extensions.Annotated,)] + ([(t.Annotated,)] if hasattr(t, "Annotated") else []),
243241
)
244242
def test__typing_Annotated__introspection(Annotated):
245-
246243
# Origin:
247244

248245
if sys.version_info[:2] <= (3, 6):
@@ -289,7 +286,6 @@ def test__typing_Annotated__introspection(Annotated):
289286

290287

291288
def test__typing_Union__introspection():
292-
293289
# Origin:
294290

295291
if sys.version_info[:2] <= (3, 6):
@@ -328,7 +324,6 @@ def test__typing_Union__introspection():
328324
argnames=["Literal"], argvalues=[(typing_extensions.Literal,)] + ([(t.Literal,)] if hasattr(t, "Literal") else [])
329325
)
330326
def test__typing_Literal__introspection(Literal):
331-
332327
# Origin:
333328

334329
if sys.version_info[:2] <= (3, 6):
@@ -365,7 +360,6 @@ def test__typing_Literal__introspection(Literal):
365360

366361

367362
def test__typing_Any__introspection():
368-
369363
# Origin:
370364

371365
assert not hasattr(Any, "__origin__")
@@ -380,7 +374,6 @@ def test__typing_Any__introspection():
380374

381375

382376
def test__TypeVar__introspection():
383-
384377
# Origin:
385378

386379
assert not hasattr(T, "__origin__")

0 commit comments

Comments
 (0)