Skip to content

Commit

Permalink
Add deprecation warning for impending rename (#104)
Browse files Browse the repository at this point in the history
### Changelog

The `foxglove-data-platform` package has been renamed to
`foxglove-client`. Please migrate to `foxglove-client` to receive future
updates.

### Docs

foxglove/docs#271

### Description

Also added logging of existing deprecations.
  • Loading branch information
jtbandes authored May 21, 2024
1 parent 519d91b commit b003040
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions foxglove_data_platform/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import json
from typing import IO, Any, Dict, List, Optional, TypeVar, Union
import base64
import warnings

import arrow
import requests
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit b003040

Please sign in to comment.