diff --git a/README.rst b/README.rst index a66eeb41c..5bcc2a759 100644 --- a/README.rst +++ b/README.rst @@ -23,6 +23,15 @@ The client is tested for python 3.8 and higher. Visit the official `Weaviate `_ website for more information about the Weaviate and how to use it in production. +Client Versions +--------------- +We currently support the following versions client versions: + +- 4.X: actively supported +- 3.X: deprecated, receives only critical bug fixes and dependency updates +- copy of the 3.X branch in v4 releases: Will be removed on 2024-11-30 + + Articles -------- @@ -32,7 +41,6 @@ Here are some articles on Weaviate: - `Getting Started with Weaviate Python Library `_ - `A sub-50ms neural search with DistilBERT and Weaviate `_ - Documentation ------------- diff --git a/weaviate/client.py b/weaviate/client.py index 39269e3df..960607fac 100644 --- a/weaviate/client.py +++ b/weaviate/client.py @@ -7,23 +7,22 @@ from httpx import HTTPError as HttpxError from requests.exceptions import ConnectionError as RequestsConnectionError +from typing_extensions import deprecated +from weaviate import syncify from weaviate.backup.backup import _BackupAsync from weaviate.backup.sync import _Backup - - -from weaviate import syncify +from weaviate.event_loop import _EventLoopSingleton, _EventLoop from .auth import AuthCredentials from .backup import Backup from .batch import Batch from .classification import Classification - from .client_base import _WeaviateClientBase from .cluster import Cluster -from .collections.collections.async_ import _CollectionsAsync -from .collections.collections.sync import _Collections from .collections.batch.client import _BatchClientWrapper from .collections.cluster import _Cluster, _ClusterAsync +from .collections.collections.async_ import _CollectionsAsync +from .collections.collections.sync import _Collections from .config import AdditionalConfig, Config from .connect import Connection from .connect.base import ( @@ -40,7 +39,6 @@ ) from .gql import Query from .schema import Schema -from weaviate.event_loop import _EventLoopSingleton, _EventLoop from .types import NUMBER from .util import _get_valid_timeout_config, _type_request_response from .warnings import _Warnings @@ -175,6 +173,17 @@ async def __aexit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> None await self.close() +@deprecated( + """ +Python client v3 `weaviate.Client(...)` connections and methods are deprecated and will + be removed by 2024-11-30. + + Upgrade your code to use Python client v4 `weaviate.WeaviateClient` connections and methods. + - For Python Client v4 usage, see: https://weaviate.io/developers/weaviate/client-libraries/python + - For code migration, see: https://weaviate.io/developers/weaviate/client-libraries/python/v3_v4_migration + + If you have to use v3 code, install the v3 client and pin the v3 dependency in your requirements file: `weaviate-client>=3.26.7;<4.0.0`""" +) class Client: """ The v3 Python-native Weaviate Client class that encapsulates Weaviate functionalities in one object. diff --git a/weaviate/warnings.py b/weaviate/warnings.py index 6218f1350..c17dfc055 100644 --- a/weaviate/warnings.py +++ b/weaviate/warnings.py @@ -160,12 +160,14 @@ def root_module_import(name: str, loc: str) -> None: @staticmethod def weaviate_v3_client_is_deprecated() -> None: warnings.warn( - message="""Dep016: Python client v3 `weaviate.Client(...)` connections and methods are deprecated. Update - your code to use Python client v4 `weaviate.WeaviateClient` connections and methods. + message="""Dep016: Python client v3 `weaviate.Client(...)` connections and methods are deprecated and will + be removed by 2024-11-30. - For Python Client v4 usage, see: https://weaviate.io/developers/weaviate/client-libraries/python - For code migration, see: https://weaviate.io/developers/weaviate/client-libraries/python/v3_v4_migration - """, + Upgrade your code to use Python client v4 `weaviate.WeaviateClient` connections and methods. + - For Python Client v4 usage, see: https://weaviate.io/developers/weaviate/client-libraries/python + - For code migration, see: https://weaviate.io/developers/weaviate/client-libraries/python/v3_v4_migration + + If you have to use v3 code, install the v3 client and pin the v3 dependency in your requirements file: `weaviate-client>=3.26.7;<4.0.0`""", category=DeprecationWarning, stacklevel=1, )