Skip to content

Conversation

@cbornet
Copy link
Collaborator

@cbornet cbornet commented Sep 3, 2025

No description provided.

@vercel
Copy link

vercel bot commented Sep 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
langchain Ignored Ignored Preview Oct 2, 2025 3:55pm

@cbornet cbornet force-pushed the langchain_v1-clean-ruff branch from d14e4fa to 59398e8 Compare September 3, 2025 22:18
@codspeed-hq
Copy link

codspeed-hq bot commented Sep 3, 2025

CodSpeed WallTime Performance Report

Merging #32810 will not alter performance

Comparing cbornet:langchain_v1-clean-ruff (8df9205) with master (00e547c)

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

✅ 13 untouched benchmarks

@codspeed-hq
Copy link

codspeed-hq bot commented Sep 3, 2025

CodSpeed Instrumentation Performance Report

Merging #32810 will not alter performance

Comparing cbornet:langchain_v1-clean-ruff (8df9205) with master (00e547c)

Summary

✅ 14 untouched benchmarks

@cbornet cbornet force-pushed the langchain_v1-clean-ruff branch from 59398e8 to d64fe41 Compare September 3, 2025 22:27
@cbornet cbornet force-pushed the langchain_v1-clean-ruff branch 8 times, most recently from 0982a5d to 2e4faa7 Compare September 4, 2025 12:53
@mdrxy mdrxy changed the title chore(langchain): cleanup langchain_v1 ruff config chore(langchain): cleanup langchain_v1 ruff config Sep 4, 2025
@mdrxy mdrxy added the linting Linting, formatting, typing, or style label Sep 4, 2025
@mdrxy mdrxy self-assigned this Sep 4, 2025
@mdrxy mdrxy added the langchain Related to the package `langchain` label Sep 4, 2025
@cbornet cbornet force-pushed the langchain_v1-clean-ruff branch 3 times, most recently from 94b4082 to 72ec713 Compare September 8, 2025 15:40
@mdrxy mdrxy requested a review from Copilot September 8, 2025 21:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR cleans up the ruff configuration for langchain_v1 by removing outdated per-file ignores and applying various linting fixes across the codebase. The changes include updating ruff version constraints, consolidating linting rules, and implementing hundreds of code quality improvements.

Key Changes:

  • Simplified ruff configuration by removing complex per-file ignore patterns
  • Updated code to comply with modern Python linting standards including proper import ordering, exception handling, and naming conventions
  • Removed unused test utilities and improved type annotations throughout

Reviewed Changes

Copilot reviewed 29 out of 30 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
libs/langchain_v1/pyproject.toml Updated ruff configuration with simplified rules and version constraints
libs/langchain_v1/tests/unit_tests/stubs.py Removed entire file containing unused test stub utilities
libs/langchain_v1/tests/unit_tests/embeddings/test_caching.py Added @OverRide decorators to MockEmbeddings methods
libs/langchain_v1/tests/unit_tests/embeddings/test_base.py Fixed regex pattern in pytest.raises assertion
libs/langchain_v1/tests/unit_tests/chat_models/test_chat_models.py Fixed regex pattern in pytest.raises assertion
libs/langchain_v1/tests/unit_tests/agents/test_tool_node.py Added periods to docstrings and improved exception handling
libs/langchain_v1/tests/unit_tests/agents/test_return_direct_spec.py Added keyword-only parameter to _make_tool function
libs/langchain_v1/tests/unit_tests/agents/test_responses_spec.py Renamed variable from InputModel to input_model for naming consistency
libs/langchain_v1/tests/unit_tests/agents/test_responses.py Replaced string equality checks with truthiness checks
libs/langchain_v1/tests/unit_tests/agents/test_response_format.py Improved import ordering and docstring formatting
libs/langchain_v1/tests/unit_tests/agents/test_react_agent.py Multiple improvements including variable naming, exception handling, and docstring formatting
libs/langchain_v1/tests/unit_tests/agents/test_middleware_agent.py Improved import ordering and exception handling patterns
libs/langchain_v1/tests/unit_tests/agents/model.py Added period to docstring
libs/langchain_v1/tests/unit_tests/agents/messages.py Added noqa comments for function naming conventions
libs/langchain_v1/tests/unit_tests/agents/conftest.py Changed tuple to set for membership testing
libs/langchain_v1/tests/unit_tests/agents/any_str.py Added slots definition to AnyStr class
libs/langchain_v1/tests/integration_tests/chat_models/test_base.py Renamed class from multiply to Multiply for proper naming
libs/langchain_v1/tests/integration_tests/cache/fake_embeddings.py Added @OverRide decorators to embedding methods
libs/langchain_v1/scripts/check_imports.py Improved docstring formatting
libs/langchain_v1/langchain/chat_models/base.py Added @OverRide decorators and improved string splitting logic
libs/langchain_v1/langchain/agents/tool_node.py Renamed parameter from input to input_ and improved exception handling
libs/langchain_v1/langchain/agents/structured_output.py Changed tuple to set for membership testing
libs/langchain_v1/langchain/agents/react_agent.py Improved variable naming and exception handling
libs/langchain_v1/langchain/agents/middleware_agent.py Improved exception chaining
libs/langchain_v1/langchain/agents/middleware/summarization.py Improved exception handling patterns
libs/langchain_v1/langchain/agents/middleware/prompt_caching.py Renamed parameter from type to cache_type and improved exception handling
libs/langchain_v1/langchain/agents/interrupt.py Reordered Union type arguments
libs/langchain_v1/langchain/_internal/_prompts.py Reordered Union type arguments
libs/langchain_v1/langchain/init.py Removed noqa comment for ANN401 rule

@mdrxy
Copy link
Member

mdrxy commented Sep 8, 2025

hmm

@cbornet cbornet force-pushed the langchain_v1-clean-ruff branch 3 times, most recently from 66cb167 to e131f7a Compare September 9, 2025 15:36
@sydney-runkle
Copy link
Collaborator

@cbornet happy to try to help move this forward now that we're settled on v1 :)

@mdrxy mdrxy changed the title chore(langchain_v1): cleanup ruff config chore(langchain): cleanup ruff config Nov 7, 2025
@github-actions github-actions bot added infra Chores, devops, repo meta changes and removed linting Linting, formatting, typing, or style labels Nov 7, 2025
@cbornet cbornet force-pushed the langchain_v1-clean-ruff branch from 75f99ee to fff52f9 Compare November 9, 2025 18:25
@cbornet
Copy link
Collaborator Author

cbornet commented Nov 9, 2025

@sydney-runkle thanks! I rebased to fix the latest conflicts.

Copy link
Member

@mdrxy mdrxy left a comment

Choose a reason for hiding this comment

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

Good with me other than the comment

def __init__(
self,
pii_type: Literal["email", "credit_card", "ip", "mac_address", "url"] | str, # noqa: PYI051
pii_type: str,
Copy link
Member

Choose a reason for hiding this comment

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

Yes, however, the Literal definitions allow for IDE auto-completion/to display a list of valid options. I think this is better DevX even if it isn't the most efficient.

@mdrxy
Copy link
Member

mdrxy commented Nov 10, 2025

off to @sydney-runkle for approval

@cbornet cbornet force-pushed the langchain_v1-clean-ruff branch 4 times, most recently from 8d31981 to 87f2a8b Compare November 14, 2025 11:13
@cbornet cbornet force-pushed the langchain_v1-clean-ruff branch 2 times, most recently from 8f9c1fe to 241dd37 Compare November 18, 2025 14:34
@cbornet
Copy link
Collaborator Author

cbornet commented Nov 18, 2025

Hi @sydney-runkle , can you review this PR ? It applies reordering of the imports so it has a great tendency of conflicting.
I've already rebased it at least 10 times due to conflicts...

@cbornet cbornet force-pushed the langchain_v1-clean-ruff branch from 241dd37 to 5a2b067 Compare November 18, 2025 14:38
@cbornet cbornet force-pushed the langchain_v1-clean-ruff branch from 5a2b067 to 47e8382 Compare November 21, 2025 00:09
@cbornet cbornet force-pushed the langchain_v1-clean-ruff branch from 47e8382 to 6109991 Compare November 21, 2025 15:16
@cbornet cbornet changed the title chore(langchain): cleanup ruff config chore(langchain-v1): cleanup ruff config Nov 26, 2025
@github-actions github-actions bot added infra Chores, devops, repo meta changes and removed infra Chores, devops, repo meta changes labels Nov 26, 2025
@cbornet cbornet changed the title chore(langchain-v1): cleanup ruff config chore(langchain): cleanup ruff config Nov 26, 2025
@github-actions github-actions bot added infra Chores, devops, repo meta changes and removed infra Chores, devops, repo meta changes labels Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file infra Chores, devops, repo meta changes langchain Related to the package `langchain` v1 Issue specific to LangChain 1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants