Skip to content

Commit 540c693

Browse files
authored
refactor: revert to typing-extensions library (#333)
Revert to using the typing-extensions package since it performs the same logic introduced in the `_typing_extensions.py` module copied from Shiny. For example, here is the `Self` implementation in typing-extensions, which keys off of the python version to determine the correct import. https://github.com/python/typing_extensions/blob/main/src/typing_extensions.py#L2229-L2247
1 parent 4edb9f1 commit 540c693

File tree

6 files changed

+10
-47
lines changed

6 files changed

+10
-47
lines changed

src/posit/connect/_typing_extensions.py

Lines changed: 0 additions & 42 deletions
This file was deleted.

src/posit/connect/content.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
overload,
1616
)
1717

18+
from typing_extensions import NotRequired, Required, TypedDict, Unpack
19+
1820
from . import tasks
1921
from ._api import ApiDictEndpoint, JsonifiableDict
20-
from ._typing_extensions import NotRequired, Required, TypedDict, Unpack
2122
from .bundles import Bundles
2223
from .context import Context
2324
from .env import EnvVars

src/posit/connect/jobs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import posixpath
22
from typing import Any, Literal, Optional, overload
33

4-
from ._typing_extensions import NotRequired, Required, TypedDict, Unpack
4+
from typing_extensions import NotRequired, Required, TypedDict, Unpack
5+
56
from .context import Context
67
from .resources import Active, ActiveFinderMethods, ActiveSequence, Resource
78

src/posit/connect/oauth/oauth.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
from typing import Optional
44

5-
from .._typing_extensions import TypedDict
5+
from typing_extensions import TypedDict
6+
67
from ..resources import ResourceParameters, Resources
78
from .integrations import Integrations
89
from .sessions import Sessions

src/posit/connect/users.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
from typing import List, Literal
66

7+
from typing_extensions import NotRequired, Required, TypedDict, Unpack
8+
79
from . import me
8-
from ._typing_extensions import NotRequired, Required, TypedDict, Unpack
910
from .content import Content
1011
from .paginator import Paginator
1112
from .resources import Resource, ResourceParameters, Resources

src/posit/connect/vanities.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from typing import Callable, List, Optional
22

3-
from ._typing_extensions import NotRequired, Required, TypedDict, Unpack
3+
from typing_extensions import NotRequired, Required, TypedDict, Unpack
4+
45
from .errors import ClientError
56
from .resources import Resource, ResourceParameters, Resources
67

0 commit comments

Comments
 (0)