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..10e566ac 100644 --- a/packages/http/httpx/kiota_http/__init__.py +++ b/packages/http/httpx/kiota_http/__init__.py @@ -2,5 +2,15 @@ Kiota http request adapter implementation for httpx library """ from ._version import VERSION +from .httpx_request_adapter import HttpxRequestAdapter +from .kiota_client_factory import KiotaClientFactory +from .observability_options import ObservabilityOptions __version__ = VERSION + +__all__ = [ + "__version__", + "HttpxRequestAdapter", + "KiotaClientFactory", + "ObservabilityOptions", +] diff --git a/packages/http/httpx/tests/test_typing.py b/packages/http/httpx/tests/test_typing.py index 70319f46..fb87897e 100644 --- a/packages/http/httpx/tests/test_typing.py +++ b/packages/http/httpx/tests/test_typing.py @@ -13,3 +13,29 @@ 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, "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