Skip to content

Commit 8196153

Browse files
authored
Vb/capture python version sdk 40 (#1235)
2 parents 7358727 + 74b0264 commit 8196153

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

labelbox/client.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import mimetypes
99
import os
1010
import time
11+
import sys
1112
import urllib.parse
1213

1314
from google.api_core import retry
@@ -47,6 +48,12 @@
4748
_LABELBOX_API_KEY = "LABELBOX_API_KEY"
4849

4950

51+
def python_version_info():
52+
version_info = sys.version_info
53+
54+
return f"{version_info.major}.{version_info.minor}.{version_info.micro}-{version_info.releaselevel}"
55+
56+
5057
class Client:
5158
""" A Labelbox client.
5259
@@ -94,11 +101,13 @@ def __init__(self,
94101
self.app_url = app_url
95102
self.endpoint = endpoint
96103
self.rest_endpoint = rest_endpoint
104+
97105
self.headers = {
98106
'Accept': 'application/json',
99107
'Content-Type': 'application/json',
100108
'Authorization': 'Bearer %s' % api_key,
101-
'X-User-Agent': f'python-sdk {SDK_VERSION}'
109+
'X-User-Agent': f"python-sdk {SDK_VERSION}",
110+
'X-Python-Version': f"{python_version_info()}",
102111
}
103112
self._data_row_metadata_ontology = None
104113

0 commit comments

Comments
 (0)