Skip to content

ci: avoid unnecessary dep installs in lint targets#36046

Merged
Mason Daugherty (mdrxy) merged 6 commits intomasterfrom
mdrxy/lint-fix
Mar 18, 2026
Merged

ci: avoid unnecessary dep installs in lint targets#36046
Mason Daugherty (mdrxy) merged 6 commits intomasterfrom
mdrxy/lint-fix

Conversation

@mdrxy
Copy link
Copy Markdown
Member

@mdrxy Mason Daugherty (mdrxy) commented Mar 18, 2026

CI lint jobs use uv run --all-groups for all tools, but ruff doesn't need dependency resolution — only mypy does. By splitting into UV_RUN_LINT (ruff) and UV_RUN_TYPE (mypy), the CI-facing targets run ruff with --group lint only, giving fast-fail feedback before mypy triggers the full environment sync.

For packages where source code only conditionally imports heavy deps (text-splitters, huggingface), lint_package also overrides UV_RUN_TYPE to --group lint --group typing, skipping the ~3.5GB test_integration download entirely. lint_tests keeps --all-groups since test code legitimately imports those deps.

Additionally, lint_imports.sh was inconsistently wired — most packages had the script but weren't calling it.

Changes

Makefile optimization

  • Introduce UV_RUN_LINT and UV_RUN_TYPE Make variables, both defaulting to uv run --all-groups. For lint_package and lint_tests, UV_RUN_LINT is overridden to uv run --group lint so ruff runs instantly without syncing heavy deps
  • For text-splitters and huggingface, override UV_RUN_TYPE on lint_package to uv run --group lint --group typing — mypy runs without downloading torch, CUDA, spacy, etc.

mypy config for lean groups

  • Add transformers and transformers.* to ignore_missing_imports in text-splitters pyproject.toml (conditional try/except import, same treatment as existing konlpy/nltk entries)
  • Add torch, torch.*, langchain_community, langchain_community.* to ignore_missing_imports in huggingface pyproject.toml
  • Add dual # type: ignore[unreachable, unused-ignore] in text-splitters/base.py to handle the PreTrainedTokenizerBase isinstance check that behaves differently depending on whether transformers is installed

lint_imports.sh consistency

  • Add ./scripts/lint_imports.sh to the lint recipe in every package that wasn't calling it (standard-tests, model-profiles, all 15 partners), and create the script for the two packages missing it entirely (model-profiles, openrouter)
  • Update all lint_imports.sh scripts to allow from langchain.agents and from langchain.tools imports (legitimate v1 middleware dependencies used by langchain-anthropic and langchain-openai)

@github-actions github-actions Bot added anthropic `langchain-anthropic` package issues & PRs chroma `langchain-chroma` package issues & PRs core `langchain-core` package issues & PRs deepseek `langchain-deepseek` package issues & PRs exa `langchain-exa` package issues & PRs fireworks `langchain-fireworks` package issues & PRs groq `langchain-groq` package issues & PRs huggingface `langchain-huggingface` package issues & PRs infra PRs made that include chores, devops, repo meta changes integration PR made that is related to a provider partner package integration internal langchain `langchain` package issues & PRs mistralai `langchain-mistralai` package issues & PRs model-profiles `langchain-model-profiles` package issues & PRs nomic `langchain-nomic` package issues & PRs ollama `langchain-ollama` package issues & PRs openai `langchain-openai` package issues & PRs openrouter `langchain-openrouter` package issues & PRs perplexity `langchain-perplexity` package issues & PRs qdrant `langchain-qdrant` package issues & PRs size: M 200-499 LOC standard-tests Related to the package `standard-tests` text-splitters Related to the package `text-splitters` xai `langchain-xai` package issues & PRs labels Mar 18, 2026
@github-actions github-actions Bot added the github_actions Pull requests that update GitHub Actions code label Mar 18, 2026
@mdrxy Mason Daugherty (mdrxy) changed the title ci(lint): avoid unnecessary dep installs in lint targets ci: avoid unnecessary dep installs in lint targets Mar 18, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Mar 18, 2026

Merging this PR will not alter performance

⚠️ 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.

✅ 34 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing mdrxy/lint-fix (1835f6e) with master (9a17602)2

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on master (58f3d1a) during the generation of this report, so 9a17602 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@github-actions github-actions Bot added the dependencies Pull requests that update a dependency file (e.g. `pyproject.toml` or `uv.lock`) label Mar 18, 2026
@mdrxy Mason Daugherty (mdrxy) merged commit 07fa576 into master Mar 18, 2026
295 checks passed
@mdrxy Mason Daugherty (mdrxy) deleted the mdrxy/lint-fix branch March 18, 2026 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

anthropic `langchain-anthropic` package issues & PRs chroma `langchain-chroma` package issues & PRs core `langchain-core` package issues & PRs deepseek `langchain-deepseek` package issues & PRs dependencies Pull requests that update a dependency file (e.g. `pyproject.toml` or `uv.lock`) exa `langchain-exa` package issues & PRs fireworks `langchain-fireworks` package issues & PRs github_actions Pull requests that update GitHub Actions code groq `langchain-groq` package issues & PRs huggingface `langchain-huggingface` package issues & PRs infra PRs made that include chores, devops, repo meta changes integration PR made that is related to a provider partner package integration internal langchain `langchain` package issues & PRs mistralai `langchain-mistralai` package issues & PRs model-profiles `langchain-model-profiles` package issues & PRs nomic `langchain-nomic` package issues & PRs ollama `langchain-ollama` package issues & PRs openai `langchain-openai` package issues & PRs openrouter `langchain-openrouter` package issues & PRs perplexity `langchain-perplexity` package issues & PRs qdrant `langchain-qdrant` package issues & PRs size: M 200-499 LOC standard-tests Related to the package `standard-tests` text-splitters Related to the package `text-splitters` xai `langchain-xai` package issues & PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant