mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-23 03:19:38 +00:00
core: Improve mypy config (#30737)
* Cleanup mypy config * Add mypy `strict` rules except `disallow_any_generics`, `warn_return_any` and `strict_equality` (TODO) * Add mypy `strict_byte` rule * Add mypy support for PEP702 `@deprecated` decorator * Bump mypy version to 1.15 --------- Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
This commit is contained in:
committed by
GitHub
parent
bb2c2fd885
commit
42944f3499
@@ -49,7 +49,7 @@ async def test_async_callbacks_in_sync(benchmark: BenchmarkFixture) -> None:
|
||||
infinite_cycle = cycle([AIMessage(content=" ".join(["hello", "goodbye"] * 500))])
|
||||
model = GenericFakeChatModel(messages=infinite_cycle)
|
||||
|
||||
@benchmark
|
||||
@benchmark # type: ignore[misc]
|
||||
def sync_callbacks() -> None:
|
||||
for _ in range(5):
|
||||
for _ in model.stream("meow", {"callbacks": [MyCustomAsyncHandler()]}):
|
||||
|
@@ -49,6 +49,6 @@ from pytest_benchmark.fixture import BenchmarkFixture # type: ignore[import-unt
|
||||
)
|
||||
@pytest.mark.benchmark
|
||||
def test_import_time(benchmark: BenchmarkFixture, import_path: str) -> None:
|
||||
@benchmark
|
||||
@benchmark # type: ignore[misc]
|
||||
def import_in_subprocess() -> None:
|
||||
subprocess.run([sys.executable, "-c", import_path], check=False)
|
||||
|
Reference in New Issue
Block a user