From 0571b03a448f87e6e14c730897232b717ca898d2 Mon Sep 17 00:00:00 2001 From: Hardik Kaurani Date: Thu, 22 Oct 2026 15:38:27 +0530 Subject: [PATCH 1/2] fix(http-httpx): export HttpxRequestAdapter and KiotaClientFactory from kiota_http package --- packages/http/httpx/README.md | 2 +- packages/http/httpx/kiota_http/__init__.py | 8 ++++++++ packages/http/httpx/tests/test_typing.py | 7 +++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/http/httpx/README.md b/packages/http/httpx/README.md index 7d80b224..f0df8d39 100644 --- a/packages/http/httpx/README.md +++ b/packages/http/httpx/README.md @@ -5,7 +5,7 @@ The Microsoft Kiota HTTP Library is a python HTTP implementation with HTTPX library. -A [Kiota](https://github.com/microsoft/kiota) generated project will need a reference to a http package to to make HTTP requests to an API endpoint. +A [Kiota](https://github.com/microsoft/kiota) generated project will need a reference to a http package to make HTTP requests to an API endpoint. Read more about Kiota [here](https://github.com/microsoft/kiota/blob/main/README.md). diff --git a/packages/http/httpx/kiota_http/__init__.py b/packages/http/httpx/kiota_http/__init__.py index 7ea9d042..703140a0 100644 --- a/packages/http/httpx/kiota_http/__init__.py +++ b/packages/http/httpx/kiota_http/__init__.py @@ -2,5 +2,13 @@ Kiota http request adapter implementation for httpx library """ from ._version import VERSION +from .httpx_request_adapter import HttpxRequestAdapter +from .kiota_client_factory import KiotaClientFactory __version__ = VERSION + +__all__ = [ + "__version__", + "HttpxRequestAdapter", + "KiotaClientFactory", +] diff --git a/packages/http/httpx/tests/test_typing.py b/packages/http/httpx/tests/test_typing.py index 70319f46..3324ef61 100644 --- a/packages/http/httpx/tests/test_typing.py +++ b/packages/http/httpx/tests/test_typing.py @@ -13,3 +13,10 @@ def test_httpx_request_adapter_is_a_request_adapter_of_httpx_request(tmp_path): ) stdout, _, exit_status = api.run(["--follow-imports=silent", str(snippet)]) assert exit_status == 0, stdout + + +def test_package_exports(): + import kiota_http + assert hasattr(kiota_http, "HttpxRequestAdapter") + assert hasattr(kiota_http, "KiotaClientFactory") + assert hasattr(kiota_http, "__version__") From 36b4089254d85049055c56493468d73766da23f6 Mon Sep 17 00:00:00 2001 From: Hardik Kaurani Date: Fri, 23 Oct 2026 19:08:03 +0530 Subject: [PATCH 2/2] feat(http-httpx): export ObservabilityOptions and assert __all__ in typing tests --- packages/http/httpx/kiota_http/__init__.py | 2 ++ packages/http/httpx/tests/test_typing.py | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/packages/http/httpx/kiota_http/__init__.py b/packages/http/httpx/kiota_http/__init__.py index 703140a0..10e566ac 100644 --- a/packages/http/httpx/kiota_http/__init__.py +++ b/packages/http/httpx/kiota_http/__init__.py @@ -4,6 +4,7 @@ from ._version import VERSION from .httpx_request_adapter import HttpxRequestAdapter from .kiota_client_factory import KiotaClientFactory +from .observability_options import ObservabilityOptions __version__ = VERSION @@ -11,4 +12,5 @@ "__version__", "HttpxRequestAdapter", "KiotaClientFactory", + "ObservabilityOptions", ] diff --git a/packages/http/httpx/tests/test_typing.py b/packages/http/httpx/tests/test_typing.py index 3324ef61..fb87897e 100644 --- a/packages/http/httpx/tests/test_typing.py +++ b/packages/http/httpx/tests/test_typing.py @@ -19,4 +19,23 @@ def test_package_exports(): import kiota_http assert hasattr(kiota_http, "HttpxRequestAdapter") assert hasattr(kiota_http, "KiotaClientFactory") + assert hasattr(kiota_http, "ObservabilityOptions") assert hasattr(kiota_http, "__version__") + assert "HttpxRequestAdapter" in kiota_http.__all__ + assert "KiotaClientFactory" in kiota_http.__all__ + assert "ObservabilityOptions" in kiota_http.__all__ + assert "__version__" in kiota_http.__all__ + + +def test_package_exports_typecheck(tmp_path): + snippet = tmp_path / "snippet.py" + snippet.write_text( + "from kiota_http import (\n" + " HttpxRequestAdapter,\n" + " KiotaClientFactory,\n" + " ObservabilityOptions,\n" + " __version__,\n" + ")\n" + ) + stdout, _, exit_status = api.run(["--follow-imports=silent", str(snippet)]) + assert exit_status == 0, stdout