From 200e5439cbc845d0eb5b6ba63dc5e839bcd18818 Mon Sep 17 00:00:00 2001 From: theanupllm <theanupdas@protonmail.com> Date: Tue, 4 Feb 2025 22:16:55 +0530 Subject: [PATCH] chore: Update GitHub Actions workflow for Python testing - Uncomment and enable multiple Python versions (3.10, 3.11, 3.12, 3.13) - Enable Poetry caching in GitHub Actions - Remove local path addition comment - Simplify workflow configuration --- .github/workflows/test.yml | 27 ++++++++++++++------------- semantic_router/routers/base.py | 5 +---- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 99e2dcd9..1d01de9c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,19 +22,19 @@ jobs: strategy: matrix: python-version: - # - "3.10" - # - "3.11" - # - "3.12" + - "3.10" + - "3.11" + - "3.12" - "3.13" steps: - uses: actions/checkout@v4 - # - name: Cache Poetry - # uses: actions/cache@v4 - # with: - # path: ~/.poetry - # key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} - # restore-keys: | - # ${{ runner.os }}-poetry- + - name: Cache Poetry + uses: actions/cache@v4 + with: + path: ~/.poetry + key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} + restore-keys: | + ${{ runner.os }}-poetry- - name: Wait for Pinecone service to start run: | @@ -48,10 +48,11 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - # cache: poetry + cache: poetry - - name: Add Poetry to PATH - run: echo "PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV + # only needed for local testing + # - name: Add Poetry to PATH + # run: echo "PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV - name: Install dependencies run: | diff --git a/semantic_router/routers/base.py b/semantic_router/routers/base.py index 18456af0..fd737955 100644 --- a/semantic_router/routers/base.py +++ b/semantic_router/routers/base.py @@ -20,7 +20,6 @@ from semantic_router.encoders import ( from semantic_router.index.base import BaseIndex from semantic_router.index.local import LocalIndex from semantic_router.index.pinecone import PineconeIndex -from semantic_router.index.pinecone_local import PineconeLocalIndex from semantic_router.index.qdrant import QdrantIndex from semantic_router.llms import BaseLLM, OpenAILLM from semantic_router.route import Route @@ -397,9 +396,7 @@ class BaseRouter(BaseModel): dims = len(self.encoder(["test"])[0]) self.index.dimensions = dims # now init index - if isinstance(self.index, PineconeIndex) or isinstance( - self.index, PineconeLocalIndex - ): + if isinstance(self.index, PineconeIndex): self.index.index = self.index._init_index(force_create=True) # run auto sync if active -- GitLab