ci: avoid unnecessary dep installs in lint targets#36046
Merged
Mason Daugherty (mdrxy) merged 6 commits intomasterfrom Mar 18, 2026
Merged
ci: avoid unnecessary dep installs in lint targets#36046Mason Daugherty (mdrxy) merged 6 commits intomasterfrom
Mason Daugherty (mdrxy) merged 6 commits intomasterfrom
Conversation
Merging this PR will not alter performance
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI lint jobs use
uv run --all-groupsfor all tools, but ruff doesn't need dependency resolution — only mypy does. By splitting intoUV_RUN_LINT(ruff) andUV_RUN_TYPE(mypy), the CI-facing targets run ruff with--group lintonly, 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_packagealso overridesUV_RUN_TYPEto--group lint --group typing, skipping the ~3.5GBtest_integrationdownload entirely.lint_testskeeps--all-groupssince test code legitimately imports those deps.Additionally,
lint_imports.shwas inconsistently wired — most packages had the script but weren't calling it.Changes
Makefile optimization
UV_RUN_LINTandUV_RUN_TYPEMake variables, both defaulting touv run --all-groups. Forlint_packageandlint_tests,UV_RUN_LINTis overridden touv run --group lintso ruff runs instantly without syncing heavy depstext-splittersandhuggingface, overrideUV_RUN_TYPEonlint_packagetouv run --group lint --group typing— mypy runs without downloading torch, CUDA, spacy, etc.mypy config for lean groups
transformersandtransformers.*toignore_missing_importsintext-splitterspyproject.toml (conditionaltry/exceptimport, same treatment as existingkonlpy/nltkentries)torch,torch.*,langchain_community,langchain_community.*toignore_missing_importsinhuggingfacepyproject.toml# type: ignore[unreachable, unused-ignore]intext-splitters/base.pyto handle thePreTrainedTokenizerBaseisinstance check that behaves differently depending on whether transformers is installedlint_imports.sh consistency
./scripts/lint_imports.shto 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)lint_imports.shscripts to allowfrom langchain.agentsandfrom langchain.toolsimports (legitimate v1 middleware dependencies used bylangchain-anthropicandlangchain-openai)