Aria Desires
6a1e91ce97
[ty] Check typeshed VERSIONS for parent modules when reporting failed stdlib imports ( #20908 )
...
This is a drive-by improvement that I stumbled backwards into while
looking into
* https://github.com/astral-sh/ty/issues/296
I was writing some simple tests for "thing not in old version of stdlib"
diagnostics and checked what was added in 3.14, and saw
`compression.zstd` and to my surprise discovered that `import
compression.zstd` and `from compression import zstd` had completely
different quality diagnostics.
This is because `compression` and `compression.zstd` were *both*
introduced in 3.14, and so per VERSIONS policy only an entry for
`compression` was added, and so we don't actually have any definite info
on `compression.zstd` and give up on producing a diagnostic. However the
`from compression import zstd` form fails on looking up `compression`
and we *do* have an exact match for that, so it gets a better
diagnostic!
(aside: I have now learned about the VERSIONS format and I *really* wish
they would just enumerate all the submodules but, oh well!)
The fix is, when handling an import failure, if we fail to find an exact
match *we requery with the parent module*. In cases like
`compression.zstd` this lets us at least identify that, hey, not even
`compression` exists, and luckily that fixes the whole issue. In cases
where the parent module and submodule were introduced at different times
then we may discover that the parent module is in-range and that's fine,
we don't produce the richer stdlib diagnostic.
2025-10-16 13:25:08 +00:00
..
2025-05-21 11:06:27 -04:00
2025-08-27 13:21:47 +01:00
2025-10-03 17:14:51 -04:00
2025-10-12 18:39:32 +00:00
2025-10-12 18:39:32 +00:00
2025-10-12 18:39:32 +00:00
2025-10-12 18:39:32 +00:00
2025-10-12 18:39:32 +00:00
2025-10-12 18:39:32 +00:00
2025-10-12 18:39:32 +00:00
2025-08-05 07:41:37 -07:00
2025-08-29 19:48:45 +01:00
2025-05-13 18:43:19 +02:00
2025-05-13 18:43:19 +02:00
2025-05-13 18:43:19 +02:00
2025-09-23 14:26:55 +00:00
2025-05-13 18:43:19 +02:00
2025-05-13 18:43:19 +02:00
2025-05-13 18:43:19 +02:00
2025-06-27 12:40:33 +00:00
2025-06-02 10:52:26 +00:00
2025-06-02 10:52:26 +00:00
2025-10-16 13:25:08 +00:00
2025-08-26 11:01:16 -04:00
2025-08-26 11:01:16 -04:00
2025-08-26 11:01:16 -04:00
2025-07-23 08:24:12 -07:00
2025-10-12 18:39:32 +00:00
2025-07-18 23:50:29 +00:00
2025-08-25 17:01:51 +00:00
2025-08-29 13:22:23 +00:00
2025-07-08 20:29:07 +02:00
2025-10-12 18:39:32 +00:00
2025-10-12 18:39:32 +00:00
2025-10-12 18:39:32 +00:00
2025-10-12 18:39:32 +00:00
2025-05-13 18:43:19 +02:00
2025-05-13 18:43:19 +02:00
2025-10-12 18:39:32 +00:00
2025-10-12 18:39:32 +00:00
2025-10-12 18:39:32 +00:00
2025-10-12 18:39:32 +00:00
2025-10-12 18:39:32 +00:00
2025-10-12 18:39:32 +00:00
2025-10-12 18:39:32 +00:00
2025-10-12 18:39:32 +00:00
2025-10-12 18:39:32 +00:00
2025-10-12 18:39:32 +00:00
2025-10-12 18:39:32 +00:00
2025-10-12 18:39:32 +00:00
2025-10-12 18:39:32 +00:00
2025-10-12 18:39:32 +00:00
2025-10-12 18:39:32 +00:00
2025-06-24 20:27:37 +00:00
2025-08-25 19:39:05 +01:00
2025-05-13 18:43:19 +02:00
2025-05-13 18:43:19 +02:00
2025-08-21 22:00:44 +01:00
2025-05-13 18:43:19 +02:00
2025-05-13 18:43:19 +02:00
2025-05-13 18:43:19 +02:00
2025-05-13 18:43:19 +02:00
2025-05-13 18:43:19 +02:00
2025-07-28 22:06:33 +00:00
2025-05-13 18:43:19 +02:00
2025-05-13 18:43:19 +02:00
2025-05-13 18:43:19 +02:00
2025-05-13 18:43:19 +02:00
2025-08-21 22:00:44 +01:00
2025-05-13 18:43:19 +02:00
2025-05-13 18:43:19 +02:00
2025-08-14 14:38:33 -07:00
2025-08-14 14:38:33 -07:00
2025-10-15 11:13:32 +02:00
2025-08-14 14:38:33 -07:00
2025-09-23 14:26:55 +00:00
2025-08-14 14:38:33 -07:00
2025-08-14 14:38:33 -07:00
2025-06-09 00:40:05 +01:00
2025-05-21 15:38:56 -04:00
2025-06-09 00:40:05 +01:00
2025-10-09 21:08:37 +00:00
2025-10-09 21:08:37 +00:00
2025-10-09 21:08:37 +00:00
2025-10-09 21:08:37 +00:00
2025-10-09 21:08:37 +00:00
2025-10-09 21:08:37 +00:00
2025-10-09 21:08:37 +00:00
2025-10-09 21:08:37 +00:00
2025-10-09 21:08:37 +00:00
2025-10-09 21:08:37 +00:00
2025-10-09 21:08:37 +00:00
2025-05-13 18:43:19 +02:00
2025-08-21 22:00:44 +01:00
2025-10-12 18:39:32 +00:00
2025-05-21 18:02:39 -04:00
2025-10-12 18:39:32 +00:00
2025-08-01 12:20:32 -04:00
2025-09-05 10:12:40 +02:00
2025-08-18 12:03:01 +00:00
2025-05-15 11:39:14 -04:00
2025-05-15 11:39:14 -04:00
2025-05-14 11:13:41 -04:00
2025-05-14 11:13:41 -04:00
2025-05-14 11:13:41 -04:00
2025-05-14 11:13:41 -04:00
2025-05-13 18:43:19 +02:00
2025-10-12 18:39:32 +00:00
2025-10-07 21:52:57 +00:00
2025-05-13 18:43:19 +02:00
2025-05-13 18:43:19 +02:00
2025-05-13 18:43:19 +02:00
2025-05-13 18:43:19 +02:00
2025-10-07 21:52:57 +00:00
2025-10-12 18:39:32 +00:00
2025-08-19 22:45:41 +00:00
2025-05-13 18:43:19 +02:00
2025-10-12 18:39:32 +00:00
2025-10-12 18:39:32 +00:00
2025-05-29 23:17:18 +00:00
2025-07-28 15:52:59 +02:00
2025-07-28 15:52:59 +02:00
2025-05-14 08:26:48 +02:00
2025-05-29 23:17:18 +00:00
2025-05-29 23:17:18 +00:00
2025-10-07 12:23:11 -04:00
2025-08-29 08:44:18 +00:00
2025-05-13 18:43:19 +02:00
2025-10-13 19:30:49 -04:00
2025-10-13 19:30:49 -04:00
2025-07-30 17:40:24 +02:00
2025-05-13 18:43:19 +02:00
2025-05-13 18:43:19 +02:00
2025-06-20 08:36:49 +05:30
2025-06-20 08:36:49 +05:30
2025-10-14 12:48:47 +00:00
2025-10-14 12:48:47 +00:00
2025-08-05 07:41:37 -07:00
2025-08-21 22:00:44 +01:00
2025-05-13 18:43:19 +02:00
2025-05-13 18:43:19 +02:00
2025-07-24 08:24:26 +00:00
2025-09-05 12:38:37 +02:00
2025-05-13 18:43:19 +02:00
2025-05-13 18:43:19 +02:00
2025-06-24 18:02:05 -07:00
2025-10-08 11:21:26 +01:00
2025-08-21 22:00:44 +01:00
2025-05-13 18:43:19 +02:00
2025-05-13 18:43:19 +02:00
2025-05-13 18:43:19 +02:00
2025-06-27 15:29:04 -04:00
2025-08-26 11:01:16 -04:00
2025-05-13 18:43:19 +02:00
2025-05-13 18:43:19 +02:00
2025-05-13 18:43:19 +02:00
2025-08-26 11:01:16 -04:00
2025-05-13 18:43:19 +02:00
2025-05-21 11:06:27 -04:00
2025-05-13 18:43:19 +02:00
2025-05-13 18:43:19 +02:00
2025-05-13 18:43:19 +02:00
2025-05-13 18:43:19 +02:00
2025-05-13 18:43:19 +02:00