From cfa9286771873bb243af7d9ad6931b9becc83757 Mon Sep 17 00:00:00 2001 From: Haochen Pan Date: Mon, 23 Sep 2024 22:04:53 -0400 Subject: [PATCH 1/2] fix RemovedInV4Warning globus_sdk/services/auth/client/service_client.py:258: RemovedInV4Warning: The method `oauth2_userinfo` is deprecated. Use `userinfo` instead. --- diaspora_event_sdk/sdk/client.py | 2 +- diaspora_event_sdk/version.py | 2 +- tests/unit/client_test.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/diaspora_event_sdk/sdk/client.py b/diaspora_event_sdk/sdk/client.py index 741e611..0cb80de 100644 --- a/diaspora_event_sdk/sdk/client.py +++ b/diaspora_event_sdk/sdk/client.py @@ -31,7 +31,7 @@ def __init__( base_url=self.web_service_address ) self.auth_client = self.login_manager.get_auth_client() - self.subject_openid = self.auth_client.oauth2_userinfo()["sub"] + self.subject_openid = self.auth_client.userinfo()["sub"] def logout(self): """Remove credentials from your local system""" diff --git a/diaspora_event_sdk/version.py b/diaspora_event_sdk/version.py index a8d4557..d7b30e1 100644 --- a/diaspora_event_sdk/version.py +++ b/diaspora_event_sdk/version.py @@ -1 +1 @@ -__version__ = "0.3.5" +__version__ = "0.3.6" diff --git a/tests/unit/client_test.py b/tests/unit/client_test.py index 14abcf4..7bde0dd 100644 --- a/tests/unit/client_test.py +++ b/tests/unit/client_test.py @@ -11,7 +11,7 @@ def mock_login_manager(): # TODO login_manager = Mock(spec=LoginManager()) login_manager.get_web_client.return_value = Mock(spec=WebClient) login_manager.get_auth_client.return_value = Mock( - oauth2_userinfo=lambda: {"sub": "test_sub"} + userinfo=lambda: {"sub": "test_sub"} ) login_manager._token_storage.get_token_data.return_value = { "username": "test_sub", From 8cb01dc3b94985324fe119ca8d5ee27ae3915f8e Mon Sep 17 00:00:00 2001 From: Haochen Pan Date: Mon, 23 Sep 2024 23:27:43 -0400 Subject: [PATCH 2/2] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 23120d4..81bea77 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,7 +27,7 @@ repos: hooks: - id: nbstripout - repo: 'https://github.com/charliermarsh/ruff-pre-commit' - rev: v0.6.3 + rev: v0.6.7 hooks: - id: ruff args: