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
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ install_requires =
httpx>=0.26.0,<0.29.0
validators>=0.34.0,<1.0.0
authlib>=1.6.7,<2.0.0
# When bumping authlib to >=2.0.0, remove the `authlib.jose` deprecation
# warning filter implemented in `weaviate/_authlib_compat.py`.
pydantic>=2.12.0,<3.0.0
grpcio>=1.59.5,<1.80.0
protobuf>=4.21.6,<7.0.0
Expand Down
2 changes: 2 additions & 0 deletions weaviate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from importlib.metadata import PackageNotFoundError, version
from typing import Any

from . import _authlib_compat # noqa: F401 # side-effect: silence authlib.jose deprecation

Comment thread
dirkkul marked this conversation as resolved.
try:
__version__ = version("weaviate-client")
except PackageNotFoundError:
Expand Down
18 changes: 18 additions & 0 deletions weaviate/_authlib_compat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""Suppress the ``authlib.jose`` deprecation warning emitted by authlib >=1.7.0.

authlib registers ``simplefilter("always", AuthlibDeprecationWarning)`` at import time,
so we must import the category first to insert our filter in front of it.

Remove this module (and its import in ``weaviate/__init__.py``) once the ``authlib``
pin in ``setup.cfg`` moves to ``>=2.0.0``.
"""

import warnings

from authlib.deprecate import AuthlibDeprecationWarning

warnings.filterwarnings(
"ignore",
message=r"^authlib\.jose module is deprecated",
category=AuthlibDeprecationWarning,
)
Loading