langchain - ✅(Solved) Fix fix(infra): lint_diff uses incorrect relative paths in multiple package Makefiles [1 pull requests, 1 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
langchain-ai/langchain#36332Fetched 2026-04-08 01:40:53
View on GitHub
Comments
1
Participants
1
Timeline
10
Reactions
0
Participants
Timeline (top)
labeled ×5closed ×1commented ×1cross-referenced ×1

On current master, lint_diff/format_diff in multiple package Makefiles use incorrect git diff --relative paths.

Expected behavior: Each Makefile should compute changed files relative to its own package directory.

Actual behavior: Some Makefiles point to other package paths or a typo path, so changed-file linting can target incorrect files or skip intended package-local changes.

Impact: Contributor local validation becomes unreliable and issues may only appear later in CI.

Scope: Infra-only bugfix; no public API/runtime behavior changes.

Error Message

AssertionError: libs/langchain_v1/Makefile has incorrect --relative path. Expected to include: git diff --relative=libs/langchain_v1

Root Cause

On current master, lint_diff/format_diff in multiple package Makefiles use incorrect git diff --relative paths.

Expected behavior: Each Makefile should compute changed files relative to its own package directory.

Actual behavior: Some Makefiles point to other package paths or a typo path, so changed-file linting can target incorrect files or skip intended package-local changes.

Impact: Contributor local validation becomes unreliable and issues may only appear later in CI.

Scope: Infra-only bugfix; no public API/runtime behavior changes.

Fix Action

Fix / Workaround

  • This is a bug, not a usage question.
  • I added a clear and descriptive title that summarizes this issue.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
  • This is not related to the langchain-community package.
  • I posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS.

PR fix notes

PR #36333: fix(infra): correct lint_diff relative paths in package makefiles

Description (problem / solution / changelog)

Fixes #36332

Corrected lint_diff/format_diff relative path settings in three package Makefiles so changed-file linting runs against the correct package scope. This is an infra-only fix and does not change runtime behavior.

How did you verify your code works?

  • make -n -C libs/langchain_v1 lint_diff
  • make -n -C libs/text-splitters lint_diff
  • make -n -C libs/partners/mistralai lint_diff
  • Confirmed only the three Makefiles are changed, with no uv.lock or pyproject.toml updates.

AI assistance disclaimer: I used AI assistance to draft and review this contribution.

Changed files

  • libs/langchain_v1/Makefile (modified, +1/-1)
  • libs/partners/mistralai/Makefile (modified, +1/-1)
  • libs/text-splitters/Makefile (modified, +1/-1)

Code Example

from pathlib import Path

cases = {
"libs/langchain_v1/Makefile": "git diff --relative=libs/langchain_v1",
"libs/text-splitters/Makefile": "git diff --relative=libs/text-splitters",
"libs/partners/mistralai/Makefile": "git diff --relative=libs/partners/mistralai",
}

for file_path, expected in cases.items():
text = Path(file_path).read_text(encoding="utf-8")
lint_diff_line = next(
line for line in text.splitlines()
if line.startswith("lint_diff format_diff:")
)
print(file_path, "->", lint_diff_line)
assert expected in lint_diff_line, (
f"{file_path} has incorrect --relative path. "
f"Expected to include: {expected}"
)

---

AssertionError: libs/langchain_v1/Makefile has incorrect --relative path. Expected to include: git diff --relative=libs/langchain_v1
RAW_BUFFERClick to expand / collapse

Checked other resources

  • This is a bug, not a usage question.
  • I added a clear and descriptive title that summarizes this issue.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
  • This is not related to the langchain-community package.
  • I posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS.

Package (Required)

  • langchain
  • langchain-openai
  • langchain-anthropic
  • langchain-classic
  • langchain-core
  • langchain-model-profiles
  • langchain-tests
  • langchain-text-splitters
  • langchain-chroma
  • langchain-deepseek
  • langchain-exa
  • langchain-fireworks
  • langchain-groq
  • langchain-huggingface
  • langchain-mistralai
  • langchain-nomic
  • langchain-ollama
  • langchain-openrouter
  • langchain-perplexity
  • langchain-qdrant
  • langchain-xai
  • Other / not sure / general

Related Issues / PRs

No response

Reproduction Steps / Example Code (Python)

from pathlib import Path

cases = {
"libs/langchain_v1/Makefile": "git diff --relative=libs/langchain_v1",
"libs/text-splitters/Makefile": "git diff --relative=libs/text-splitters",
"libs/partners/mistralai/Makefile": "git diff --relative=libs/partners/mistralai",
}

for file_path, expected in cases.items():
text = Path(file_path).read_text(encoding="utf-8")
lint_diff_line = next(
line for line in text.splitlines()
if line.startswith("lint_diff format_diff:")
)
print(file_path, "->", lint_diff_line)
assert expected in lint_diff_line, (
f"{file_path} has incorrect --relative path. "
f"Expected to include: {expected}"
)

Error Message and Stack Trace (if applicable)

AssertionError: libs/langchain_v1/Makefile has incorrect --relative path. Expected to include: git diff --relative=libs/langchain_v1

Description

On current master, lint_diff/format_diff in multiple package Makefiles use incorrect git diff --relative paths.

Expected behavior: Each Makefile should compute changed files relative to its own package directory.

Actual behavior: Some Makefiles point to other package paths or a typo path, so changed-file linting can target incorrect files or skip intended package-local changes.

Impact: Contributor local validation becomes unreliable and issues may only appear later in CI.

Scope: Infra-only bugfix; no public API/runtime behavior changes.

System Info

System Information

OS: Linux OS Version: #19~24.04.2-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 6 23:08:46 UTC 2 Python Version: 3.12.3 (main, Mar 3 2026, 12:15:18) [GCC 13.3.0]

Package Information

Optional packages not installed

langsmith deepagents deepagents-cli

extent analysis

Fix Plan

To fix the issue, we need to update the lint_diff lines in the Makefiles to use the correct --relative paths.

  • Update the lint_diff lines in the Makefiles to use the correct --relative paths:
    • For libs/langchain_v1/Makefile, use git diff --relative=libs/langchain_v1
    • For libs/text-splitters/Makefile, use git diff --relative=libs/text-splitters
    • For libs/partners/mistralai/Makefile, use git diff --relative=libs/partners/mistralai

Example code:

from pathlib import Path

cases = {
    "libs/langchain_v1/Makefile": "git diff --relative=libs/langchain_v1",
    "libs/text-splitters/Makefile": "git diff --relative=libs/text-splitters",
    "libs/partners/mistralai/Makefile": "git diff --relative=libs/partners/mistralai",
}

for file_path, expected in cases.items():
    text = Path(file_path).read_text(encoding="utf-8")
    lines = text.splitlines()
    for i, line in enumerate(lines):
        if line.startswith("lint_diff format_diff:"):
            lines[i] = f"lint_diff format_diff: {expected}"
            break
    Path(file_path).write_text("\n".join(lines), encoding="utf-8")

Verification

To verify that the fix worked, run the test code again and check that the AssertionError is no longer raised.

Extra Tips

  • Make sure to update the Makefiles in the correct branches (e.g. master) to ensure the fix is applied to the correct codebase.
  • Consider adding automated tests to catch similar issues in the future.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

langchain - ✅(Solved) Fix fix(infra): lint_diff uses incorrect relative paths in multiple package Makefiles [1 pull requests, 1 comments, 1 participants]