Skip to content
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

core: Add ruff rules TC #29268

Merged
merged 4 commits into from
Feb 26, 2025
Merged

core: Add ruff rules TC #29268

merged 4 commits into from
Feb 26, 2025

Conversation

cbornet
Copy link
Collaborator

@cbornet cbornet commented Jan 17, 2025

See https://docs.astral.sh/ruff/rules/#flake8-type-checking-tc
Some fixes done for TC001,TC002 and TC003 but these rules are excluded since they don't play well with Pydantic.

Copy link

vercel bot commented Jan 17, 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 Feb 26, 2025 7:35pm

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. 🤖:nit Small modifications/deletions, fixes, deps or improvements to existing code or docs labels Jan 17, 2025
@cbornet cbornet closed this Jan 21, 2025
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jan 21, 2025
@cbornet cbornet reopened this Jan 21, 2025
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Jan 21, 2025
@cbornet cbornet force-pushed the ruff-core-tch branch 4 times, most recently from 3da570b to 91555d0 Compare January 21, 2025 09:14
Copy link
Contributor

@efriis efriis left a comment

Choose a reason for hiding this comment

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

given the frequency with which this needs to be noqa for pydantic, I think this should be closed. Thoughts?

@cbornet
Copy link
Collaborator Author

cbornet commented Jan 25, 2025

given the frequency with which this needs to be noqa for pydantic, I think this should be closed. Thoughts?

I excluded TC001,TC002 and TC003 in be64878 so there won't be conflicts with Pydantic.
The other TC rules are still relevant and useful.

@cbornet cbornet changed the title core: Add ruff rules TCH core: Add ruff rules TC Jan 27, 2025
# Conflicts:
#	libs/core/langchain_core/utils/function_calling.py
#	libs/core/pyproject.toml
#	libs/core/tests/unit_tests/language_models/chat_models/test_base.py
@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Feb 26, 2025
@ccurme ccurme enabled auto-merge (squash) February 26, 2025 19:37
@ccurme ccurme merged commit b3885c1 into langchain-ai:master Feb 26, 2025
71 checks passed
@cbornet cbornet deleted the ruff-core-tch branch February 26, 2025 23:17
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
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants