Commit Graph

605 Commits

Author SHA1 Message Date
Sebastian Rittau
499e74cf2a Add wsgiref.types (Python 3.11+) (#7644)
_typeshed.wsgi: Import from wsgiref.types in Python 3.11+

Make types match wsgiref.types
2022-04-16 21:36:31 +02:00
Jelle Zijlstra
b0611bc031 Improve sqlite3 types (#7641)
Read through the code in CPython and made the types more precise
where possible.

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2022-04-16 11:20:11 -07:00
Alex Waygood
819900fa55 Python 3 stubs: use str instead of typing.Text (#7638) 2022-04-16 15:47:00 +01:00
Alex Waygood
a1b1b95f67 Unpin Python micro versions used by stubtest (#7619)
Add new `asyncio` method, fix allowlists
2022-04-13 22:07:01 +02:00
Rebecca Chen
f1856a384e pytype_test: Don't mix up stdlib and stub packages starting with stdlib. (#7609)
This should fix the pytype_test failure in
https://github.com/python/typeshed/pull/7608.
2022-04-08 13:01:37 -07:00
Alex Waygood
478e7527aa mypy_test: Add two more config options (#7560)
`--enable-error-code ignore-without-code` means that mypy will ignore any type: ignore comments that don't have mypy error codes. It doesn't appear to have any effect on type: ignore comments that mypy_test doesn't use (e.g. because they're pyright- or stubtest-specific).

`--strict-equality` means that mypy will raise errors if we do something silly like `if sys.version_info == "linux"`. flake8-pyi should also check this for us, but I don't see any reason not to have mypy check this as well.
2022-03-28 16:06:13 +01:00
Stefan Zabka
f40747f81d Add Server to asyncio.base_events' __all__ (#7554)
Add Server to asyncio.base_events' __all__

Closes #7552
2022-03-25 20:32:28 +00:00
Alex Waygood
5c44ae4f8c Improve various signatures that shouldn't be async def, but currently are (#7491)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2022-03-18 20:54:39 -07:00
Alex Waygood
3ab250eec8 Use PEP 604 syntax wherever possible (#7493) 2022-03-16 16:01:33 +01:00
Alex Waygood
15e21a8dc1 Use pyright 1.1.230 in CI, temporarily pin pyright-action to 1.0.4 (#7495)
* Upgrade pyright to 1.1.230
* Add `type: ignore`s for new pyright checks regarding multiple inheritance
* Temporarily pin pyright-action to 1.0.4, as changes made in 1.0.5 break typeshed's CI

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-03-16 14:24:55 +00:00
Sebastian Rittau
fdc5863337 Use stubtest 0.941 (#7490) 2022-03-15 00:37:34 -07:00
Alex Waygood
2f338ce077 Further improve mypy_test.py (#7484)
* Run mypy on the 3.11 stdlib in CI, as a regression test for https://github.com/python/mypy/issues/12220
* Correct the docstring at the top of the file following the changes made in #7478
* Stop the test from crashing when run locally if there's an extra file/folder in the stubs directory.
2022-03-13 19:58:30 +00:00
Jelle Zijlstra
fa332220b7 Fix mypy test (#7478)
* Fix `mypy_test.py` so that it actually tests the third-party stubs
* Upgrade to mypy 0.940
* Skip running mypy on `SQLAlchemy` stubs for now, to workaround a mypy crash.

Because we didn't set mypy's clean_exit parameter, it was exiting immediately after checking the stdlib, meaning `mypy_test.py` wasn't checking the third-party stubs at all.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-03-13 13:01:14 +00:00
Sebastian Rittau
cdb573b398 Remove explicit inheritance from object (#7468) 2022-03-09 19:43:44 +01:00
Sebastian Rittau
c3907ab26b Remove Python 2 support from some third-party distributions (#7466)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-03-09 20:19:22 +02:00
Henry Schreiner
967f83db09 rlcompleter: add attr_matches, global_matches (#7453)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-03-08 00:07:58 +00:00
Akuli
30a424c661 Finish renaming stubtest.yml to daily.yml (#7448) 2022-03-07 11:09:24 +02:00
Jelle Zijlstra
675de720d6 Add some missing items to sys.pyi and types.pyi (#7447) 2022-03-07 08:22:08 +01:00
Jelle Zijlstra
2fb9c35ff9 Put shutil.chown back on Windows (#7446)
See #7384 and https://github.com/python/typeshed/pull/7443#issuecomment-1060071944 (thanks @AlexWaygood for diagnosing).
2022-03-06 16:27:24 -08:00
Martin Fischer
8034c1c48c stdlib: shutil.chown does not work on Windows (#7384) 2022-03-06 16:04:05 -08:00
Martin Fischer
182ddd9daf stdlib: Add os.get_handle_inheritable & setter 2022-03-06 15:57:52 -08:00
Martin Fischer
aa383624cf stdlib: Add missing re-exports for UuidCreate, FCICreate, OpenDatabase & CreateRecord 2022-03-06 15:57:52 -08:00
Martin Fischer
352f5c3237 stdlib: Add os.copy_file_range(src, dst, count) 2022-03-06 15:57:52 -08:00
Martin Fischer
81a85f18b6 stdlib: Add os.pidfd_open(pid) 2022-03-06 15:57:52 -08:00
Martin Fischer
9abf314a5b stdlib: Add time.pthread_getcpuclockid(thread_id) 2022-03-06 15:57:52 -08:00
Alex Waygood
1a2f718ceb Make several fields read-only for type, staticmethod and classmethod (#7423) 2022-03-06 15:50:26 -08:00
Shantanu
77e5a2d468 Upgrade to stubtest with dunder pos only reverted (#7442) 2022-03-05 18:38:08 -08:00
Alex Waygood
cda3d9cf72 Use latest stubtest in CI (#7438) 2022-03-04 15:19:29 +01:00
Jelle Zijlstra
0a6b6b095c Add asyncio.windows_utils.Popen (#7396) 2022-03-02 12:37:54 +02:00
Alex Waygood
fd750bf065 asyncio.unix_events: Make AbstractChildWatcher abstract, add PidfdChildWatcher (#7412) 2022-03-01 16:23:46 +01:00
Shantanu
ebcfe7bc4e random: use bound methods (#7408) 2022-03-01 09:27:44 +01:00
Alex Waygood
1ebedcc2b4 Mark fields as readonly in builtins.pyi and types.pyi (#7392)
Add FunctionType.__builtins__
2022-02-28 13:23:34 +01:00
Alex Waygood
b8421eb5d4 Delete the contents of distutils.command.__init__ (#7370) 2022-02-27 16:43:11 -08:00
Alex Waygood
a0b41959ec stdlib: fix many attributes which are read-only at runtime but read-write in the stub (#7395) 2022-02-27 16:23:09 -08:00
Alex Waygood
d2ddda00cf Fix various __all__-related typos and omissions (#7378) 2022-02-25 15:10:00 +02:00
Alex Waygood
240628c4dd Add missing objects to plistlib, and improve __all__ in asyncio.tasks, http.server, & multiprocessing.__init__ (#7363) 2022-02-22 16:39:34 -08:00
Alex Waygood
070bbb4fb9 Add multiprocessing.reduction submodule (#7361) 2022-02-22 16:36:26 -08:00
Alex Waygood
22c3cc4d0b Add csv.__version__ (#7357) 2022-02-22 20:12:43 +02:00
Alex Waygood
6fc4c14181 Add missing objects in codecs, configparser, and multiprocessing.dummy (#7360) 2022-02-22 18:25:27 +01:00
Alex Waygood
bdcaea4305 cgi: Add print_exception and print_arguments (#7359) 2022-02-22 08:38:02 -08:00
Sebastian Rittau
7a81bd41e9 Re-introduce the 'stubtest' key for third-party packages (#7351)
Some distributions can't be tested with stubtest for a variety of
reasons or because of bugs in stubtest. This key:

* let's us keep metadata about a distribution in one place,
* prevents us from modifying the scripts because of issues with a
  specific distribution, and
* will trigger tests if only the key is changed.
2022-02-22 15:59:27 +01:00
Shantanu
c2fb0fb814 Downgrade stubtest a little (#7346)
Fixes #7344 for now.

As discussed in that issue, I think it might make sense to revert the
change to check positional-only arguments on dunders for now, since it
seems to be mostly busywork and has very little benefit for end users.

However, that'll happen on stubtest master, which typeshed isn't yet
ready for.

Co-authored-by: hauntsaninja <>
2022-02-21 17:05:46 -08:00
Shantanu
075b8e02eb Update stubtest for async and dunder pos only checking (#7333)
Co-authored-by: hauntsaninja <>
2022-02-21 15:54:16 -08:00
Nikita Sobolev
4d169eaa83 Adds bdist_wininst definition (#7249) 2022-02-20 22:58:48 -08:00
Alex Waygood
07de01f29e Add __all__ to modules beginning with 'm' (#7330) 2022-02-20 14:08:07 -08:00
Shantanu
823592e100 Update stubtest for final checking (#7312)
Co-authored-by: hauntsaninja <>
2022-02-19 18:53:15 -08:00
Alex Waygood
b74acc7546 Add all the email __all__s (#7304) 2022-02-19 17:53:29 -08:00
Shantanu
ebdbd564be sqlalchemy: skip stubtest for now (#7310)
Co-authored-by: hauntsaninja <>
2022-02-19 17:47:55 -08:00
Shantanu
879b617366 Update stubtest for submodule versions, typeddict fix (#7306)
First step in #7305

Co-authored-by: hauntsaninja <>
2022-02-19 15:53:40 -08:00
Guido van Rossum
35bddd289f Add asyncio.taskgroups and new Task methods (#7240)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-02-17 00:32:20 +02:00