Updates after review and added Makefile targets for publishing

This commit is contained in:
dhirup
2025-07-25 16:50:57 -07:00
parent 37ffcad850
commit 4a0d8a71ed
4 changed files with 27 additions and 9 deletions

View File

@@ -8,10 +8,13 @@ RUFF := .venv/bin/ruff
PYTEST := .venv/bin/pytest
MYPY := .venv/bin/mypy
PACKAGE_NAME=langchain-coherence
DIST_DIR=dist
install:
@echo "🔧 Installing all dependencies..."
uv venv
uv pip install -e .[lint,typing,test,docs]
uv pip install -e .[lint,typing,test,docs,publish]
update-dev:
@echo "🔄 Updating development dependencies..."
@@ -51,7 +54,17 @@ test:
clean:
@echo "🧹 Cleaning build/test artifacts..."
rm -rf .pytest_cache .mypy_cache .ruff_cache .venv .uv __pycache__ *.egg-info dist build
rm -rf .pytest_cache .mypy_cache .ruff_cache __pycache__ *.egg-info dist build
build:
@echo "🧱 Building distribution using local virtualenv"
$(PYTHON) -m build --no-isolation
upload-pypi:
@echo "🚀 Uploading to PyPI"
$(PYTHON) -m twine upload dist/*
publish: build upload-pypi
help:
@echo "🛠 Available Make targets:"
@@ -63,6 +76,9 @@ help:
@echo " lint - Run linter and mypy"
@echo " fix - Autoformat and fix issues"
@echo " test - Run all tests"
@echo " build - Building distribution using local virtualenv"
@echo " upload-pypi - Uploading to PyPI"
@echo " publish - calls build, upload-pypi"
@echo " clean - Remove temp and build files"

View File

@@ -378,7 +378,7 @@ class CoherenceVectorStore(VectorStore):
async def asimilarity_search(
self, query: str, k: int = 4, **kwargs: Any
) -> list[Document]:
"""Async method return docs most similar to query.
"""Async method return list of docs most similar to query.
Args:
query: Input text.
@@ -423,7 +423,7 @@ class CoherenceVectorStore(VectorStore):
async def asimilarity_search_by_vector(
self, embedding: list[float], k: int = 4, **kwargs: Any
) -> list[Document]:
"""Async method return docs most similar to passed embedding vector.
"""Async method return list of docs most similar to passed embedding vector.
Args:
embedding: Input vector.
@@ -466,7 +466,7 @@ class CoherenceVectorStore(VectorStore):
async def asimilarity_search_with_score(
self, query: str, k: int = 4, **kwargs: Any
) -> list[tuple[Document, float]]:
"""Async method return list tuple(Document, score) most similar to query.
"""Async method return list of tuple(Document, score) most similar to query.
Args:
query: Input text.
@@ -529,7 +529,7 @@ class CoherenceVectorStore(VectorStore):
metadatas: Optional[list[dict[str, Any]]] = None,
**kwargs: Any,
) -> CoherenceVectorStore:
"""Asynchronously initialize CoherenceVectorStore from texts and embeddings.
"""Asynchronously initialize the CoherenceVectorStore from texts and embeddings.
Args:
texts: List of input text strings.
@@ -539,7 +539,6 @@ class CoherenceVectorStore(VectorStore):
- cache: Required Coherence NamedCache[str, Document] instance.
- ids: Optional list of document IDs.
Returns:
CoherenceVectorStore: An initialized and populated vector store.

View File

@@ -32,7 +32,10 @@ docs = [
"jupytext>=1.16",
"nbdoc>=0.0.29",
]
publish = [
"build",
"twine"
]
[tool.mypy]
strict = "True"
disallow_untyped_defs = "True"

View File

@@ -1336,7 +1336,7 @@ wheels = [
[[package]]
name = "langchain-coherence"
version = "0.0.1.dev0"
version = "0.0.1"
source = { virtual = "." }
dependencies = [
{ name = "coherence-client" },