forked from pinecone-io/pinecone-python-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeprecated_plugins.py
More file actions
22 lines (17 loc) · 957 Bytes
/
deprecated_plugins.py
File metadata and controls
22 lines (17 loc) · 957 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
class DeprecatedPluginError(Exception):
def __init__(self, plugin_name: str) -> None:
message = f"The `{plugin_name}` package has been deprecated. The features from that plugin have been incorporated into the main `pinecone` package with no need for additional plugins. Please remove the `{plugin_name}` package from your dependencies to ensure you have the most up-to-date version of these features."
super().__init__(message)
def check_for_deprecated_plugins():
try:
from pinecone_plugins.inference import __installables__ # type: ignore
if __installables__ is not None:
raise DeprecatedPluginError("pinecone-plugin-inference")
except ImportError:
pass
try:
from pinecone_plugins.records import __installables__ # type: ignore
if __installables__ is not None:
raise DeprecatedPluginError("pinecone-plugin-records")
except ImportError:
pass