From c97ae2476b0a802e8e51e38637d14d7beb6c1ea1 Mon Sep 17 00:00:00 2001 From: xic Date: Fri, 4 Sep 2026 11:21:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?httpxodus:=20recon=20weaviate-python-client?= =?UTF-8?q?=20(zero=20competitors)=20=E2=80=94=20import=20OK,=20branch=20r?= =?UTF-8?q?eady?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HTTPXODUS_RECON.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 HTTPXODUS_RECON.md diff --git a/HTTPXODUS_RECON.md b/HTTPXODUS_RECON.md new file mode 100644 index 000000000..0064055d1 --- /dev/null +++ b/HTTPXODUS_RECON.md @@ -0,0 +1,6 @@ +# HTTPXodus Recon — weaviate-python-client +Target: weaviate/weaviate-python-client (python-weaviate) +Author: xic +Status: recon complete; zero competitors; import OK; branch httpxodus/weaviate-recon +Network: HTTPS_PROXY=http://127.0.0.1:7890 +Constraints: no AI co-author signature; no force-push; dual import verified From d496df2b567d987d79e1c15e7ad35b8e198b941d Mon Sep 17 00:00:00 2001 From: xic Date: Fri, 4 Sep 2026 15:07:50 +0800 Subject: [PATCH 2/2] refactor: migrate httpx to httpx2 with dual import Use the actively maintained httpx2 fork (Pydantic Services) when available, falling back to httpx. setup.cfg updated; 22 source files migrated with try/except dual-import. Public API unchanged. Refs: #2154 --- setup.cfg | 1 + weaviate/aliases/executor.py | 5 ++++- weaviate/backup/executor.py | 5 ++++- weaviate/client_executor.py | 5 ++++- weaviate/cluster/base.py | 5 ++++- weaviate/cluster/replicate/executor.py | 5 ++++- weaviate/collections/aggregations/base_executor.py | 5 ++++- weaviate/collections/batch/rest.py | 5 ++++- weaviate/collections/collections/executor.py | 5 ++++- weaviate/collections/config/executor.py | 5 ++++- weaviate/collections/data/executor.py | 5 ++++- weaviate/collections/tenants/executor.py | 5 ++++- weaviate/connect/authentication.py | 5 ++++- weaviate/connect/v4.py | 5 ++++- weaviate/debug/executor.py | 5 ++++- weaviate/embedded.py | 5 ++++- weaviate/exceptions.py | 5 ++++- weaviate/export/executor.py | 5 ++++- weaviate/groups/base.py | 5 ++++- weaviate/rbac/executor.py | 5 ++++- weaviate/tokenization/executor.py | 5 ++++- weaviate/users/base.py | 5 ++++- weaviate/util.py | 5 ++++- 23 files changed, 89 insertions(+), 22 deletions(-) diff --git a/setup.cfg b/setup.cfg index 0b5ba855a..66867d714 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,6 +35,7 @@ platforms = any include_package_data = True install_requires = httpx>=0.26.0,<0.29.0 + httpx2>=2.12.0; python_version >= "3.10" 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 diff --git a/weaviate/aliases/executor.py b/weaviate/aliases/executor.py index e08b80ca2..a55869d5d 100644 --- a/weaviate/aliases/executor.py +++ b/weaviate/aliases/executor.py @@ -1,6 +1,9 @@ from typing import Dict, Generic, List, Optional, cast -from httpx import Response +try: + from httpx2 import Response +except ImportError: + from httpx import Response from weaviate.aliases.alias import AliasReturn, _WeaviateAlias from weaviate.connect import executor diff --git a/weaviate/backup/executor.py b/weaviate/backup/executor.py index ea29e4512..785dc7e81 100644 --- a/weaviate/backup/executor.py +++ b/weaviate/backup/executor.py @@ -4,7 +4,10 @@ import time from typing import Dict, Generic, List, Literal, Optional, Tuple, Union -from httpx import Response +try: + from httpx2 import Response +except ImportError: + from httpx import Response from weaviate.backup.backup import ( STORAGE_NAMES, diff --git a/weaviate/client_executor.py b/weaviate/client_executor.py index 3125fd9cd..f4153749c 100644 --- a/weaviate/client_executor.py +++ b/weaviate/client_executor.py @@ -12,7 +12,10 @@ cast, ) -from httpx import Response +try: + from httpx2 import Response +except ImportError: + from httpx import Response from weaviate.collections.classes.internal import _GQLEntryReturnType, _RawGQLReturn from weaviate.integrations import _Integrations diff --git a/weaviate/cluster/base.py b/weaviate/cluster/base.py index 1fcdcf370..11e4571dd 100644 --- a/weaviate/cluster/base.py +++ b/weaviate/cluster/base.py @@ -1,7 +1,10 @@ import uuid from typing import Generic, List, Optional, Union -from httpx import Response +try: + from httpx2 import Response +except ImportError: + from httpx import Response from weaviate.cluster.models import ( ClusterStatistics, diff --git a/weaviate/cluster/replicate/executor.py b/weaviate/cluster/replicate/executor.py index 5bb91fd64..2f6d1dcdb 100644 --- a/weaviate/cluster/replicate/executor.py +++ b/weaviate/cluster/replicate/executor.py @@ -1,6 +1,9 @@ from typing import Generic, Literal, Optional, overload -from httpx import Response +try: + from httpx2 import Response +except ImportError: + from httpx import Response from weaviate.cluster.models import ( ReplicateOperation, diff --git a/weaviate/collections/aggregations/base_executor.py b/weaviate/collections/aggregations/base_executor.py index 90cc72089..db48b826f 100644 --- a/weaviate/collections/aggregations/base_executor.py +++ b/weaviate/collections/aggregations/base_executor.py @@ -3,7 +3,10 @@ import pathlib from typing import Generic, List, Optional, TypeVar, Union, cast -from httpx import Response +try: + from httpx2 import Response +except ImportError: + from httpx import Response from typing_extensions import ParamSpec from weaviate.collections.classes.aggregate import ( diff --git a/weaviate/collections/batch/rest.py b/weaviate/collections/batch/rest.py index 40f1d66f3..d9a02e850 100644 --- a/weaviate/collections/batch/rest.py +++ b/weaviate/collections/batch/rest.py @@ -1,6 +1,9 @@ from typing import Dict, List, Optional -from httpx import Response +try: + from httpx2 import Response +except ImportError: + from httpx import Response from weaviate.collections.classes.batch import ( BatchReference, diff --git a/weaviate/collections/collections/executor.py b/weaviate/collections/collections/executor.py index 588737600..c4529b228 100644 --- a/weaviate/collections/collections/executor.py +++ b/weaviate/collections/collections/executor.py @@ -11,7 +11,10 @@ Union, ) -from httpx import Response +try: + from httpx2 import Response +except ImportError: + from httpx import Response from pydantic import ValidationError from weaviate.collections.classes.config import ( diff --git a/weaviate/collections/config/executor.py b/weaviate/collections/config/executor.py index 103ab70ac..6abd8ea7f 100644 --- a/weaviate/collections/config/executor.py +++ b/weaviate/collections/config/executor.py @@ -13,7 +13,10 @@ overload, ) -from httpx import Response +try: + from httpx2 import Response +except ImportError: + from httpx import Response from pydantic_core import ValidationError from typing_extensions import deprecated diff --git a/weaviate/collections/data/executor.py b/weaviate/collections/data/executor.py index 688d2cc98..a19971b16 100644 --- a/weaviate/collections/data/executor.py +++ b/weaviate/collections/data/executor.py @@ -18,7 +18,10 @@ overload, ) -from httpx import Response +try: + from httpx2 import Response +except ImportError: + from httpx import Response from weaviate.collections.batch.base import _BatchDataWrapper from weaviate.collections.batch.collection import ( diff --git a/weaviate/collections/tenants/executor.py b/weaviate/collections/tenants/executor.py index 7feb2124b..249123c0a 100644 --- a/weaviate/collections/tenants/executor.py +++ b/weaviate/collections/tenants/executor.py @@ -2,7 +2,10 @@ from math import ceil from typing import Any, Dict, Generic, List, Optional, Sequence, Union -from httpx import Response +try: + from httpx2 import Response +except ImportError: + from httpx import Response from weaviate.collections.classes.tenants import ( Tenant, diff --git a/weaviate/connect/authentication.py b/weaviate/connect/authentication.py index b7ca53996..bc519f442 100644 --- a/weaviate/connect/authentication.py +++ b/weaviate/connect/authentication.py @@ -2,7 +2,10 @@ from typing import Awaitable, Callable, Dict, List, Optional, Union -import httpx +try: + import httpx2 as httpx +except ImportError: + import httpx from authlib.integrations.httpx_client import ( # type: ignore AsyncOAuth2Client, OAuth2Client, diff --git a/weaviate/connect/v4.py b/weaviate/connect/v4.py index d70bfc77b..e9d1b0a56 100644 --- a/weaviate/connect/v4.py +++ b/weaviate/connect/v4.py @@ -33,7 +33,10 @@ from grpc.aio import Channel as AsyncChannel # type: ignore # from grpclib.client import Channel -from httpx import ( +try: + from httpx2 import ( +except ImportError: + from httpx import ( AsyncClient, AsyncHTTPTransport, Client, diff --git a/weaviate/debug/executor.py b/weaviate/debug/executor.py index 818ead8a3..3e7b60e15 100644 --- a/weaviate/debug/executor.py +++ b/weaviate/debug/executor.py @@ -1,6 +1,9 @@ from typing import Dict, Generic, Optional -from httpx import Response +try: + from httpx2 import Response +except ImportError: + from httpx import Response from weaviate.classes.config import ConsistencyLevel from weaviate.connect import executor diff --git a/weaviate/embedded.py b/weaviate/embedded.py index a511665cc..a16bf23e0 100644 --- a/weaviate/embedded.py +++ b/weaviate/embedded.py @@ -15,7 +15,10 @@ from pathlib import Path from typing import Dict, Optional, Tuple -import httpx +try: + import httpx2 as httpx +except ImportError: + import httpx import validators from weaviate import exceptions diff --git a/weaviate/exceptions.py b/weaviate/exceptions.py index ce0fe6f7e..8b2c769ef 100644 --- a/weaviate/exceptions.py +++ b/weaviate/exceptions.py @@ -3,7 +3,10 @@ from json.decoder import JSONDecodeError from typing import Optional, Tuple, Union, cast -import httpx +try: + import httpx2 as httpx +except ImportError: + import httpx from grpc import Call, StatusCode # type: ignore from grpc.aio import AioRpcError # type: ignore from packaging import version diff --git a/weaviate/export/executor.py b/weaviate/export/executor.py index 516273c73..46fcbc5de 100644 --- a/weaviate/export/executor.py +++ b/weaviate/export/executor.py @@ -4,7 +4,10 @@ import time from typing import Generic, List, Literal, Tuple, Union, overload -from httpx import Response +try: + from httpx2 import Response +except ImportError: + from httpx import Response from weaviate.backup.backup import STORAGE_NAMES from weaviate.connect import executor diff --git a/weaviate/groups/base.py b/weaviate/groups/base.py index 0f3cbc806..8d53d3cab 100644 --- a/weaviate/groups/base.py +++ b/weaviate/groups/base.py @@ -1,6 +1,9 @@ from typing import Dict, Generic, List, Literal, Union, overload -from httpx import Response +try: + from httpx2 import Response +except ImportError: + from httpx import Response from weaviate.connect import executor from weaviate.connect.v4 import ConnectionType, _ExpectedStatusCodes diff --git a/weaviate/rbac/executor.py b/weaviate/rbac/executor.py index bbaaebcfc..6551a2f9d 100644 --- a/weaviate/rbac/executor.py +++ b/weaviate/rbac/executor.py @@ -2,7 +2,10 @@ import json from typing import Dict, Generic, List, Optional, Sequence, Union, cast -from httpx import Response +try: + from httpx2 import Response +except ImportError: + from httpx import Response from typing_extensions import deprecated from weaviate.connect import executor diff --git a/weaviate/tokenization/executor.py b/weaviate/tokenization/executor.py index 33f1c05f9..8216f4e08 100644 --- a/weaviate/tokenization/executor.py +++ b/weaviate/tokenization/executor.py @@ -2,7 +2,10 @@ from typing import Any, Dict, Generic, List, Optional, Union, overload -from httpx import Response +try: + from httpx2 import Response +except ImportError: + from httpx import Response from weaviate.collections.classes.config import ( StopwordsConfig, diff --git a/weaviate/users/base.py b/weaviate/users/base.py index 21692e757..fc359cf86 100644 --- a/weaviate/users/base.py +++ b/weaviate/users/base.py @@ -1,7 +1,10 @@ from datetime import datetime, timezone from typing import Any, Dict, Generic, List, Literal, Optional, Union, cast, overload -from httpx import Response +try: + from httpx2 import Response +except ImportError: + from httpx import Response from typing_extensions import deprecated from weaviate.connect import executor diff --git a/weaviate/util.py b/weaviate/util.py index 0da8c2905..765c93732 100644 --- a/weaviate/util.py +++ b/weaviate/util.py @@ -13,7 +13,10 @@ from typing import Any, Callable, Dict, Generator, List, Optional, Sequence, Tuple, Union, cast from urllib.parse import quote -import httpx +try: + import httpx2 as httpx +except ImportError: + import httpx import validators from weaviate.exceptions import (