Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add plugin tests #1096

Merged
merged 17 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from 14 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/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ jobs:
export E2B_API_KEY=${{ secrets.E2B_API_KEY_STAGING }}

tox -e test -- -m 'not e2e and not swe'
- name: Plugin tests
if: matrix.python-version == '3.10'
run: |
Comment on lines +105 to +107

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary conditional for uploading test results. It should always upload regardless of the python version.

📝 Committable Code Suggestion

‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
- name: Plugin tests
if: matrix.python-version == '3.10'
run: |
name: Upload test results to Codecov
uses: codecov/test-results-action@v1

tox -e plugins
Comment on lines +105 to +108

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conditional for plugin tests is incorrect. It should execute when matrix.python-version == '3.9'.

📝 Committable Code Suggestion

‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
- name: Plugin tests
if: matrix.python-version == '3.10'
run: |
tox -e plugins
- name: Plugin tests
if: matrix.python-version == '3.9'
run: |
tox -e plugins

- if: matrix.python-version == '3.10'
name: Upload test results to Codecov
uses: codecov/test-results-action@v1
Expand Down
4 changes: 3 additions & 1 deletion python/composio/tools/local/codeanalysis/embedder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from typing import Any, Dict, List

from deeplake.core.vectorstore.deeplake_vectorstore import DeepLakeVectorStore
from sentence_transformers import SentenceTransformer

from composio.tools.local.codeanalysis.constants import (
CODE_MAP_CACHE,
angrybayblade marked this conversation as resolved.
Show resolved Hide resolved
angrybayblade marked this conversation as resolved.
Show resolved Hide resolved
angrybayblade marked this conversation as resolved.
Show resolved Hide resolved
angrybayblade marked this conversation as resolved.
Show resolved Hide resolved
angrybayblade marked this conversation as resolved.
Show resolved Hide resolved
angrybayblade marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -49,6 +48,9 @@ def get_vector_store(repo_name: str, overwrite: bool = True) -> DeepLakeVectorSt

class Embedding:
def __init__(self):
# pylint: disable=import-outside-toplevel
from sentence_transformers import SentenceTransformer

angrybayblade marked this conversation as resolved.
Show resolved Hide resolved
self.model = SentenceTransformer(EMBEDDER)

def compute(self, texts: List[str]) -> List[List[float]]:
angrybayblade marked this conversation as resolved.
Show resolved Hide resolved
angrybayblade marked this conversation as resolved.
Show resolved Hide resolved
angrybayblade marked this conversation as resolved.
Show resolved Hide resolved
angrybayblade marked this conversation as resolved.
Show resolved Hide resolved
angrybayblade marked this conversation as resolved.
Show resolved Hide resolved
angrybayblade marked this conversation as resolved.
Show resolved Hide resolved
angrybayblade marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Loading
Loading