Skip to content

Commit

Permalink
Rename package to foxglove-client, bump version to 0.15.0 (#105)
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

This can merge after
#104 is published (or
even before?)
  • Loading branch information
jtbandes authored May 21, 2024
1 parent b003040 commit 9b16372
Show file tree
Hide file tree
Showing 23 changed files with 29 additions and 32 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
- run: pip install pipenv==2022.12.19
- run: pipenv install --dev --deploy
- run: pipenv run black --check --diff --color --exclude '.*_pb2.py' .
- run: pipenv run pyright foxglove_data_platform
- run: pipenv run python -m flake8 foxglove_data_platform
- run: pipenv run pyright foxglove
- run: pipenv run python -m flake8 foxglove
- run: pipenv run python -m pytest
- run: pipenv run python -m build

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ This library provides a convenient python client for [Foxglove](https://foxglove

In order to use the client you will first have to create an API token for your organization on your organization's [settings page](https://app.foxglove.dev/~/settings).

Read more about the API in the [Foxglove API Docs](https://docs.foxglove.dev/api/).

## Sample Usage

Examples of various client features can be found in the `examples` directory.
Expand Down
2 changes: 1 addition & 1 deletion examples/downloading_data.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import datetime
from datetime import datetime, timedelta

from foxglove_data_platform.client import Client
from foxglove.client import Client

token = "<YOUR API TOKEN HERE>"
device_id = "<YOUR DEVICE ID>"
Expand Down
2 changes: 1 addition & 1 deletion examples/events.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from datetime import datetime

from foxglove_data_platform.client import Client
from foxglove.client import Client

token = "<YOUR API TOKEN>"
device_id = "<YOUR DEVICE ID>"
Expand Down
2 changes: 1 addition & 1 deletion examples/fetching_messages.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import datetime
from datetime import datetime, timedelta

from foxglove_data_platform.client import Client
from foxglove.client import Client

token = "<YOUR API TOKEN HERE>"
device_id = "<YOUR DEVICE ID>"
Expand Down
2 changes: 1 addition & 1 deletion examples/uploading_data.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pathlib import Path

from foxglove_data_platform.client import Client
from foxglove.client import Client

token = "<YOUR API TOKEN HERE>"
device_id = "<YOUR DEVICE ID>"
Expand Down
File renamed without changes.
5 changes: 0 additions & 5 deletions foxglove_data_platform/client.py → foxglove/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,6 @@ 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
File renamed without changes.
10 changes: 5 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[metadata]
name = foxglove-data-platform
version = 0.14.2
description = Client library for Foxglove Data Platform.
name = foxglove-client
version = 0.15.0
description = Client library for the Foxglove API.
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/foxglove/py-data-platform
url = https://github.com/foxglove/foxglove-python
classifiers =
Programming Language :: Python :: 3
License :: OSI Approved :: MIT License
Expand All @@ -21,4 +21,4 @@ packages = find:
python_requires = >=3.7

[options.package_data]
foxglove_data_platform = py.typed
foxglove = py.typed
2 changes: 1 addition & 1 deletion tests/test_attachments.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import responses
from faker import Faker
from foxglove_data_platform.client import Client
from foxglove.client import Client
from datetime import datetime
from dateutil.tz import tzoffset

Expand Down
2 changes: 1 addition & 1 deletion tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest
import responses
from faker import Faker
from foxglove_data_platform.client import Client, camelize
from foxglove.client import Client, camelize
from requests.exceptions import RequestException

from .api_url import api_url
Expand Down
2 changes: 1 addition & 1 deletion tests/test_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import responses
from faker import Faker
from foxglove_data_platform.client import Client
from foxglove.client import Client

from .api_url import api_url

Expand Down
2 changes: 1 addition & 1 deletion tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import responses
from faker import Faker
from foxglove_data_platform.client import Client
from foxglove.client import Client
from responses.matchers import json_params_matcher

from .api_url import api_url
Expand Down
2 changes: 1 addition & 1 deletion tests/test_devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import responses
from faker import Faker
from foxglove_data_platform.client import Client
from foxglove.client import Client
from responses.matchers import json_params_matcher

from .api_url import api_url
Expand Down
2 changes: 1 addition & 1 deletion tests/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import responses
from faker import Faker
from foxglove_data_platform.client import Client
from foxglove.client import Client
from responses.matchers import json_params_matcher

from .api_url import api_url
Expand Down
2 changes: 1 addition & 1 deletion tests/test_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import responses
from faker import Faker
from foxglove_data_platform.client import Client
from foxglove.client import Client

from .api_url import api_url

Expand Down
2 changes: 1 addition & 1 deletion tests/test_json_messages.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from datetime import datetime
from unittest.mock import MagicMock

from foxglove_data_platform.client import Client
from foxglove.client import Client

from .generate import generate_json_data

Expand Down
4 changes: 2 additions & 2 deletions tests/test_protobuf_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

import pytest

from foxglove_data_platform.client import Client
from foxglove.client import Client

from .generate import generate_protobuf_data


def test_download_without_decoder():
with patch("foxglove_data_platform.client.DEFAULT_DECODER_FACTORIES", []):
with patch("foxglove.client.DEFAULT_DECODER_FACTORIES", []):
client = Client("test")
client.download_data = MagicMock(return_value=generate_protobuf_data())
with pytest.raises(Exception):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_recordings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import responses
from faker import Faker
from foxglove_data_platform.client import Client
from foxglove.client import Client

from .api_url import api_url

Expand Down
4 changes: 2 additions & 2 deletions tests/test_ros1_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

import pytest

from foxglove_data_platform.client import Client
from foxglove.client import Client

from .generate import generate_ros1_data


def test_download_without_decoder():
with patch("foxglove_data_platform.client.DEFAULT_DECODER_FACTORIES", []):
with patch("foxglove.client.DEFAULT_DECODER_FACTORIES", []):
client = Client("test")
client.download_data = MagicMock()
client.download_data.return_value = generate_ros1_data()
Expand Down
4 changes: 2 additions & 2 deletions tests/test_ros2_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

import pytest

from foxglove_data_platform.client import Client
from foxglove.client import Client

from .generate import generate_ros2_data


def test_download_without_decoder():
with patch("foxglove_data_platform.client.DEFAULT_DECODER_FACTORIES", []):
with patch("foxglove.client.DEFAULT_DECODER_FACTORIES", []):
client = Client("test")
client.download_data = MagicMock()
client.download_data.return_value = generate_ros2_data()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_stream_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from mcap.records import Schema, Channel, Message

from foxglove_data_platform.client import Client
from foxglove.client import Client

from .generate import generate_json_data

Expand Down

0 comments on commit 9b16372

Please sign in to comment.