From b00304075785ac422dccaf304b1c54cf3366bdf8 Mon Sep 17 00:00:00 2001 From: Jacob Bandes-Storch Date: Mon, 20 May 2024 20:36:33 -0700 Subject: [PATCH] Add deprecation warning for impending rename (#104) ### Changelog The `foxglove-data-platform` package has been renamed to `foxglove-client`. Please migrate to `foxglove-client` to receive future updates. ### Docs https://github.com/foxglove/docs/pull/271 ### Description Also added logging of existing deprecations. --- foxglove_data_platform/client.py | 11 +++++++++++ setup.cfg | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/foxglove_data_platform/client.py b/foxglove_data_platform/client.py index 94500cc..23daf88 100644 --- a/foxglove_data_platform/client.py +++ b/foxglove_data_platform/client.py @@ -6,6 +6,7 @@ import json from typing import IO, Any, Dict, List, Optional, TypeVar, Union import base64 +import warnings import arrow import requests @@ -165,6 +166,11 @@ def _download_stream_with_progress( class Client: def __init__(self, token: str, host: str = "api.foxglove.dev"): + warnings.warn( + "The `foxglove-data-platform` package has been renamed to `foxglove-client`." + + " Please migrate to `foxglove-client` to receive future updates.", + DeprecationWarning, + ) self.__token = token self.__headers = { "Content-type": "application/json", @@ -303,6 +309,7 @@ def get_messages( decoder_factories: an optional list of :py:class:`~mcap.decoder.DecoderFactory` instances used to decode message content. """ + warnings.warn("Use `iter_messages` instead.", DeprecationWarning) data = self.download_data( device_name=device_name, device_id=device_id, @@ -638,6 +645,10 @@ def delete_import(self, *, device_id: Optional[str] = None, import_id: str): :param device_id: The id of the device associated with the import. (Deprecated; ignored.) :param import_id: The id of the import to delete. """ + if device_id is not None: + warnings.warn( + "The `device_id` parameter is deprecated.", DeprecationWarning + ) response = requests.delete( self.__url__(f"/v1/data/imports/{import_id}"), headers=self.__headers, diff --git a/setup.cfg b/setup.cfg index fd1615f..e2519fb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = foxglove-data-platform -version = 0.14.1 +version = 0.14.2 description = Client library for Foxglove Data Platform. long_description = file: README.md long_description_content_type = text/markdown