mirror of
https://github.com/hwchase17/langchain.git
synced 2026-06-09 10:17:00 +00:00
chore: ban relative imports on all packages (#34691)
This commit is contained in:
@@ -89,8 +89,11 @@ from pydantic.v1 import BaseModel as BaseModelV1
|
||||
from typing_extensions import Self, is_typeddict
|
||||
|
||||
from langchain_ollama._compat import _convert_from_v1_to_ollama
|
||||
|
||||
from ._utils import merge_auth_headers, parse_url_with_auth, validate_model
|
||||
from langchain_ollama._utils import (
|
||||
merge_auth_headers,
|
||||
parse_url_with_auth,
|
||||
validate_model,
|
||||
)
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -9,7 +9,11 @@ from ollama import AsyncClient, Client
|
||||
from pydantic import BaseModel, ConfigDict, PrivateAttr, model_validator
|
||||
from typing_extensions import Self
|
||||
|
||||
from ._utils import merge_auth_headers, parse_url_with_auth, validate_model
|
||||
from langchain_ollama._utils import (
|
||||
merge_auth_headers,
|
||||
parse_url_with_auth,
|
||||
validate_model,
|
||||
)
|
||||
|
||||
|
||||
class OllamaEmbeddings(BaseModel, Embeddings):
|
||||
|
||||
@@ -15,7 +15,11 @@ from ollama import AsyncClient, Client, Options
|
||||
from pydantic import PrivateAttr, model_validator
|
||||
from typing_extensions import Self
|
||||
|
||||
from ._utils import merge_auth_headers, parse_url_with_auth, validate_model
|
||||
from langchain_ollama._utils import (
|
||||
merge_auth_headers,
|
||||
parse_url_with_auth,
|
||||
validate_model,
|
||||
)
|
||||
|
||||
|
||||
class OllamaLLM(BaseLLM):
|
||||
|
||||
@@ -83,6 +83,9 @@ unfixable = ["B028"] # People should intentionally tune the stacklevel
|
||||
convention = "google"
|
||||
ignore-var-parameters = true # ignore missing documentation for *args and **kwargs parameters
|
||||
|
||||
[tool.ruff.lint.flake8-tidy-imports]
|
||||
ban-relative-imports = "all"
|
||||
|
||||
[tool.ruff.lint.per-file-ignores]
|
||||
"tests/**" = ["D"] # ignore docstring checks for tests
|
||||
|
||||
|
||||
12
libs/partners/ollama/uv.lock
generated
12
libs/partners/ollama/uv.lock
generated
@@ -288,7 +288,7 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "langchain-core"
|
||||
version = "1.2.0"
|
||||
version = "1.2.7"
|
||||
source = { editable = "../../core" }
|
||||
dependencies = [
|
||||
{ name = "jsonpatch" },
|
||||
@@ -319,7 +319,7 @@ dev = [
|
||||
{ name = "jupyter", specifier = ">=1.0.0,<2.0.0" },
|
||||
{ name = "setuptools", specifier = ">=67.6.1,<68.0.0" },
|
||||
]
|
||||
lint = [{ name = "ruff", specifier = ">=0.13.1,<0.14.0" }]
|
||||
lint = [{ name = "ruff", specifier = ">=0.14.10,<0.15.0" }]
|
||||
test = [
|
||||
{ name = "blockbuster", specifier = ">=1.5.18,<1.6.0" },
|
||||
{ name = "freezegun", specifier = ">=1.2.2,<2.0.0" },
|
||||
@@ -341,7 +341,7 @@ test = [
|
||||
test-integration = []
|
||||
typing = [
|
||||
{ name = "langchain-text-splitters", directory = "../../text-splitters" },
|
||||
{ name = "mypy", specifier = ">=1.18.1,<1.19.0" },
|
||||
{ name = "mypy", specifier = ">=1.19.1,<1.20.0" },
|
||||
{ name = "types-pyyaml", specifier = ">=6.0.12.2,<7.0.0.0" },
|
||||
{ name = "types-requests", specifier = ">=2.28.11.5,<3.0.0.0" },
|
||||
]
|
||||
@@ -402,7 +402,7 @@ typing = [
|
||||
|
||||
[[package]]
|
||||
name = "langchain-tests"
|
||||
version = "1.0.2"
|
||||
version = "1.1.2"
|
||||
source = { editable = "../../standard-tests" }
|
||||
dependencies = [
|
||||
{ name = "httpx" },
|
||||
@@ -436,12 +436,12 @@ requires-dist = [
|
||||
]
|
||||
|
||||
[package.metadata.requires-dev]
|
||||
lint = [{ name = "ruff", specifier = ">=0.13.1,<0.14.0" }]
|
||||
lint = [{ name = "ruff", specifier = ">=0.14.10,<0.15.0" }]
|
||||
test = [{ name = "langchain-core", editable = "../../core" }]
|
||||
test-integration = []
|
||||
typing = [
|
||||
{ name = "langchain-core", editable = "../../core" },
|
||||
{ name = "mypy", specifier = ">=1.18.1,<1.19.0" },
|
||||
{ name = "mypy", specifier = ">=1.19.1,<1.20.0" },
|
||||
{ name = "types-pyyaml", specifier = ">=6.0.12.2,<7.0.0.0" },
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user