From f2f9a5f19630f0c4cd7309af371446dbb7aeaf4c Mon Sep 17 00:00:00 2001 From: Jonathon Ferrell Date: Wed, 20 Aug 2025 15:23:19 -0500 Subject: [PATCH 1/3] Updated old api for new metadata changes --- btrdb/conn.py | 7 +++++++ pyproject.toml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/btrdb/conn.py b/btrdb/conn.py index 0e9b5fc..4bdf99e 100644 --- a/btrdb/conn.py +++ b/btrdb/conn.py @@ -17,6 +17,7 @@ import json import logging +import importlib.metadata import os import re import uuid as uuidlib @@ -65,6 +66,11 @@ def __init__(self, addrportstr, apikey=None): The ``btrdb.connect`` method is a helper function to make connecting to the platform easier usually that will be sufficient for most users. """ + warn( + "This API is deprecated in favor of the pingthings_api, refer to your hub landing page for further documentation.", + DeprecationWarning, + stacklevel=2, + ) addrport = addrportstr.split(":", 2) # 100MB size limit ~ 2500 streams for 5000 points with each point being 64bit # 500MB size limit ~ 13K streams for 5000 points @@ -126,6 +132,7 @@ def __init__(self, apikey, client_call_details): if client_call_details.metadata is not None: metadata = list(client_call_details.metadata) metadata.append(("authorization", "Bearer " + apikey)) + metadata.append(("x-api-client", "btrdbpy-" + importlib.metadata.version("btrdb"))) self.method = client_call_details.method self.timeout = client_call_details.timeout self.credentials = client_call_details.credentials diff --git a/pyproject.toml b/pyproject.toml index b3aee86..d2efe1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ maintainers = [ description = "Bindings to interact with the Berkeley Tree Database using gRPC." readme = "README.md" license = {file="LICENSE.txt"} -requires-python = ">=3.7,<=3.10" +requires-python = ">=3.7,<=3.12" classifiers = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', From 12afdd8d2eea794a1d2d3f9b694cef4b47f9f3eb Mon Sep 17 00:00:00 2001 From: Justin Gilmer <16173348+justinGilmer@users.noreply.github.com> Date: Wed, 20 Aug 2025 18:24:57 -0400 Subject: [PATCH 2/3] Update pre-commit.yaml precommit has changed to v3, needed to update --- .github/workflows/pre-commit.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index 2717add..cf5dc26 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -34,6 +34,6 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} - name: Run pre-commit - uses: pre-commit/action@v2.0.3 + uses: pre-commit/action@v3.0.1 with: extra_args: --files ${{ steps.changed-files.outputs.all_changed_files }} From 8f237b71d95c34e49ac89492c6b051f9a60d7654 Mon Sep 17 00:00:00 2001 From: Jonathon Ferrell Date: Wed, 20 Aug 2025 17:31:12 -0500 Subject: [PATCH 3/3] formatting --- btrdb/conn.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/btrdb/conn.py b/btrdb/conn.py index 4bdf99e..f6f75d1 100644 --- a/btrdb/conn.py +++ b/btrdb/conn.py @@ -15,9 +15,9 @@ ## Imports ########################################################################## +import importlib.metadata import json import logging -import importlib.metadata import os import re import uuid as uuidlib @@ -132,7 +132,12 @@ def __init__(self, apikey, client_call_details): if client_call_details.metadata is not None: metadata = list(client_call_details.metadata) metadata.append(("authorization", "Bearer " + apikey)) - metadata.append(("x-api-client", "btrdbpy-" + importlib.metadata.version("btrdb"))) + metadata.append( + ( + "x-api-client", + "btrdbpy-" + importlib.metadata.version("btrdb"), + ) + ) self.method = client_call_details.method self.timeout = client_call_details.timeout self.credentials = client_call_details.credentials