Commit Graph

337 Commits

Author SHA1 Message Date
Sebastian Rittau
48b060cfa0 mypy self check: Use mypy version from requirements file (#5245) 2021-04-26 12:51:28 +02:00
hatal175
d151d1b8bb Stubtest fixes (#5249) 2021-04-25 21:56:54 -07:00
hatal175
bf5ff49b53 mailbox, mimetypes, unittest, zipfile: stubtest fixes (#5239) 2021-04-21 21:58:01 -07:00
Shantanu
fc660d6d41 Move typing_extensions to stdlib (#5233)
I'm not sure what the best way to do this is. This effectively orphans
types-typing-extensions, but maybe that's not really a problem. (We can
yank the package too)

See https://github.com/python/typeshed/pull/5229#issuecomment-822234125
for some details

Co-authored-by: hauntsaninja <>
2021-04-20 21:55:48 -07:00
hatal175
fbf21995e3 Various stubtest fixes (#5230) 2021-04-18 09:30:00 -07:00
hatal175
c9d996fe55 Various stubtest exceptions (#5227) 2021-04-17 07:03:28 -07:00
hatal175
d3b2cafa85 builtins stubtest exceptions (#5219) 2021-04-16 10:41:04 -07:00
hatal175
82be016aa4 Various packages stubtest fixes (#5221) 2021-04-15 21:04:40 -07:00
hatal175
bf201c8201 Various stubtest fixes (#5215) 2021-04-14 19:14:07 -07:00
hatal175
f89cff3bf8 Fixing product and combinations (#5213) 2021-04-13 08:45:19 +02:00
hatal175
2ae49e1307 http/html stubtest fixes (#5208) 2021-04-12 13:37:09 +02:00
hatal175
7adb0213f7 Convert itertools functions to classes (#5211) 2021-04-12 12:28:51 +02:00
hatal175
472485d80a email stubtest exceptions (#5207) 2021-04-11 07:25:48 -07:00
hatal175
b308c1f964 bz2 stub exceptions (#5199) 2021-04-10 19:53:05 -07:00
hatal175
25bac1d716 csv, ctypes, configparser explanations (#5204) 2021-04-10 19:18:22 -07:00
hatal175
e26971a082 ssl stubtest exception fix/explanation (#5137) 2021-04-10 17:00:35 +02:00
hatal175
5fef564636 Protobuf text_format stubs (#5167)
Fixes #1781
2021-04-08 18:02:38 -07:00
hatal175
413614aa83 xml stubtest exceptions (#5161)
* Explaining xml stubtest exceptions

* Fix 3.6/3.7 ExternalEntityParserCreate

* Fix typos and formatting

* Missing return type

* Reverting ExternalEntityParserCreate change to see error

* Remove unused sys import

* Readd ExternalEntityParserCreate with explanations
2021-04-08 17:43:51 -07:00
hatal175
fd2a176094 Allow per distribution mypy strictness options (#5169)
As requested by https://github.com/python/typeshed/issues/1526.

This addition takes mypy configuration from each distribution metadata file and constructs a single mypy.ini to run with. It assumes there is no mypy.ini but in case we ever need one, it would be simple to add these on top of an existing configuration file.
Might be relevant for #2852

As the issue did not really specify how the configuration would look, I added the following:
- You may add a mypy-tests section to the metadata file.
It looks like this:
[mypy-tests]
[mypy-tests.yaml]
module_name = "yaml"
[mypy-tests.yaml.values]
disallow_incomplete_defs = true
disallow_untyped_defs = true

- module_name can be of the form "a.*" like in mypy.ini.
- You can add several module sections for complex distributions with several modules.
- I added the '--warn-incomplete-stub' option since it is made specifically for typeshed runs. See docs.
2021-04-07 21:30:08 -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
hatal175
82130cca56 Fix distutils and difflib stubtest exceptions (#5182) 2021-04-05 12:00:32 -07:00
hatal175
ef9b37ecab codecs stubtest exceptions (#5179) 2021-04-03 22:44:16 -07:00
Jake Bailey
f626da6553 Bump pyright to 1.1.126, enable 3.10 testing (#5153) 2021-03-30 11:57:55 -07:00
Shantanu
54392b1e12 allowlist new "not a function" errors (#5155)
stubtest now checks this for overloads as well (previously it didn't,
due to some combination of laziness, that this used to short circuit and
prevent signature checking, and the fact that these are all not super
helpful)

Co-authored-by: hauntsaninja <>
2021-03-29 22:44:18 -07:00
hatal175
20a6de8fdd Stubtest exceptions for sys, symtable, sysconfig and tarfile (#5138) 2021-03-26 21:33:19 -07:00
hatal175
5b730d4ded Fix Shlex stubtest errors (#5135) 2021-03-23 20:56:47 -07:00
hatal175
88a8d0ccbc Explaining/Fixing asyncio allowlist exceptions (#5132) 2021-03-23 17:14:30 -07:00
Shantanu
e380432825 comment on memoryview.cast (#5118)
Co-authored-by: hauntsaninja <>
2021-03-15 17:26:47 -07:00
hatal175
3de5d893de Add Curses ACS Codes (#5116)
Closes: #5115
2021-03-15 15:24:32 +01:00
Eric Traut
c92e3cb228 Update pyright CI test to use the latest version of pyright (1.1.118). (#5092)
Update pyright CI test to use the latest version of pyright (1.1.118). Enable all but one of pyright's strictest checks. Add a "# type: ignore" to `__new__` method in `weakref.KeyRef` because it uses a non-standard name for the `cls` parameter, which is flagged as an error by pyright.

Co-authored-by: Eric Traut <erictr@microsoft.com>
2021-03-05 12:12:18 -08:00
Sebastian Rittau
2b19c761ec Fix build (#5086)
Run the mypy test suite using Ubuntu 18.04. Ubuntu 20.04 doesn't have a package for virtualenv on Python 2.

Also, curses.color_pair() now has a named argument.
2021-03-04 17:11:37 +01:00
Jake Bailey
0fa7e73027 Run pyright on matrix of platforms and python versions (#5072)
* Run pyright on matrix of platforms and python versions

* Drop 3.10 from matrix, as it fails
2021-02-25 16:24:32 -08:00
Sebastian Rittau
c152e050f5 Fix stubtest errors (#5063)
A security fix added a "separator" argument to several URL parsing
functions and method in point releases:

* 3.6.13
* 3.7.10
* 3.8.8
* 3.9.2

Until all these versions are available on the GitHub Actions runners,
we need to whitelist the functions in the stubtests.
2021-02-24 14:37:38 +01:00
Jake Bailey
c00c7258ea Add pyright to test suite, pyrightconfig.json (#5059)
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2021-02-23 23:07:42 +01:00
Eric Traut
ffcd592aef Added support for | operator for combining two TypedDict instances (#5054)
Co-authored-by: Eric Traut <erictr@microsoft.com>
2021-02-23 10:04:31 +01:00
Akuli
903f74a68e tkinter.Tk.eval self fix (#5023)
Fixes #5019
2021-02-15 07:52:06 -08:00
Ivan Levkivskyi
55549ea01f More consistency checks for dependencies (#4990)
Closes #4988

Co-authored-by: Ivan Levkivskyi <ilevkivskyi@dropbox.com>
2021-02-01 15:16:53 +00:00
Ivan Levkivskyi
e2fd852952 Add more consistency tests (#4983)
Follow up fo #4971

Co-authored-by: Ivan Levkivskyi <ilevkivskyi@dropbox.com>
2021-01-29 17:23:35 +00:00
Rebecca Chen
ce24720a1a Fix and re-enable pytype_test (#4975)
For now, the test requires changes that have been merged into the pytype master branch but not yet released. I'll update requirements-tests-py3.txt again once I've cut a new release (hopefully later this week).

* Fix pytype_test.
* Re-enable pytype_test.
* Remove continue-on-error from pytype_test.
* Temporarily install pytype from its master branch, as the code to
  support the new directory structure hasn't been released yet.
* Set TYPESHED_HOME before using pytype.pytd.Typeshed().
2021-01-27 22:00:27 +00: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
Rune Tynan
6870caf79c Add _TemporaryFileWrapper (#4559) 2021-01-23 16:54:31 +01:00
Rune Tynan
6aa5cc691c Add _collections_abc module (#4000)
* Add _collections_abc module
* Rearrange collections.abc and collections to re-export from _collections_abc

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2021-01-23 16:17:57 +01:00
github-actions[bot]
88aa777568 Remove unused stubtest whitelist entries (#4966)
Co-authored-by: hauntsaninja <hauntsaninja@users.noreply.github.com>
2021-01-22 21:03:02 -08:00
Shantanu
eb9d995362 allowlist ctypes.wintypes (#4961)
The unused cronjob removed this for unclear reasons in #4935

Co-authored-by: hauntsaninja <>
2021-01-21 18:46:10 -08:00
Rebecca Chen
a7c4663e39 Speed up pytype_test by reusing the pyi loader. (#4960)
I noticed that the pytype parse test was getting quite slow again. This
is a somewhat hacky change that caches pytype's internal pyi loader to
avoid parsing files multiple times. On my machine, the test goes from
taking ~6m to complete to ~30s.
2021-01-21 18:44:06 -08:00
Shantanu
053e0df0a5 Stub for ossaudiodev (#4944) 2021-01-19 20:25:02 +01:00
Shantanu
5df4c3d275 dataclasses: various fixes (#4937) 2021-01-17 16:54:08 -08:00
Shantanu
8de9b856e4 itertools: fix postional-only args, stubtest whitelist (#4936) 2021-01-16 13:31:11 +01:00
github-actions[bot]
a7a037b7ae Remove unused stubtest whitelist entries (#4935)
Co-authored-by: hauntsaninja <hauntsaninja@users.noreply.github.com>
2021-01-15 21:39:33 -08:00
Akuli
41ba271160 tkinter: add type hints to Wm methods (#4925) 2021-01-09 19:26:30 +01:00