diff --git a/pymemri/pod/api.py b/pymemri/pod/api.py index b1bba12c500dbc9d459227aa255fa2663242f2a7..277bc03bf17f752ad1795cec20a946bcbe17887c 100644 --- a/pymemri/pod/api.py +++ b/pymemri/pod/api.py @@ -224,19 +224,19 @@ class PodAPI: def oauth2get_access_token( self, platform: str, - ) -> Any: + ) -> Dict: return self.post( "oauth2/access_token", {"platform": platform}, ).json() - def oauth2authorize(self, *, platform: str, code: str, redirect_uri: str) -> Any: + def oauth2authorize(self, *, platform: str, code: str, redirect_uri: str) -> Dict[str, str]: return self.post( "oauth2/authorize", {"platform": platform, "authCode": code, "redirectUri": redirect_uri}, ).json() - def oauth2get_authorization_url(self, platform: str, scopes: str, redirect_uri: str) -> Any: + def oauth2get_authorization_url(self, platform: str, scopes: str, redirect_uri: str) -> Dict: return self.post( "oauth2/auth_url", { diff --git a/pymemri/pod/client.py b/pymemri/pod/client.py index 5d9eff9595bdd20e80de16c434c450377341b70b..6c5eb06efaca7a726f0665581309eb3bd0297616 100644 --- a/pymemri/pod/client.py +++ b/pymemri/pod/client.py @@ -6,6 +6,7 @@ from typing import Any, Dict, List, Optional, Type, TypeVar, Union import numpy as np from loguru import logger +from typing_extensions import Unpack from pymemri.data.schema.itembase import ItemBase @@ -117,7 +118,7 @@ class PodClient: return self._upload_image(photo.data, asyncFlag=asyncFlag) - def add_to_schema(self, *items: List[Union[object, type]]): + def add_to_schema(self, *items: Unpack[Union[Type[ItemBase], ItemBase]]): create_items = [] for item in items: if not (isinstance(item, ItemBase) or issubclass(item, ItemBase)): @@ -628,7 +629,7 @@ class PodClient: oauth_token_secret=oauth_token_secret, ) - def oauth2_authorize(self, *, platform, code, redirect_uri): + def oauth2_authorize(self, *, platform, code, redirect_uri) -> str: try: return self.api.oauth2authorize( code=code, platform=platform, redirect_uri=redirect_uri @@ -637,7 +638,7 @@ class PodClient: logger.error(e) return None - def get_oauth2_authorization_url(self, platform, scopes, redirect_uri): + def get_oauth2_authorization_url(self, platform, scopes, redirect_uri) -> str: try: return self.api.oauth2get_authorization_url(platform, scopes, redirect_uri) except PodError as e: diff --git a/pymemri/py.typed b/pymemri/py.typed new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/setup.cfg b/setup.cfg index c9a3759e7f5c3ca4cc9cecc83cab0357a94fbada..80faa8d3d9264c00603ff9a7fc9e2d87c2f2c1c5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -53,3 +53,6 @@ console_scripts = plugin_from_template = pymemri.template.formatter:plugin_from_template create_plugin_config = pymemri.template.config:create_plugin_config simulate_oauth1_flow = pymemri.plugin.cli:simulate_oauth1_flow + +[options.package_data] +{name} = py.typed \ No newline at end of file