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

add pydocstyle linting for ollama #27686

Merged
merged 5 commits into from
Oct 31, 2024
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
6 changes: 6 additions & 0 deletions libs/partners/ollama/langchain_ollama/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
"""This is the langchain_ollama package.

It provides infrastructure for interacting with the Ollama service.
"""


from importlib import metadata

from langchain_ollama.chat_models import ChatOllama
Expand Down
2 changes: 1 addition & 1 deletion libs/partners/ollama/langchain_ollama/chat_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def _lc_tool_call_to_openai_tool_call(tool_call: ToolCall) -> dict:


class ChatOllama(BaseChatModel):
"""Ollama chat model integration.
r"""Ollama chat model integration.

.. dropdown:: Setup
:open:
Expand Down
1 change: 1 addition & 0 deletions libs/partners/ollama/langchain_ollama/embeddings.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Ollama embeddings models."""
from typing import (
List,
Optional,
Expand Down
15 changes: 14 additions & 1 deletion libs/partners/ollama/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,20 @@ ollama = ">=0.3.0,<1"
langchain-core = "^0.3.0"

[tool.ruff.lint]
select = ["E", "F", "I", "T201"]
select = [
"E", # pycodestyle
"F", # pyflakes
"I", # isort
"T201", # print
"D", # pydocstyle

]

[tool.ruff.lint.pydocstyle]
convention = "google"

[tool.ruff.lint.per-file-ignores]
"tests/**" = ["D"] # ignore docstring checks for tests

[tool.coverage.run]
omit = ["tests/*"]
Expand Down
1 change: 1 addition & 0 deletions libs/partners/ollama/scripts/check_imports.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""load multiple Python files specified as command line arguments."""
import sys
import traceback
from importlib.machinery import SourceFileLoader
Expand Down
Loading