Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,23 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: 3.8
cache: pipenv
- 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
- run: pipenv run python -m flake8 foxglove
- run: pipenv run python -m flake8 examples
- run: pipenv run python -m pytest
- run: pipenv run python -m build
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- run: uv sync --frozen --dev --python 3.8
- run: uv run black --check --diff --color .
- run: uv run pyright foxglove
- run: uv run python -m flake8 foxglove
- run: uv run python -m flake8 examples
- run: uv run python -m pytest
- run: uv run python -m build --installer uv

- name: Publish to TestPyPI
if: |
!github.event.pull_request.head.repo.fork &&
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository &&
github.actor != 'dependabot[bot]'
continue-on-error: true
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist
Expand Down
7 changes: 0 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,6 @@ ipython_config.py
# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

Expand Down
36 changes: 0 additions & 36 deletions Pipfile

This file was deleted.

747 changes: 0 additions & 747 deletions Pipfile.lock

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Examples of various client features can be found in the `examples` directory.
### Running Tests

```bash
pipenv install --dev
pipenv run python -m pytest
uv sync --dev
uv run python -m pytest
```

In addition to unit tests, all PRs that change behavior should also be tested against the Foxglove API.
Expand All @@ -33,7 +33,7 @@ Release numbering follows a major.minor.patch format, abbreviated as "X.Y.Z" bel

CI will build the package and publish to PyPI once tags are pushed, as described below.

1. Update the `version` in setup.cfg with the new version `X.Y.Z`
1. Update the `version` in pyproject.toml with the new version `X.Y.Z`
2. Draft a [release on GitHub](https://github.com/foxglove/foxglove-python/releases/new) and create a new tag `releases/vX.Y.Z`
3. Generate release notes, review, and publish the release

Expand Down
6 changes: 4 additions & 2 deletions foxglove/client/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import warnings
from enum import Enum
from io import BytesIO
from typing import IO, Any, Dict, List, Optional, TypeVar, Union
from typing import IO, Any, Dict, List, Optional, TypeVar, Union, cast

import arrow
import requests
Expand Down Expand Up @@ -174,7 +174,9 @@ def _download_response_with_progress(

def _iter_decoded_messages(response: requests.Response, decoder_factories):
try:
reader = make_reader(response.raw, decoder_factories=decoder_factories)
reader = make_reader(
cast(IO[bytes], response.raw), decoder_factories=decoder_factories
)
# messages from Foxglove are already in log-time order.
# specifying log_time_order=false allows us to skip a sort() in the MCAP library
# after all messages are loaded.
Expand Down
65 changes: 64 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,69 @@
[build-system]
requires = [
"setuptools>=42",
"setuptools>=61",
"wheel"
]
build-backend = "setuptools.build_meta"

[project]
name = "foxglove-client"
version = "0.19.2"
description = "Client library for the Foxglove API."
readme = "README.md"
requires-python = ">=3.7"
dependencies = [
"arrow",
"mcap>=1.1.0",
"requests",
"typing_extensions",
]
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]

[project.urls]
Homepage = "https://github.com/foxglove/foxglove-python"

[dependency-groups]
dev = [
"black",
"build",
"faker",
"flake8",
"flake8-bugbear",
"genmsg",
"genpy",
"mcap==1.1.0",
"mcap-protobuf-support==0.3.0",
"mcap-ros1-support==0.7.0",
"mcap-ros2-support==0.5.0",
"protobuf==4.24.2",
"pyright",
"pytest",
"responses",
"std_msgs",
]

[[tool.uv.index]]
name = "ros"
url = "https://rospypi.github.io/simple"
explicit = true

[tool.uv.sources]
"genmsg" = { index = "ros" }
"genpy" = { index = "ros" }
"std-msgs" = { index = "ros" }

[tool.black]
extend-exclude = ".*_pb2.py"

[tool.setuptools]
include-package-data = true

[tool.setuptools.packages.find]
include = ["foxglove*"]

[tool.setuptools.package-data]
foxglove = ["py.typed"]
27 changes: 0 additions & 27 deletions setup.cfg

This file was deleted.

Loading
Loading