Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@
secrets: inherit
needs: unit-tests

testing-install:
uses: './.github/workflows/testing-install.yaml'
secrets: inherit

package:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
name: Check packaging
runs-on: ubuntu-latest
strategy:
Expand Down
89 changes: 85 additions & 4 deletions .github/workflows/testing-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@ name: Installation Tests

on:
workflow_call:
workflow_dispatch:

permissions:
contents: read
pull-requests: write

jobs:
test-install:
install:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 3
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
python: [3.9]
os: [ubuntu-latest, macos-latest]
python: ['3.9', '3.10', '3.11', '3.12', '3.13']


steps:
- name: Checkout code
Expand All @@ -32,13 +36,90 @@ jobs:
run: python -m build --sdist --wheel

- name: Install from built artifacts
shell: bash
run: |
# Use the wheel if it's pure-python; fallback to sdist otherwise
pip install dist/*.whl || pip install dist/*.tar.gz

- name: Verify import & version
run: |
python - <<EOF
import pinecone
print("Imported OK, version:", pinecone.__version__)
from pinecone import Pinecone
EOF

- name: Check a few basic functions
run: |
python - <<EOF
from pinecone import Pinecone

pc = Pinecone()
print("Indexes:", pc.list_indexes())
print("Collections:", pc.list_collections())
print("Backups:", pc.list_backups())
print("Assistants:", pc.assistant.list_assistants())
print("Inference Models:", pc.inference.list_models())
EOF
env:
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
PINECONE_ADDITIONAL_HEADERS: ${{ vars.PINECONE_ADDITIONAL_HEADERS }}

install-windows:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 3
fail-fast: true
matrix:
os: [windows-latest]
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

- name: Install build tools
run: |
python -m pip install --upgrade pip setuptools wheel build

- name: Build sdist & wheel
run: python -m build --sdist --wheel

- name: Install from built artifacts
shell: pwsh
run: |
$wheels = Get-ChildItem -Path "dist" -Filter "*.whl"
$sdists = Get-ChildItem -Path "dist" -Filter "*.tar.gz"
if ($wheels) {
pip install $wheels[0].FullName
}
elseif ($sdists) {
pip install $sdists[0].FullName
}
else {
throw "No wheel or sdist found in dist/"
}

- name: Verify import & version
shell: pwsh
run: |
python -c "import pinecone; print('Imported OK, version:', pinecone.__version__)"

- name: Check a few basic functions
shell: pwsh
run: |
python -c "
from pinecone import Pinecone
pc = Pinecone()
print('Indexes:', pc.list_indexes())
print('Collections:', pc.list_collections())
print('Backups:', pc.list_backups())
print('Assistants:', pc.assistant.list_assistants())
print('Inference Models:', pc.inference.list_models())
"
env:
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
PINECONE_ADDITIONAL_HEADERS: ${{ vars.PINECONE_ADDITIONAL_HEADERS }}
56 changes: 0 additions & 56 deletions pinecone/scripts/repl.py

This file was deleted.

23 changes: 0 additions & 23 deletions pinecone/utils/repr_overrides.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import json
from datetime import datetime
import readline
import os
import atexit


def custom_serializer(obj):
Expand All @@ -23,23 +20,3 @@ def install_json_repr_override(klass):
klass.__repr__ = lambda self: json.dumps(
self.to_dict(), indent=4, sort_keys=False, default=custom_serializer
)


def setup_readline_history():
"""Setup readline history for the custom REPL."""
# Create .pinecone directory in user's home if it doesn't exist
history_dir = os.path.expanduser("~/.pinecone")
os.makedirs(history_dir, exist_ok=True)

# Set up history file
history_file = os.path.join(history_dir, "repl_history")

# Load history if it exists
if os.path.exists(history_file):
readline.read_history_file(history_file)

# Set history size
readline.set_history_length(1000)

# Save history on exit
atexit.register(readline.write_history_file, history_file)
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ pinecone-plugin-interface = "^0.0.7"
python-dateutil = ">=2.5.3"
aiohttp = { version = ">=3.9.0", optional = true }
aiohttp-retry = { version = "^2.9.1", optional = true }
pinecone-plugin-assistant = "^1.6.0"

[tool.poetry.group.types]
optional = true
Expand Down Expand Up @@ -98,7 +99,6 @@ urllib3_mock = "0.3.3"
responses = ">=0.8.1"
ruff = "^0.9.3"
beautifulsoup4 = "^4.13.3"
pinecone-plugin-assistant = "^1.6.0"
vprof = "^0.38"
tuna = "^0.5.11"
python-dotenv = "^1.1.0"
Expand Down