Skip to content

Commit 37e0eb3

Browse files
committed
Implement docs with sphinx
1 parent 9b85d0a commit 37e0eb3

31 files changed

+2845
-2080
lines changed

.github/actions/build-docs/action.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,4 @@ runs:
1717
- name: Build html documentation
1818
shell: bash
1919
run: |
20-
poetry run pdoc pinecone '!pinecone.core' '!pinecone.utils' --favicon ./favicon-32x32.png --docformat google -o ./pdoc
21-
22-
- name: Fix relative links
23-
shell: bash
24-
run: |
25-
poetry run python3 ./.github/actions/build-docs/fix-relative-links.py ./pdoc ./pdoc
26-
env:
27-
BASE_URL: "https://github.com/pinecone-io/pinecone-python-client/blob/main/"
20+
poetry run sphinx-build -b html sphinx docsbuild

.github/actions/build-docs/fix-relative-links.py

Lines changed: 0 additions & 66 deletions
This file was deleted.

.github/workflows/build-and-publish-docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
env:
2525
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
2626
with:
27-
source-directory: pdoc
27+
source-directory: docsbuild
2828
destination-github-username: pinecone-io
2929
destination-repository-name: sdk-docs
3030
user-email: [email protected]

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ venv.bak/
144144
pdoc/*
145145
!pdoc/pinecone-python-client-fork.png
146146
!pdoc/favicon-32x32.png
147+
docsbuild
147148

148149
# mypy
149150
.mypy_cache/

pinecone/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@
7171
"pinecone.db_data.errors",
7272
"SparseValuesDictionaryExpectedError",
7373
),
74-
"Index": ("pinecone.db_data.import_error", "Index"),
75-
"Inference": ("pinecone.db_data.import_error", "Inference"),
7674
}
7775

7876
_db_control_lazy_imports = {

pinecone/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from pinecone.config import Config
22
from pinecone.config import ConfigBuilder
33
from pinecone.config import PineconeConfig
4-
from .exceptions import (
4+
from pinecone.exceptions import (
55
PineconeException,
66
PineconeApiTypeError,
77
PineconeApiValueError,

pinecone/db_data/__init__.py

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
from .index import (
2-
Index as _Index,
2+
Index,
33
FetchResponse,
44
QueryResponse,
55
DescribeIndexStatsResponse,
66
UpsertResponse,
77
SparseValues,
88
Vector,
99
)
10+
1011
from .dataclasses import *
11-
from .import_error import (
12-
Index,
13-
IndexClientInstantiationError,
14-
Inference,
15-
InferenceInstantiationError,
16-
)
1712
from .index_asyncio import *
1813
from .errors import (
1914
VectorDictionaryMissingKeysError,
@@ -24,19 +19,23 @@
2419
SparseValuesDictionaryExpectedError,
2520
MetadataDictionaryExpectedError,
2621
)
22+
import warnings
23+
2724

2825
from .resources.sync.bulk_import import ImportErrorMode
2926

27+
_Index = Index # alias for backwards compatibility
28+
29+
3030
__all__ = [
3131
"_Index",
3232
"_IndexAsyncio",
3333
"DescribeIndexStatsResponse",
3434
"FetchResponse",
3535
"ImportErrorMode",
3636
"Index",
37-
"IndexClientInstantiationError",
37+
"IndexAsyncio",
3838
"Inference",
39-
"InferenceInstantiationError",
4039
"MetadataDictionaryExpectedError",
4140
"QueryResponse",
4241
"SearchQuery",
@@ -53,8 +52,6 @@
5352
"VectorTupleLengthError",
5453
]
5554

56-
import warnings
57-
5855

5956
def _get_deprecated_import(name, from_module, to_module):
6057
warnings.warn(
@@ -66,10 +63,10 @@ def _get_deprecated_import(name, from_module, to_module):
6663
)
6764
# Import from the new location
6865
from pinecone.inference import (
69-
Inference as _Inference, # noqa: F401
70-
AsyncioInference as _AsyncioInference, # noqa: F401
71-
RerankModel, # noqa: F401
72-
EmbedModel, # noqa: F401
66+
Inference as _Inference, # noqa: F401
67+
AsyncioInference as _AsyncioInference, # noqa: F401
68+
RerankModel, # noqa: F401
69+
EmbedModel, # noqa: F401
7370
)
7471

7572
return locals()[name]

pinecone/db_data/import_error.py

Lines changed: 0 additions & 62 deletions
This file was deleted.

pinecone/db_data/index.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -524,16 +524,17 @@ def list_imports(self, **kwargs) -> Iterator["ImportModel"]:
524524
Returns a generator that yields each import operation. It automatically handles pagination tokens on your behalf so you can
525525
easily iterate over all results. The `list_imports` method accepts all of the same arguments as list_imports_paginated
526526
527-
```python
528-
for op in index.list_imports():
529-
print(op)
530-
```
527+
.. code-block:: python
528+
529+
for op in index.list_imports():
530+
print(op)
531+
531532
532533
You can convert the generator into a list by wrapping the generator in a call to the built-in `list` function:
533534
534-
```python
535-
operations = list(index.list_imports())
536-
```
535+
.. code-block:: python
536+
537+
operations = list(index.list_imports())
537538
538539
You should be cautious with this approach because it will fetch all operations at once, which could be a large number
539540
of network calls and a lot of memory to hold the results.

pinecone/db_data/index_asyncio.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
logger = logging.getLogger(__name__)
6262
""" @private """
6363

64-
__all__ = ["_IndexAsyncio"]
64+
__all__ = ["_IndexAsyncio", "IndexAsyncio"]
6565

6666
_OPENAPI_ENDPOINT_PARAMS = (
6767
"_return_http_data_only",
@@ -649,3 +649,6 @@ async def cancel_import(self, id: str):
649649
id (str): The id of the import operation to cancel.
650650
"""
651651
return await self.bulk_import.cancel(id=id)
652+
653+
654+
IndexAsyncio = _IndexAsyncio

0 commit comments

Comments
 (0)