Commit Graph

32 Commits

Author SHA1 Message Date
Alex Waygood
7d33ff330a Clean up several version-dependent modules (#6885) 2022-01-10 05:57:08 -08:00
Sebastian Rittau
e77a66aced Update pyright (#6840) 2022-01-07 18:58:15 +02:00
Alex Waygood
8d5d2520ac Use PEP 585 syntax wherever possible (#6717) 2021-12-28 11:31:43 +01:00
Alex Waygood
a54e21992c Remove ParamSpec-related # type: ignores (#6703) 2021-12-26 15:27:57 +01:00
Alex Waygood
ae725c3f10 Add test to ensure certain names are not imported from typing_extensions (#6619) 2021-12-17 14:50:25 -08:00
Alex Waygood
84fd495b65 Update importlib to reflect recent changes (#6557) 2021-12-10 14:32:55 +01:00
Akuli
f29f0a5394 importlib: stubtest fixes for py310 (#6443) 2021-11-29 11:05:54 -08:00
Akuli
a5bc1e037f Add mypy error codes to '# type: ignore' comments (#6379) 2021-11-26 07:07:56 +01:00
Alex Waygood
dc5f6410a8 DefaultDict -> defaultdict, typing.ContextManager -> contextlib.AbstractContextManager (#6351) 2021-11-21 07:07:35 -08:00
Alex Waygood
1274445941 Resolve builtins/importlib inconsistencies (#6310) 2021-11-16 15:19:21 +01:00
Alex Waygood
aa7e277adb Harmonise return type of builtins.__import__ and importlib.import_module (#6302)
builtins.__import__ now returns ModuleType instead of Any. In addition, add __getattr__() to ModuleType to ease using imported modules.
2021-11-15 16:21:46 +01:00
ROHAN SALWAN
e38248e818 Fix type of importlib.machinery.ModuleSpec.loader (#6194) 2021-10-25 12:59:49 +03:00
Akuli
994b69ef8f Use lowercase tuple where possible (#6170) 2021-10-14 17:18:19 -07:00
hardikpnsp
ee31999caf Add missing methods to ExtensionFileLoader (#6120)
Closes: #4769
2021-10-08 23:14:32 +02:00
Estelle Poulin
15cec1da8e Change Traversable to be inline with pathlib.Path (#5818)
`pathlib.Path` objects are now valid `importlib.abc.Traversable`s.
2021-09-21 21:36:10 +03:00
Anton Grübel
29c63e0d9c add ParamSpec to importlib.util (#5944) 2021-08-21 08:24:25 -07:00
Akuli
ce11072dbe Big diff: use lower-case list and dict (#5888) 2021-08-08 09:26:35 -07:00
Akuli
ee487304d7 Big diff: Use new "|" union syntax (#5872) 2021-08-08 11:05:21 +02:00
Josh
2b497f7227 importlib.util.resolve_name package argument accepts None (#5730) 2021-07-05 09:21:40 +02:00
Pavel Karateev
f4c5ae01c4 Add importlib.metadata.packages_distributions() (#5565) 2021-06-01 20:07:18 +02:00
Sebastian Rittau
f0bf6eebbd AnyStr cleanup (#5487)
* Replace all uses of StrPath, BytesPath, and AnyPath in Python 2 stubs.
* Add StrOrBytesPath as preferred alias for AnyPath.
* Replace all remaining AnyPath instances with StrOrBytesPath.
* Mark AnyPath as obsolete.

Part of #5470
2021-05-17 20:45:48 +02:00
Sebastian Rittau
e5abd08f93 Replace PathLike unions with aliases from _typeshed (#5467)
Standardize on 'from os import PathLike'
2021-05-16 21:38:00 +02:00
Akuli
e66b7fa660 delete _importlib_modulespec (#5350)
* delete _importlib_modulespec

* use typing_extensions.runtime_checkable
2021-05-06 17:13:35 +03:00
Akuli
bb5fb845f2 use protocol for sys.meta_path (#5349) 2021-05-06 17:12:34 +03:00
Sebastian Rittau
4ac3ccad45 black: enable skip_magic_trailing_comma (#5252)
* black: enable skip_magic_trailing_comma

* Remove spurious commas
2021-04-27 08:32:32 -07:00
Sebastian Rittau
bac1918b5f PathLike cleanup (#5242)
Copy builtins._PathLike to os.PathLike

Use os.PathLike exclusively outside of builtins
2021-04-23 10:15:07 -07:00
Vyom Pathak
f68ef6ca76 spec_from_loader and spec_from_file_location can return None (#5224)
Closes #5117
2021-04-19 12:03:33 +02:00
Henry Schreiner
67090510ba importlib.resouces: add as_file for Python 3.9 (#5216) 2021-04-13 23:02:34 -07:00
Henry Schreiner
ce1871a5bb importlib.abc: Traversable takes a path (#5214) 2021-04-13 19:43:20 -07:00
hatal175
2e703c37e9 Fix importlib stubtest exceptions (#5148)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2021-04-05 12:01:26 -07:00
Eric Traut
0ec182227c Added a few missing type arguments for generic types used in stdlib stubs
I just found and fixed a bug in pyright's "missing type arguments" check. When type arguments were omitted for a generic type within a subscript expression, the error was being suppressed. With this bug fixed, I found several new cases where type arguments were missing in stdlib stubs. (#5130)

Co-authored-by: Eric Traut <erictr@microsoft.com>
2021-03-22 18:28:04 -07:00
Ivan Levkivskyi
16ae4c6120 Re-organize directory structure (#4971)
See discussion in #2491

Co-authored-by: Ivan Levkivskyi <ilevkivskyi@dropbox.com>
2021-01-27 12:00:39 +00:00