Skip to content
Merged
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
* Comparing a Labelbox object (e.g. Project) to None doesn't raise an exception
* Adding `order_by` to `Project.labels` doesn't raise an exception

## Version 2.4.10 (2021-01-05)
### Added
* SDK version added to request headers

## Version 2.4.9 (2020-11-09)
### Fix
* 2.4.8 was broken for > Python 3.6
Expand Down
3 changes: 2 additions & 1 deletion labelbox/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name = "labelbox"
__version__ = "2.4.10"

from labelbox.client import Client
from labelbox.schema.bulk_import_request import BulkImportRequest
Expand All @@ -14,4 +15,4 @@
from labelbox.schema.asset_metadata import AssetMetadata
from labelbox.schema.webhook import Webhook
from labelbox.schema.prediction import Prediction, PredictionModel
from labelbox.schema.ontology import Ontology
from labelbox.schema.ontology import Ontology
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: pls configure editor to add blank lines on save:)

4 changes: 3 additions & 1 deletion labelbox/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from labelbox.schema.user import User
from labelbox.schema.organization import Organization
from labelbox.schema.labeling_frontend import LabelingFrontend
from labelbox import __version__ as SDK_VERSION

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -66,7 +67,8 @@ def __init__(self,
self.headers = {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer %s' % api_key
'Authorization': 'Bearer %s' % api_key,
'X-User-Agent': f'python-sdk {SDK_VERSION}'
}

@retry.Retry(predicate=retry.if_exception_type(
Expand Down
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import setuptools

with open('labelbox/__init__.py') as fid:
for line in fid:
if line.startswith('__version__'):
SDK_VERSION = line.strip().split()[-1][1:-1]
break

with open("README.md", "r") as fh:
long_description = fh.read()

setuptools.setup(
name="labelbox",
version="2.4.9",
version=SDK_VERSION,
author="Labelbox",
author_email="engineering@labelbox.com",
description="Labelbox Python API",
Expand Down