Commit cdef0e0
authored
🐛 fix(types): resolve ty 0.0.30 check failures (#571)
The scheduled `check` workflow on `main` started failing after `ty`
0.0.30 shifted its diagnostics on three unrelated call sites, blocking
the green-main signal the project relies on. 🐛 None of the underlying
code was buggy at runtime, but the type-check job treats any warning as
fatal, so the job needs to be cleaned up before new work can merge
cleanly.
The dict feeding `_resolve_extras` in `PackageDAG.from_pkgs` now gets an
explicit `dict[str, DistPackage]` annotation; without it `ty` infers
`dict[NormalizedName, DistPackage]` from `canonicalize_name` and
dict-key invariance turns the call into a type error, matching how
`PackageDAG._index` is already annotated a few lines down. In the
mermaid renderer, the `extra := context and
context.build_node_extra_label(...)` pattern let `extra` widen to
`RenderContext | str`; moving the walrus inside the right-hand side of
the `and` narrows it back to `str` and mirrors the shape already used by
the graphviz renderer. The `ty: ignore[invalid-argument-type]` directive
on `sorted(map(str, specifier), ...)` no longer corresponds to a real
diagnostic in 0.0.30 and was being flagged as unused, so it is dropped
while keeping the adjacent comment that explains the `reverse=True`
argument.
No runtime behaviour changes. ✅1 parent 5a898d7 commit cdef0e0
3 files changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
| 257 | + | |
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
0 commit comments