diff --git a/pinecone/config/__init__.py b/pinecone/config/__init__.py index f292622f6..a950300ef 100644 --- a/pinecone/config/__init__.py +++ b/pinecone/config/__init__.py @@ -5,5 +5,12 @@ from .openapi_configuration import Configuration as OpenApiConfiguration from .pinecone_config import PineconeConfig +__all__ = [ + "ConfigBuilder", + "Config", + "OpenApiConfiguration", + "PineconeConfig", +] + if os.getenv("PINECONE_DEBUG") is not None: logging.getLogger("pinecone").setLevel(level=logging.DEBUG) diff --git a/pinecone/db_control/__init__.py b/pinecone/db_control/__init__.py index 73d824681..74c82cd8e 100644 --- a/pinecone/db_control/__init__.py +++ b/pinecone/db_control/__init__.py @@ -4,4 +4,35 @@ from .db_control_asyncio import DBControlAsyncio from .repr_overrides import install_repr_overrides +__all__ = [ + # from .enums + "CloudProvider", + "AwsRegion", + "GcpRegion", + "AzureRegion", + "DeletionProtection", + "Metric", + "PodIndexEnvironment", + "PodType", + "VectorType", + # from .models + "CollectionDescription", + "PodSpec", + "PodSpecDefinition", + "ServerlessSpec", + "ServerlessSpecDefinition", + "ByocSpec", + "IndexList", + "CollectionList", + "IndexModel", + "IndexEmbed", + "BackupModel", + "BackupList", + "RestoreJobModel", + "RestoreJobList", + # direct imports + "DBControl", + "DBControlAsyncio", +] + install_repr_overrides() diff --git a/pinecone/db_control/resources/asyncio/__init__.py b/pinecone/db_control/resources/asyncio/__init__.py index 9a4841d3b..afb1853da 100644 --- a/pinecone/db_control/resources/asyncio/__init__.py +++ b/pinecone/db_control/resources/asyncio/__init__.py @@ -1,2 +1,4 @@ from .index import IndexResourceAsyncio from .collection import CollectionResourceAsyncio + +__all__ = ["IndexResourceAsyncio", "CollectionResourceAsyncio"] diff --git a/pinecone/db_control/resources/sync/__init__.py b/pinecone/db_control/resources/sync/__init__.py index cc904d53e..bc6c92223 100644 --- a/pinecone/db_control/resources/sync/__init__.py +++ b/pinecone/db_control/resources/sync/__init__.py @@ -1,2 +1,4 @@ from .index import IndexResource from .collection import CollectionResource + +__all__ = ["IndexResource", "CollectionResource"] diff --git a/pinecone/db_control/types/__init__.py b/pinecone/db_control/types/__init__.py index 12d16270d..aa10200b3 100644 --- a/pinecone/db_control/types/__init__.py +++ b/pinecone/db_control/types/__init__.py @@ -1 +1,3 @@ from .create_index_for_model_embed import CreateIndexForModelEmbedTypedDict + +__all__ = ["CreateIndexForModelEmbedTypedDict"] diff --git a/pinecone/db_data/__init__.py b/pinecone/db_data/__init__.py index 7722ff79a..ebe6da513 100644 --- a/pinecone/db_data/__init__.py +++ b/pinecone/db_data/__init__.py @@ -27,6 +27,31 @@ from .resources.sync.bulk_import import ImportErrorMode +__all__ = [ + "_Index", + "_IndexAsyncio", + "DescribeIndexStatsResponse", + "FetchResponse", + "ImportErrorMode", + "Index", + "IndexClientInstantiationError", + "Inference", + "InferenceInstantiationError", + "MetadataDictionaryExpectedError", + "QueryResponse", + "SearchQuery", + "SearchQueryVector", + "SearchRerank", + "SparseValues", + "SparseValuesDictionaryExpectedError", + "SparseValuesMissingKeysError", + "SparseValuesTypeError", + "UpsertResponse", + "Vector", + "VectorDictionaryExcessKeysError", + "VectorDictionaryMissingKeysError", + "VectorTupleLengthError", +] import warnings @@ -41,10 +66,10 @@ def _get_deprecated_import(name, from_module, to_module): ) # Import from the new location from pinecone.inference import ( - Inference as _Inference, - AsyncioInference as _AsyncioInference, - RerankModel, - EmbedModel, + Inference as _Inference, # noqa: F401 + AsyncioInference as _AsyncioInference, # noqa: F401 + RerankModel, # noqa: F401 + EmbedModel, # noqa: F401 ) return locals()[name] diff --git a/pinecone/db_data/dataclasses/__init__.py b/pinecone/db_data/dataclasses/__init__.py index 0183eb74e..2434890dc 100644 --- a/pinecone/db_data/dataclasses/__init__.py +++ b/pinecone/db_data/dataclasses/__init__.py @@ -4,3 +4,12 @@ from .search_query import SearchQuery from .search_query_vector import SearchQueryVector from .search_rerank import SearchRerank + +__all__ = [ + "SparseValues", + "Vector", + "FetchResponse", + "SearchQuery", + "SearchQueryVector", + "SearchRerank", +] diff --git a/pinecone/db_data/types/__init__.py b/pinecone/db_data/types/__init__.py index ccc9fb50d..277731d5f 100644 --- a/pinecone/db_data/types/__init__.py +++ b/pinecone/db_data/types/__init__.py @@ -6,3 +6,16 @@ from .search_rerank_typed_dict import SearchRerankTypedDict from .search_query_typed_dict import SearchQueryTypedDict from .search_query_vector_typed_dict import SearchQueryVectorTypedDict + +__all__ = [ + "SparseVectorTypedDict", + "VectorTypedDict", + "VectorMetadataTypedDict", + "VectorTuple", + "VectorTupleWithMetadata", + "FilterTypedDict", + "SearchRerankTypedDict", + "SearchQueryTypedDict", + "SearchQueryVectorTypedDict", +] + diff --git a/pinecone/inference/__init__.py b/pinecone/inference/__init__.py index 235cbc69b..5276f42c0 100644 --- a/pinecone/inference/__init__.py +++ b/pinecone/inference/__init__.py @@ -4,4 +4,15 @@ from .inference_request_builder import RerankModel, EmbedModel from .models import ModelInfo, ModelInfoList, EmbeddingsList, RerankResult +__all__ = [ + "Inference", + "AsyncioInference", + "RerankModel", + "EmbedModel", + "ModelInfo", + "ModelInfoList", + "EmbeddingsList", + "RerankResult", +] + install_repl_overrides() diff --git a/pinecone/openapi_support/__init__.py b/pinecone/openapi_support/__init__.py index 890c30070..b6bc19916 100644 --- a/pinecone/openapi_support/__init__.py +++ b/pinecone/openapi_support/__init__.py @@ -47,3 +47,45 @@ from .types import PropertyValidationTypedDict from .cached_class_property import cached_class_property + +__all__ = [ + "ApiClient", + "Endpoint", + "ExtraOpenApiKwargsTypedDict", + "KwargsWithOpenApiKwargDefaultsTypedDict", + "AsyncioApiClient", + "AsyncioEndpoint", + "Configuration", + "PineconeException", + "PineconeApiAttributeError", + "PineconeApiTypeError", + "PineconeApiValueError", + "PineconeApiKeyError", + "PineconeApiException", + "NotFoundException", + "UnauthorizedException", + "ForbiddenException", + "ServiceException", + "OpenApiModel", + "ModelNormal", + "ModelSimple", + "ModelComposed", + "change_keys_js_to_python", + "convert_js_args_to_python_args", + "validate_get_composed_info", + "cached_property", + "validate_and_convert_types", + "check_allowed_values", + "check_validations", + "file_type", + "none_type", + "Urllib3RestClient", + "AiohttpRestClient", + "RESTResponse", + "OPENAPI_ENDPOINT_PARAMS", + "date", + "datetime", + "parse", + "PropertyValidationTypedDict", + "cached_class_property", +] diff --git a/pyproject.toml b/pyproject.toml index d79d7926c..098c423dd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -159,8 +159,7 @@ docstring-code-line-length = "dynamic" [tool.ruff.lint.per-file-ignores] # F403 Allow star imports -# F401 allow imported but unused -"__init__.py" = ["F401", "F403", "F405"] +"__init__.py" = ["F403", "F405"] # E402 Allow module level import not at top of file so # tqdm warnings can be disabled ahead of loading any code diff --git a/tests/integration/helpers/__init__.py b/tests/integration/helpers/__init__.py index afe12395a..35b858737 100644 --- a/tests/integration/helpers/__init__.py +++ b/tests/integration/helpers/__init__.py @@ -13,3 +13,19 @@ delete_indexes_from_run, default_create_index_params, ) + +__all__ = [ + "fake_api_key", + "get_environment_var", + "random_string", + "generate_index_name", + "generate_collection_name", + "poll_stats_for_namespace", + "poll_fetch_for_ids_in_namespace", + "embedding_values", + "jsonprint", + "index_tags", + "delete_backups_from_run", + "delete_indexes_from_run", + "default_create_index_params", +]