Skip to content

Prep 3.77.1 #1783

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
project = 'Python SDK reference'
copyright = '2024, Labelbox'
author = 'Labelbox'
release = '3.77.0'
release = '3.77.1'

# -- General configuration ---------------------------------------------------

Expand Down
4 changes: 4 additions & 0 deletions libs/labelbox/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Changelog
# Version 3.77.1 (2024-08-28)
## Fixed
* Restore client.headers([#1781](https://github.com/Labelbox/labelbox-python/pull/1781))

# Version 3.77.0 (2024-08-09)
## Added
* LabelingService request()([#1761](https://github.com/Labelbox/labelbox-python/pull/1761))
Expand Down
2 changes: 1 addition & 1 deletion libs/labelbox/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "labelbox"
version = "3.77.0"
version = "3.77.1"
description = "Labelbox Python API"
authors = [{ name = "Labelbox", email = "engineering@labelbox.com" }]
dependencies = [
Expand Down
2 changes: 1 addition & 1 deletion libs/labelbox/src/labelbox/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "labelbox"

__version__ = "3.77.0"
__version__ = "3.77.1"

from labelbox.client import Client
from labelbox.schema.project import Project
Expand Down
7 changes: 6 additions & 1 deletion libs/labelbox/src/labelbox/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
import urllib.parse
from collections import defaultdict
from datetime import datetime, timezone
from typing import Any, List, Dict, Union, Optional, overload
from typing import Any, List, Dict, Union, Optional, overload, Callable
from types import MappingProxyType

import requests
import requests.exceptions
Expand Down Expand Up @@ -126,6 +127,10 @@ def _init_connection(self) -> requests.Session:

return connection

@property
def headers(self) -> MappingProxyType:
return self._connection.headers

def _default_headers(self):
return {
'Authorization': 'Bearer %s' % self.api_key,
Expand Down
15 changes: 15 additions & 0 deletions libs/labelbox/tests/unit/test_client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import os

from unittest.mock import patch

from labelbox.client import Client


# @patch.dict(os.environ, {'LABELBOX_API_KEY': 'bar'})
def test_headers():
client = Client(api_key="api_key", endpoint="http://localhost:8080/_gql")
assert client.headers
assert client.headers["Authorization"] == "Bearer api_key"
assert client.headers["Content-Type"] == "application/json"
assert client.headers["User-Agent"]
assert client.headers["X-Python-Version"]
Loading