From 0b84cff41063ead77a2588b62ab2d8c51bd68faa Mon Sep 17 00:00:00 2001 From: Kyungmin Lee Date: Fri, 22 Oct 2021 19:13:31 +0900 Subject: [PATCH 1/3] Turn off implicit-optional --- setup.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.cfg b/setup.cfg index 62798cb9..8d385c79 100644 --- a/setup.cfg +++ b/setup.cfg @@ -71,3 +71,4 @@ extend-ignore = E203, E501 python_version = 3.6 ignore_missing_imports = true warn_unused_ignores = true +no_implicit_optional = true \ No newline at end of file From 113ff3fb7a7fe6137227b8abb568481946f3d836 Mon Sep 17 00:00:00 2001 From: Kyungmin Lee Date: Fri, 22 Oct 2021 19:14:05 +0900 Subject: [PATCH 2/3] Change type annotations to use explicit optional According to PEP 484, implicit Optional is no longer recommended. --- jwt/api_jws.py | 8 ++++---- jwt/api_jwt.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/jwt/api_jws.py b/jwt/api_jws.py index f85072e0..9e8e1787 100644 --- a/jwt/api_jws.py +++ b/jwt/api_jws.py @@ -132,8 +132,8 @@ def decode_complete( self, jwt: str, key: str = "", - algorithms: List[str] = None, - options: Dict = None, + algorithms: Optional[List[str]] = None, + options: Optional[Dict] = None, **kwargs, ) -> Dict[str, Any]: if options is None: @@ -161,8 +161,8 @@ def decode( self, jwt: str, key: str = "", - algorithms: List[str] = None, - options: Dict = None, + algorithms: Optional[List[str]] = None, + options: Optional[Dict] = None, **kwargs, ) -> str: decoded = self.decode_complete(jwt, key, algorithms, options, **kwargs) diff --git a/jwt/api_jwt.py b/jwt/api_jwt.py index f3b55d36..c9d34a5f 100644 --- a/jwt/api_jwt.py +++ b/jwt/api_jwt.py @@ -66,8 +66,8 @@ def decode_complete( self, jwt: str, key: str = "", - algorithms: List[str] = None, - options: Dict = None, + algorithms: Optional[List[str]] = None, + options: Optional[Dict] = None, **kwargs, ) -> Dict[str, Any]: if options is None: @@ -112,8 +112,8 @@ def decode( self, jwt: str, key: str = "", - algorithms: List[str] = None, - options: Dict = None, + algorithms: Optional[List[str]] = None, + options: Optional[Dict] = None, **kwargs, ) -> Dict[str, Any]: decoded = self.decode_complete(jwt, key, algorithms, options, **kwargs) From ba0d522989e500087cc23a54aba51aca448c44a0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 22 Oct 2021 10:48:48 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 8d385c79..5e0b244c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -71,4 +71,4 @@ extend-ignore = E203, E501 python_version = 3.6 ignore_missing_imports = true warn_unused_ignores = true -no_implicit_optional = true \ No newline at end of file +no_implicit_optional = true