From 0cf454165ab94ffc70051421f55242d83b0af42c Mon Sep 17 00:00:00 2001 From: Jen Hamon Date: Tue, 27 May 2025 09:46:08 -0400 Subject: [PATCH 1/6] Fix errors related to missing readline dependency --- pinecone/scripts/repl.py | 56 -------------------------------- pinecone/utils/repr_overrides.py | 23 ------------- 2 files changed, 79 deletions(-) delete mode 100644 pinecone/scripts/repl.py diff --git a/pinecone/scripts/repl.py b/pinecone/scripts/repl.py deleted file mode 100644 index 7fb4058a..00000000 --- a/pinecone/scripts/repl.py +++ /dev/null @@ -1,56 +0,0 @@ -import code -import logging -from pinecone.utils.repr_overrides import setup_readline_history - - -def setup_logging(): - # Create a custom formatter - formatter = logging.Formatter( - fmt="%(asctime)s | %(levelname)-8s | %(message)s", datefmt="%Y-%m-%d %H:%M:%S" - ) - - # Create and configure the console handler - console_handler = logging.StreamHandler() - console_handler.setFormatter(formatter) - - # Configure the root logger - root_logger = logging.getLogger() - root_logger.setLevel(logging.INFO) - root_logger.addHandler(console_handler) - - return root_logger - - -def main(): - # Set up logging - logger = setup_logging() - logger.info("Initializing environment...") - - # Set up readline history - setup_readline_history() - - # You can add any setup code here, such as: - # - Setting environment variables - # - Importing commonly used modules - # - Loading configuration files - - # Start the interactive REPL - banner = """ - Welcome to the custom Python REPL! - Your initialization steps have been completed. - """ - - # Create a custom namespace with any pre-loaded variables - namespace = { - "__name__": "__main__", - "__doc__": None, - "logger": logger, # Make logger available in REPL - # Add any other variables you want to have available in the REPL - } - - # Start the interactive console - code.interact(banner=banner, local=namespace) - - -if __name__ == "__main__": - main() diff --git a/pinecone/utils/repr_overrides.py b/pinecone/utils/repr_overrides.py index ce13e487..88860518 100644 --- a/pinecone/utils/repr_overrides.py +++ b/pinecone/utils/repr_overrides.py @@ -1,8 +1,5 @@ import json from datetime import datetime -import readline -import os -import atexit def custom_serializer(obj): @@ -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) From bdaf7a9e6645b901496063d8e1a98f6249fe722e Mon Sep 17 00:00:00 2001 From: Jen Hamon Date: Tue, 27 May 2025 11:50:36 -0400 Subject: [PATCH 2/6] Add windows install test --- .github/workflows/pr.yaml | 18 +++++---- .github/workflows/testing-install.yaml | 52 +++++++++++++++++++++++--- 2 files changed, 58 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 57ed758a..1d978d11 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -47,15 +47,19 @@ jobs: uses: './.github/workflows/testing-unit.yaml' secrets: inherit - integration-tests: - uses: './.github/workflows/testing-integration.yaml' - secrets: inherit - needs: unit-tests + # integration-tests: + # uses: './.github/workflows/testing-integration.yaml' + # secrets: inherit + # needs: unit-tests - dependency-tests: - uses: './.github/workflows/testing-dependency.yaml' + # dependency-tests: + # uses: './.github/workflows/testing-dependency.yaml' + # secrets: inherit + # needs: unit-tests + + testing-install: + uses: './.github/workflows/testing-install.yaml' secrets: inherit - needs: unit-tests package: name: Check packaging diff --git a/.github/workflows/testing-install.yaml b/.github/workflows/testing-install.yaml index 1afb21b2..e5396a53 100644 --- a/.github/workflows/testing-install.yaml +++ b/.github/workflows/testing-install.yaml @@ -2,18 +2,19 @@ name: Installation Tests on: workflow_call: + workflow_dispatch: + pull_request: permissions: contents: read pull-requests: write jobs: - test-install: - runs-on: ${{ matrix.os }} + test-install-linux: + runs-on: ubuntu-latest strategy: matrix: - os: [ubuntu-latest, windows-latest] - python: [3.9] + python: [3.9, 3.10, 3.11, 3.12, 3.13] steps: - name: Checkout code @@ -32,8 +33,8 @@ 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 @@ -42,3 +43,44 @@ jobs: import pinecone print("Imported OK, version:", pinecone.__version__) EOF + + test-install-windows: + runs-on: windows-latest + strategy: + matrix: + 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__)" From 50d8f202c1bc0826cdc14e5c1f4a3de2ed13aa0f Mon Sep 17 00:00:00 2001 From: Jen Hamon Date: Tue, 27 May 2025 17:10:29 -0400 Subject: [PATCH 3/6] Iterate on ci --- .github/workflows/testing-install.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing-install.yaml b/.github/workflows/testing-install.yaml index e5396a53..5d73f2ff 100644 --- a/.github/workflows/testing-install.yaml +++ b/.github/workflows/testing-install.yaml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: [3.9, 3.10, 3.11, 3.12, 3.13] + python: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - name: Checkout code @@ -48,7 +48,7 @@ jobs: runs-on: windows-latest strategy: matrix: - python: [3.9, 3.10, 3.11, 3.12, 3.13] + python: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - name: Checkout code uses: actions/checkout@v4 From 9d740481df9a63f1ed147e31ac4ba5941f541440 Mon Sep 17 00:00:00 2001 From: Jen Hamon Date: Wed, 28 May 2025 09:04:49 -0400 Subject: [PATCH 4/6] Add some basic checks --- .github/workflows/testing-install.yaml | 36 +++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing-install.yaml b/.github/workflows/testing-install.yaml index 5d73f2ff..71e8dc8e 100644 --- a/.github/workflows/testing-install.yaml +++ b/.github/workflows/testing-install.yaml @@ -11,9 +11,10 @@ permissions: jobs: test-install-linux: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: + os: [ubuntu-latest, macos-latest] python: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: @@ -42,8 +43,25 @@ jobs: python - < Date: Wed, 28 May 2025 09:14:56 -0400 Subject: [PATCH 5/6] Fix dependencies --- .github/workflows/testing-install.yaml | 7 ++++--- poetry.lock | 2 +- pyproject.toml | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/testing-install.yaml b/.github/workflows/testing-install.yaml index 71e8dc8e..0f108068 100644 --- a/.github/workflows/testing-install.yaml +++ b/.github/workflows/testing-install.yaml @@ -10,7 +10,7 @@ permissions: pull-requests: write jobs: - test-install-linux: + install: runs-on: ${{ matrix.os }} strategy: matrix: @@ -62,10 +62,11 @@ jobs: PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }} PINECONE_ADDITIONAL_HEADERS: ${{ vars.PINECONE_ADDITIONAL_HEADERS }} - test-install-windows: - runs-on: windows-latest + test-windows: + runs-on: ${{ matrix.os }} strategy: matrix: + os: [windows-latest] python: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - name: Checkout code diff --git a/poetry.lock b/poetry.lock index 823ed4af..0d4618a0 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1990,4 +1990,4 @@ grpc = ["googleapis-common-protos", "grpcio", "grpcio", "grpcio", "lz4", "protob [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "cc8b764abfc3d9ba774410ef118817c736c3c74a2bfa7f9f32a462628d804739" +content-hash = "6ec34aecf5d783b447124d4fbb752bff5321c1ba70a90e55734000f8f725d85d" diff --git a/pyproject.toml b/pyproject.toml index 098c423d..8ca2b635 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 @@ -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" From f74687851613e1461ec2284c2bc296717fd45268 Mon Sep 17 00:00:00 2001 From: Jen Hamon Date: Wed, 28 May 2025 09:21:50 -0400 Subject: [PATCH 6/6] Reenable other tests --- .github/workflows/pr.yaml | 16 ++++++++-------- .github/workflows/testing-install.yaml | 8 ++++++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 1d978d11..96a315d6 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -47,15 +47,15 @@ jobs: uses: './.github/workflows/testing-unit.yaml' secrets: inherit - # integration-tests: - # uses: './.github/workflows/testing-integration.yaml' - # secrets: inherit - # needs: unit-tests + integration-tests: + uses: './.github/workflows/testing-integration.yaml' + secrets: inherit + needs: unit-tests - # dependency-tests: - # uses: './.github/workflows/testing-dependency.yaml' - # secrets: inherit - # needs: unit-tests + dependency-tests: + uses: './.github/workflows/testing-dependency.yaml' + secrets: inherit + needs: unit-tests testing-install: uses: './.github/workflows/testing-install.yaml' diff --git a/.github/workflows/testing-install.yaml b/.github/workflows/testing-install.yaml index 0f108068..4b051ca1 100644 --- a/.github/workflows/testing-install.yaml +++ b/.github/workflows/testing-install.yaml @@ -3,7 +3,6 @@ name: Installation Tests on: workflow_call: workflow_dispatch: - pull_request: permissions: contents: read @@ -13,10 +12,13 @@ jobs: install: runs-on: ${{ matrix.os }} strategy: + max-parallel: 3 + fail-fast: true matrix: os: [ubuntu-latest, macos-latest] python: ['3.9', '3.10', '3.11', '3.12', '3.13'] + steps: - name: Checkout code uses: actions/checkout@v4 @@ -62,9 +64,11 @@ jobs: PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }} PINECONE_ADDITIONAL_HEADERS: ${{ vars.PINECONE_ADDITIONAL_HEADERS }} - test-windows: + 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']