Repository navigation
Conversation
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 98.24%. The percentage of expected errors that received a diagnostic held steady at 98.24%. The number of fully passing files held steady at 134/146. |
|
Memory usage reportMemory usage unchanged ✅ |
|
zsol
force-pushed
the
zsol/ty-unused-dependency
branch
from
September 4, 2026 12:35
03593e6 to
08ac708
Compare
zsol
added a commit
to astral-sh/uv
that referenced
this pull request
Oct 15, 2026
`uv workspace metadata` omits installed packages outside the selected resolution. For example, a package can remain installed after it is removed from the dependency graph; this is especially important for astral-sh/ruff#28192. This PR adds observed distributions in `environment.packages`, including their installed versions, metadata paths, and editable status. The inventory includes installed packages outside the locked resolution. Installed distributions are matched to selected non-virtual packages by name (i.e. they're matched even when their versions differ). Matched entries reuse the selected resolution node ID and report the actual installed version separately. Only unmanaged entries get generated IDs based on their installed name, version, and metadata path. If multiple installations match the same resolution node, uv keeps the first record and warns. The affected fields, expressed as TypeScript types: ```ts type NodeId = string; // Opaque identifier. type InstalledPackage = { name: string; version: string; // Actual installed version. path: string; // Absolute path to installed metadata. editable: boolean; }; type Metadata = { // ... (other metadata fields omitted) environment?: { // Existing root and python fields omitted. packages: Record<NodeId, InstalledPackage>; // New; present even when empty. }; // Existing. Module name -> owners; omitted when empty. // package_id indexes environment.packages; // matched IDs also index resolution. module_owners?: Record<string, { package_id: NodeId }[]>; }; ``` Unmanaged packages are entries in `environment.packages` whose IDs are absent from `resolution`. Use `module_owners` to find the modules they provide. Unmatched packages without discovered modules appear only in `environment.packages`. --------- Co-authored-by: Zsolt Dollenstein <[email protected]> Co-authored-by: zaniebot <[email protected]>
zsol
force-pushed
the
zsol/ty-unused-dependency
branch
from
October 16, 2026 16:27
08ac708 to
5be4142
Compare
zsol
force-pushed
the
zsol/ty-unused-dependency
branch
from
October 19, 2026 14:29
5be4142 to
c3fe243
Compare
zsol
force-pushed
the
zsol/ty-unused-dependency
branch
3 times, most recently
from
October 20, 2026 16:35
66436a9 to
c5c24c8
Compare
zsol
force-pushed
the
zsol/ty-unused-dependency
branch
from
October 21, 2026 17:09
c5c24c8 to
d164e4a
Compare
This was referenced Oct 23, 2026
zsol
force-pushed
the
zsol/ty-unused-dependency
branch
from
October 23, 2026 16:15
d164e4a to
d474221
Compare
zsol
changed the base branch from
main
to
zsol/ty-shared-manifest-diagnostics
October 23, 2026 16:15
Contributor
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 98.60%. The percentage of expected errors that received a diagnostic held steady at 98.86%. The number of fully passing files held steady at 137/146. Results for b5484f7 · Workflow run |
Contributor
Memory usage reportMemory usage unchanged ✅ Results for b5484f7 · Workflow run |
Contributor
|
Contributor
|
zsol
force-pushed
the
zsol/ty-unused-dependency
branch
2 times, most recently
from
October 28, 2026 05:18
1c9afd8 to
a67f83d
Compare
zsol
force-pushed
the
zsol/ty-unused-dependency
branch
from
October 29, 2026 05:21
a67f83d to
b5484f7
Compare
This branch was previously deployed
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.
Summary
Add an opt-in
unused-dependencyrule that reports dependencies left inpyproject.tomlor a PEP 723 script after their last import is removed. Enable it with--warn unused-dependencyand uv integration. ty uses uv's metadata to match imports to the distributions that provide them.The PR caches dependency usage separately from diagnostic reporting, reuses the existing mdtest assertions and snapshots with shared uv fixtures, and updates the rule documentation and schema.
Stacked on #29674.
Rule behavior
src.include,src.exclude, and ignore settings, including files that have never been opened in the editor. A dependency used only in an excluded file is reported as unused, even if that file is open or an included file imports it.app/is a workspace member,ty check app/fooskipsunused-dependencyforapp/pyproject.tomlbecause other files in the member may import the dependency. Checking a single Python file also skips the project rule.ty check appruns it even whensrc.includeselects onlyfoo/. We might want to tweak this later based on feedbackunused-dependencywarnings for that workspace member or script.pyproject.tomlfiles when Python source changes. When two editor folders share apyproject.toml, unsaved imports from either folder count toward its declarations. A workspace diagnostic request combines the warnings into one report for the shared manifest.