Skip to content

core: Improve mypy config #30737

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

Merged
merged 4 commits into from
Apr 11, 2025
Merged

core: Improve mypy config #30737

merged 4 commits into from
Apr 11, 2025

Conversation

cbornet
Copy link
Collaborator

@cbornet cbornet commented Apr 9, 2025

  • 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

Copy link

vercel bot commented Apr 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Apr 11, 2025 8:32pm

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. 🤖:nit Small modifications/deletions, fixes, deps or improvements to existing code or docs labels Apr 9, 2025
@cbornet cbornet force-pushed the core-mypy branch 2 times, most recently from 135df9b to 7a54bb0 Compare April 9, 2025 10:00
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Apr 9, 2025
@cbornet cbornet force-pushed the core-mypy branch 3 times, most recently from c38fc60 to 291251c Compare April 9, 2025 10:20
@cbornet cbornet force-pushed the core-mypy branch 4 times, most recently from 3ace697 to d397ed4 Compare April 9, 2025 12:55
@@ -738,20 +736,17 @@ def test_tool_outputs() -> None:
assert not response.tool_calls


@pytest.mark.parametrize("use_extension_typed_dict", [True, False])
@pytest.mark.parametrize("use_extension_annotated", [True, False])
@pytest.mark.parametrize("typed_dict", [ExtensionsTypedDict, TypingTypedDict])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(not important) -- any chance you know whether this will render nicely when looking at pytest output?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not very nicely, no.
I’ll add tags to make it pretty.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Collaborator

@eyurtsev eyurtsev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! we can merge

@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Apr 9, 2025
Copy link

codspeed-hq bot commented Apr 10, 2025

CodSpeed Performance Report

Merging #30737 will degrade performances by 32.02%

Comparing cbornet:core-mypy (088c606) with master (63c16f5)

Summary

❌ 1 regressions
✅ 7 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
test_import_time[InMemoryVectorStore] 1.1 s 1.6 s -32.02%

@cbornet cbornet force-pushed the core-mypy branch 6 times, most recently from e4bae5c to c95f8d4 Compare April 11, 2025 08:52
@cbornet cbornet force-pushed the core-mypy branch 3 times, most recently from 98231dd to aaf547d Compare April 11, 2025 09:23
@cbornet cbornet requested a review from eyurtsev April 11, 2025 13:32
@eyurtsev eyurtsev merged commit 42944f3 into langchain-ai:master Apr 11, 2025
74 checks passed
sydney-runkle added a commit that referenced this pull request Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm PR looks good. Use to confirm that a PR is ready for merging. 🤖:nit Small modifications/deletions, fixes, deps or improvements to existing code or docs size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants