diff --git a/airbyte/__init__.py b/airbyte/__init__.py index 660dc3e7..2e7d7b02 100644 --- a/airbyte/__init__.py +++ b/airbyte/__init__.py @@ -123,23 +123,8 @@ from __future__ import annotations -from airbyte import ( - caches, - callbacks, - # cli, # Causes circular import if included - cloud, - constants, - datasets, - destinations, - documents, - exceptions, # noqa: ICN001 # No 'exc' alias for top-level module - experimental, - logs, - records, - results, - secrets, - sources, -) +from typing import TYPE_CHECKING + from airbyte.caches.bigquery import BigQueryCache from airbyte.caches.duckdb import DuckDBCache from airbyte.caches.util import get_colab_cache, get_default_cache, new_local_cache @@ -155,6 +140,28 @@ from airbyte.sources.util import get_source +# Submodules imported here for documentation reasons: https://github.com/mitmproxy/pdoc/issues/757 +if TYPE_CHECKING: + # ruff: noqa: TCH004 # imports used for more than type checking + from airbyte import ( + caches, + callbacks, + # cli, # Causes circular import if included + cloud, + constants, + datasets, + destinations, + documents, + exceptions, # noqa: ICN001 # No 'exc' alias for top-level module + experimental, + logs, + records, + results, + secrets, + sources, + ) + + __all__ = [ # Modules "caches", diff --git a/airbyte/caches/__init__.py b/airbyte/caches/__init__.py index 0c5886ea..c4d12717 100644 --- a/airbyte/caches/__init__.py +++ b/airbyte/caches/__init__.py @@ -3,7 +3,8 @@ from __future__ import annotations -from airbyte.caches import base, bigquery, duckdb, motherduck, postgres, snowflake, util +from typing import TYPE_CHECKING + from airbyte.caches.base import CacheBase from airbyte.caches.bigquery import BigQueryCache from airbyte.caches.duckdb import DuckDBCache @@ -13,6 +14,11 @@ from airbyte.caches.util import get_default_cache, new_local_cache +# Submodules imported here for documentation reasons: https://github.com/mitmproxy/pdoc/issues/757 +if TYPE_CHECKING: + # ruff: noqa: TCH004 + from airbyte.caches import base, bigquery, duckdb, motherduck, postgres, snowflake, util + # We export these classes for easy access: `airbyte.caches...` __all__ = [ # Factories diff --git a/airbyte/cloud/__init__.py b/airbyte/cloud/__init__.py index b599386d..ee7a59eb 100644 --- a/airbyte/cloud/__init__.py +++ b/airbyte/cloud/__init__.py @@ -56,13 +56,20 @@ from __future__ import annotations -from airbyte.cloud import connections, constants, sync_results, workspaces +from typing import TYPE_CHECKING + from airbyte.cloud.connections import CloudConnection from airbyte.cloud.constants import JobStatusEnum from airbyte.cloud.sync_results import SyncResult from airbyte.cloud.workspaces import CloudWorkspace +# Submodules imported here for documentation reasons: https://github.com/mitmproxy/pdoc/issues/757 +if TYPE_CHECKING: + # ruff: noqa: TCH004 + from airbyte.cloud import connections, constants, sync_results, workspaces + + __all__ = [ # Submodules "workspaces", diff --git a/airbyte/destinations/__init__.py b/airbyte/destinations/__init__.py index 8a03ab75..6ec39c70 100644 --- a/airbyte/destinations/__init__.py +++ b/airbyte/destinations/__init__.py @@ -75,7 +75,8 @@ from __future__ import annotations -from airbyte.destinations import util +from typing import TYPE_CHECKING + from airbyte.destinations.base import Destination from airbyte.destinations.util import ( get_destination, @@ -83,6 +84,12 @@ ) +# Submodules imported here for documentation reasons: https://github.com/mitmproxy/pdoc/issues/757 +if TYPE_CHECKING: + # ruff: noqa: TCH004 # imports used for more than type checking + from airbyte.destinations import util + + __all__ = [ # Modules "util", diff --git a/airbyte/secrets/__init__.py b/airbyte/secrets/__init__.py index b88eaaaf..d797e0c0 100644 --- a/airbyte/secrets/__init__.py +++ b/airbyte/secrets/__init__.py @@ -64,16 +64,8 @@ from __future__ import annotations -from airbyte.secrets import ( - base, - config, - custom, - env_vars, - google_colab, - google_gsm, - prompt, - util, -) +from typing import TYPE_CHECKING + from airbyte.secrets.base import SecretHandle, SecretManager, SecretSourceEnum, SecretString from airbyte.secrets.config import disable_secret_source, register_secret_manager from airbyte.secrets.custom import CustomSecretManager @@ -84,6 +76,21 @@ from airbyte.secrets.util import get_secret +# Submodules imported here for documentation reasons: https://github.com/mitmproxy/pdoc/issues/757 +if TYPE_CHECKING: + # ruff: noqa: TCH004 # imports used for more than type checking + from airbyte.secrets import ( + base, + config, + custom, + env_vars, + google_colab, + google_gsm, + prompt, + util, + ) + + __all__ = [ # Submodules "base", diff --git a/airbyte/sources/__init__.py b/airbyte/sources/__init__.py index f29c6ea7..7bb4d7be 100644 --- a/airbyte/sources/__init__.py +++ b/airbyte/sources/__init__.py @@ -3,7 +3,8 @@ from __future__ import annotations -from airbyte.sources import base, util +from typing import TYPE_CHECKING + from airbyte.sources.base import Source from airbyte.sources.registry import ( ConnectorMetadata, @@ -16,6 +17,14 @@ ) +# Submodules imported here for documentation reasons: https://github.com/mitmproxy/pdoc/issues/757 +if TYPE_CHECKING: + # ruff: noqa: TCH004 # imports used for more than type checking + from airbyte.sources import ( + base, + util, + ) + __all__ = [ # Submodules "base", diff --git a/tests/integration_tests/test_install.py b/tests/integration_tests/test_install.py index 9908c492..5b6deb8f 100644 --- a/tests/integration_tests/test_install.py +++ b/tests/integration_tests/test_install.py @@ -20,4 +20,8 @@ def test_install_failure_log_pypi(): ) # Check that the stderr log contains the expected content from a failed pip install - assert "Could not install requirement" in str(exc_info.value.__cause__.log_text) + err_msg = str(exc_info.value.__cause__.log_text) + assert any([ + "Cannot unpack file" in err_msg, + "Could not install requirement" in err_msg, + ])