chore: ban relative imports on all packages (#34691)

This commit is contained in:
Mason Daugherty
2026-01-09 17:02:24 -05:00
committed by GitHub
parent 8e824d9ec4
commit 18c25e9f10
33 changed files with 197 additions and 62 deletions

View File

@@ -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__)

View File

@@ -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):

View File

@@ -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):

View File

@@ -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

View File

@@ -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" },
]