From f2f9a5f19630f0c4cd7309af371446dbb7aeaf4c Mon Sep 17 00:00:00 2001 From: Jonathon Ferrell Date: Wed, 20 Aug 2025 15:23:19 -0500 Subject: [PATCH 1/6] 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/6] 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/6] 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 From 9ef34f83b068e1731a77ea384bcaf0cc10857cc5 Mon Sep 17 00:00:00 2001 From: Jonathon Ferrell Date: Wed, 20 Aug 2025 19:18:38 -0500 Subject: [PATCH 4/6] Release v5.34.0 --- btrdb/version.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/btrdb/version.py b/btrdb/version.py index 38d4c2f..45d10db 100644 --- a/btrdb/version.py +++ b/btrdb/version.py @@ -15,7 +15,7 @@ ## Module Info ########################################################################## -__version_info__ = {"major": 5, "minor": 33, "micro": 0, "releaselevel": "final"} +__version_info__ = {"major": 5, "minor": 34, "micro": 0, "releaselevel": "final"} ########################################################################## ## Helper Functions diff --git a/pyproject.toml b/pyproject.toml index d2efe1d..8ae72c1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "btrdb" -version = "5.33.0" +version = "5.34.0" authors = [ {name="PingThingsIO", email="support@pingthings.io"}, ] From 97464a35f555debf42a51ceafa14bea294ab5ed4 Mon Sep 17 00:00:00 2001 From: Jonathon Ferrell Date: Thu, 21 Aug 2025 12:03:24 -0500 Subject: [PATCH 5/6] Release v5.34.1 --- btrdb/version.py | 2 +- pyproject.toml | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/btrdb/version.py b/btrdb/version.py index 45d10db..433a653 100644 --- a/btrdb/version.py +++ b/btrdb/version.py @@ -15,7 +15,7 @@ ## Module Info ########################################################################## -__version_info__ = {"major": 5, "minor": 34, "micro": 0, "releaselevel": "final"} +__version_info__ = {"major": 5, "minor": 34, "micro": 1, "releaselevel": "final"} ########################################################################## ## Helper Functions diff --git a/pyproject.toml b/pyproject.toml index 8ae72c1..1776fd5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "btrdb" -version = "5.34.0" +version = "5.34.1" authors = [ {name="PingThingsIO", email="support@pingthings.io"}, ] @@ -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.12" +requires-python = ">=3.7,<3.12" classifiers = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', @@ -24,6 +24,8 @@ classifiers = [ 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'Topic :: Database', 'Topic :: Software Development :: Libraries :: Python Modules', ] From 211afa26fa0979bb261b29411d89619542db51e6 Mon Sep 17 00:00:00 2001 From: Jonathon Ferrell Date: Thu, 21 Aug 2025 12:16:05 -0500 Subject: [PATCH 6/6] Actual fix --- btrdb/conn.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/btrdb/conn.py b/btrdb/conn.py index f6f75d1..72f7061 100644 --- a/btrdb/conn.py +++ b/btrdb/conn.py @@ -132,10 +132,15 @@ 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)) + version = "unknown" + try: + version = importlib.metadata.version("btrdb") + except: + pass metadata.append( ( "x-api-client", - "btrdbpy-" + importlib.metadata.version("btrdb"), + "btrdbpy-" + version, ) ) self.method = client_call_details.method