[PR #1445] [MERGED] feat(ci): validate imports from langchain #1571

Closed
opened 2026-02-17 17:22:30 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/docs/pull/1445
Author: @mdrxy
Created: 11/15/2025
Status: Merged
Merged: 11/22/2025
Merged by: @mdrxy

Base: mainHead: mdrxy/import-mappings


📝 Commits (10+)

📊 Changes

7 files changed (+1537 additions, -0 deletions)

View changed files

.github/workflows/check-import-mappings.yml (+115 -0)
.github/workflows/check-pr-imports.yml (+139 -0)
scripts/__init__.py (+1 -0)
scripts/check_import_mappings.py (+255 -0)
scripts/check_pr_imports.py (+241 -0)
scripts/import_mappings.json (+471 -0)
tests/unit_tests/test_check_pr_imports.py (+315 -0)

📄 Description

Introduces an automated system to detecting and manage incorrect imports from langchain_core in favor of using the re-exports from langchain.

  • Added check-import-mappings.yml workflow to periodically analyze the latest version of langchain_core, check for re-exports in langchain (and generate import_mappings.json), and automatically create PRs to update the mappings cache in this repo.
  • Added check_import_mappings.py to fetch latest package releases, introspect langchain public __init__ files, and generate a detailed mapping of re-exported members from langchain_core. Uses the previous local import_mappings.json
  • Added check-pr-imports.yml workflow to run on PRs, ensuring inbound contributions use langchain imports when available, and comment on PRs with specific guidance if issues are found.
    • Uses check_pr_imports.py to analyze PR diffs against the import mappings, detect incorrect langchain_core imports, and output suggested fixes for contributors.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/docs/pull/1445 **Author:** [@mdrxy](https://github.com/mdrxy) **Created:** 11/15/2025 **Status:** ✅ Merged **Merged:** 11/22/2025 **Merged by:** [@mdrxy](https://github.com/mdrxy) **Base:** `main` ← **Head:** `mdrxy/import-mappings` --- ### 📝 Commits (10+) - [`d6db5a1`](https://github.com/langchain-ai/docs/commit/d6db5a1e4a6c5dd82197ed0d177963d6675fd440) feat(infra): validate imports from `langchain` - [`1295bb8`](https://github.com/langchain-ai/docs/commit/1295bb8b9efe5b022d1747be252d79c30dfe44d8) fix - [`0099bf5`](https://github.com/langchain-ai/docs/commit/0099bf52a67e8e083ab40bcc1823722fe8c9d74d) fix - [`fd69f39`](https://github.com/langchain-ai/docs/commit/fd69f397f4cd9e063791586bd44dc955bfd39476) Merge branch 'main' into mdrxy/import-mappings - [`162caa3`](https://github.com/langchain-ai/docs/commit/162caa397c8b9ed0c570a2524830be81847bd057) Apply suggestion from @Copilot - [`2cbbbed`](https://github.com/langchain-ai/docs/commit/2cbbbed00cea714f0caed02ece94a7cad7d95adc) cr - [`7734d50`](https://github.com/langchain-ai/docs/commit/7734d50e740353fb0f0583e18e753e99204fe010) Merge branch 'main' into mdrxy/import-mappings - [`9c2bbe0`](https://github.com/langchain-ai/docs/commit/9c2bbe018bd3a592e44d38645e4cd27428967ff7) cr - [`cf121b3`](https://github.com/langchain-ai/docs/commit/cf121b3efafaf7e249723ac10fed6d551b807ce6) cr - [`d821d2b`](https://github.com/langchain-ai/docs/commit/d821d2b3101de2f48423f767744ab35baf73fbed) fmt ### 📊 Changes **7 files changed** (+1537 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `.github/workflows/check-import-mappings.yml` (+115 -0) ➕ `.github/workflows/check-pr-imports.yml` (+139 -0) ➕ `scripts/__init__.py` (+1 -0) ➕ `scripts/check_import_mappings.py` (+255 -0) ➕ `scripts/check_pr_imports.py` (+241 -0) ➕ `scripts/import_mappings.json` (+471 -0) ➕ `tests/unit_tests/test_check_pr_imports.py` (+315 -0) </details> ### 📄 Description Introduces an automated system to detecting and manage incorrect imports from `langchain_core` in favor of using the re-exports from `langchain`. * Added `check-import-mappings.yml` workflow to periodically analyze the latest version of `langchain_core`, check for re-exports in `langchain` (and generate `import_mappings.json`), and automatically create PRs to update the mappings cache in this repo. * Added `check_import_mappings.py` to fetch latest package releases, introspect `langchain` public `__init__` files, and generate a detailed mapping of re-exported members from `langchain_core`. Uses the previous local `import_mappings.json` * Added `check-pr-imports.yml` workflow to run on PRs, ensuring inbound contributions use `langchain` imports when available, and comment on PRs with specific guidance if issues are found. * Uses `check_pr_imports.py` to analyze PR diffs against the import mappings, detect incorrect `langchain_core` imports, and output suggested fixes for contributors. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-17 17:22:30 -05:00
yindo closed this issue 2026-02-17 17:22:30 -05:00
yindo changed title from [PR #1445] feat(ci): validate imports from `langchain` to [PR #1445] [MERGED] feat(ci): validate imports from `langchain` 2026-06-05 18:13:43 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#1571