-
Notifications
You must be signed in to change notification settings - Fork 17.3k
text-splitters: Set strict mypy rules #30900
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ repository = "https://github.com/langchain-ai/langchain" | |
[dependency-groups] | ||
lint = ["ruff<1.0.0,>=0.9.2", "langchain-core"] | ||
typing = [ | ||
"mypy<2.0,>=1.10", | ||
"mypy<2.0,>=1.15", | ||
"lxml-stubs<1.0.0,>=0.5.1", | ||
"types-requests<3.0.0.0,>=2.31.0.20240218", | ||
"tiktoken<1.0.0,>=0.8.0", | ||
|
@@ -48,7 +48,11 @@ test_integration = [ | |
langchain-core = { path = "../core", editable = true } | ||
|
||
[tool.mypy] | ||
disallow_untyped_defs = "True" | ||
strict = "True" | ||
strict_bytes = "True" | ||
enable_error_code = "deprecated" | ||
report_deprecated_as_note = "True" | ||
|
||
[[tool.mypy.overrides]] | ||
module = [ | ||
"transformers", | ||
|
@@ -70,7 +74,7 @@ ignore_missing_imports = "True" | |
target-version = "py39" | ||
|
||
[tool.ruff.lint] | ||
select = ["E", "F", "I", "T201", "D"] | ||
select = ["E", "F", "I", "PGH003", "T201", "D"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can be done in a different PR There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, can be done in another PR |
||
ignore = ["D100"] | ||
|
||
[tool.coverage.run] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surprised we have to cast this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's because mypy can't figure the type so it uses
Any
which is incompatible with the method signature.