Skip to content

Commit 5e8cb58

Browse files
authored
refactor(text-splitters): drop python 3.9 (#33212)
1 parent 740ad00 commit 5e8cb58

File tree

4 files changed

+112
-101
lines changed

4 files changed

+112
-101
lines changed

libs/text-splitters/langchain_text_splitters/html.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,7 @@ def _find_all_strings(
6969
*,
7070
recursive: bool = True,
7171
) -> ResultSet[NavigableString]:
72-
return cast(
73-
"ResultSet[NavigableString]", tag.find_all(string=True, recursive=recursive)
74-
)
72+
return tag.find_all(string=True, recursive=recursive)
7573

7674

7775
def _find_all_tags(
@@ -80,7 +78,7 @@ def _find_all_tags(
8078
name: bool | str | list[str] | None = None,
8179
recursive: bool = True,
8280
) -> ResultSet[Tag]:
83-
return cast("ResultSet[Tag]", tag.find_all(name, recursive=recursive))
81+
return tag.find_all(name, recursive=recursive)
8482

8583

8684
class HTMLHeaderTextSplitter:

libs/text-splitters/langchain_text_splitters/jsx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""JavaScript framework text splitter."""
22

33
import re
4-
from typing import Any, Optional
4+
from typing import Any
55

66
from langchain_text_splitters import RecursiveCharacterTextSplitter
77

@@ -27,7 +27,7 @@ class JSFrameworkTextSplitter(RecursiveCharacterTextSplitter):
2727

2828
def __init__(
2929
self,
30-
separators: Optional[list[str]] = None,
30+
separators: list[str] | None = None,
3131
chunk_size: int = 2000,
3232
chunk_overlap: int = 0,
3333
**kwargs: Any,

libs/text-splitters/pyproject.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ authors = []
77
license = { text = "MIT" }
88
requires-python = ">=3.10.0,<4.0.0"
99
dependencies = [
10-
"langchain-core>=0.3.75,<2.0.0",
10+
"langchain-core>=1.0.0a6,<2.0.0",
1111
]
1212
name = "langchain-text-splitters"
1313
version = "0.3.11"
@@ -65,9 +65,6 @@ warn_unreachable = true
6565
module = ["konlpy", "nltk",]
6666
ignore_missing_imports = true
6767

68-
[tool.ruff]
69-
target-version = "py39"
70-
7168
[tool.ruff.format]
7269
docstring-code-format = true
7370

0 commit comments

Comments
 (0)