From 248b3ae3d436d054f38d2d178181f32242711fa4 Mon Sep 17 00:00:00 2001 From: Patrick Ogenstad Date: Thu, 3 Oct 2024 19:58:27 +0200 Subject: [PATCH] Remove deprecated .init() methods Fixes #33. --- changelog/33.removed.md | 1 + infrahub_sdk/client.py | 27 --------------------------- 2 files changed, 1 insertion(+), 27 deletions(-) create mode 100644 changelog/33.removed.md diff --git a/changelog/33.removed.md b/changelog/33.removed.md new file mode 100644 index 00000000..c1b747a3 --- /dev/null +++ b/changelog/33.removed.md @@ -0,0 +1 @@ +Removed depreceted methods InfrahubClient.init and InfrahubClientSync.init diff --git a/infrahub_sdk/client.py b/infrahub_sdk/client.py index 74f32d03..5bdc5e28 100644 --- a/infrahub_sdk/client.py +++ b/infrahub_sdk/client.py @@ -3,7 +3,6 @@ import asyncio import copy import logging -import warnings from functools import wraps from time import sleep from typing import TYPE_CHECKING, Any, Callable, Coroutine, MutableMapping, Optional, TypedDict, Union @@ -288,19 +287,6 @@ def _initialize(self) -> None: self._request_method: AsyncRequester = self.config.requester or self._default_request_method self.group_context = InfrahubGroupContext(self) - @classmethod - async def init( - cls, - address: str = "", - config: Optional[Union[Config, dict[str, Any]]] = None, - ) -> InfrahubClient: - warnings.warn( - "InfrahubClient.init has been deprecated and will be removed in Infrahub SDK 0.14.0 or the next major version", - DeprecationWarning, - stacklevel=1, - ) - return cls(address=address, config=config) - async def create( self, kind: str, @@ -1044,19 +1030,6 @@ def _initialize(self) -> None: self._request_method: SyncRequester = self.config.sync_requester or self._default_request_method self.group_context = InfrahubGroupContextSync(self) - @classmethod - def init( - cls, - address: str = "", - config: Optional[Union[Config, dict[str, Any]]] = None, - ) -> InfrahubClientSync: - warnings.warn( - "InfrahubClientSync.init has been deprecated and will be removed in Infrahub SDK 0.14.0 or the next major version", - DeprecationWarning, - stacklevel=1, - ) - return cls(address=address, config=config) - def create( self, kind: str,