Commit Graph

656 Commits

Author SHA1 Message Date
Jelle Zijlstra ddc6eda10a symtable: has_exec was removed in 3.9 (#7911) 2022-05-21 17:50:27 +02:00
Jelle Zijlstra 39c777f70c pydoc: 3.11 changes (#7910) 2022-05-21 17:49:39 +02:00
Jelle Zijlstra 237b1bb189 binascii.a2b_base64: new param in 3.11 (#7909)
https://github.com/python/cpython/commit/35b98e38b6edd63153fc8e092f94cb20725dacc1
2022-05-21 08:36:03 -07:00
Jelle Zijlstra 9c0c631e46 gettext.install: names is kw-only in 3.11 (#7908) 2022-05-21 08:22:34 -07:00
Jelle Zijlstra 8b58371278 subprocess: new params in 3.11 (#7907) 2022-05-21 16:07:50 +01:00
Jelle Zijlstra 0198d75153 types: 3.11 (and earlier) fixes (#7900)
- New attributes in 3.11
- Arguments to CodeType.__init__ are always positional (have fun)
- co_consts can use object instead of Any
2022-05-21 07:37:11 -07:00
Jelle Zijlstra 7576805aee zipfile: 3.11 fixes (#7898)
* zipfile: 3.11 fixes

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-05-21 09:22:32 +01:00
Jelle Zijlstra 585517b20e stubtest: put all the incorrect __get__ sigs together (#7899) 2022-05-20 09:47:02 -07:00
Jelle Zijlstra e7cbde0928 xml: stubtest fixes (#7890) 2022-05-20 13:03:45 +02:00
Jelle Zijlstra 26fa57ab78 traceback: update for py311 (#7886) 2022-05-19 19:14:12 -07:00
Jelle Zijlstra 0b7df3b2aa dataclasses: fix and sort stubtest complaints (#7888) 2022-05-19 19:13:22 -07:00
Jelle Zijlstra 4220712aab dis: add adaptive argument for 3.11 (#7889) 2022-05-19 18:27:34 -07:00
Jelle Zijlstra 64766c8521 locale: add locale.getencoding (#7887)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-05-19 18:20:16 -07:00
Jelle Zijlstra 1ffb1bdc0e wsgiref: categorise stubtest issues (#7885) 2022-05-19 18:10:56 -07:00
Alex Waygood aa72cb1dcf Run pyupgrade on the tests directory (#7880) 2022-05-19 14:16:53 +01:00
Jelle Zijlstra 6f2c53f3b0 _imp: fix stubtest issues, add Python 3.11 items (#7878) 2022-05-19 14:43:58 +02:00
Alex Waygood 44d33f2fdb Add colour to the output of mypy_test, take 2 (#7879)
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2022-05-19 13:29:15 +01:00
Jelle Zijlstra 250f3d92e7 ast: fix stubtest issues (#7877)
Add annotations for `_ast.Tuple.dims` and `ast.main()`. Add allowlist comments for others.
2022-05-19 10:13:08 +01:00
Atsu Kakitani d389b5f9cb Import SQLAlchemy types in Flask-SQLAlchemy (#7861) 2022-05-19 08:19:49 +02:00
Jelle Zijlstra 4191906e6e 3.11: move some stubtest entries to wontfix list (#7876) 2022-05-19 08:14:44 +02:00
Alex Waygood 04dde4d000 enum: More changes for 3.11 (#7862) 2022-05-18 19:35:22 -07:00
Alex Waygood a348dac6e7 Revert "Add colour to the output of mypy_test" (#7874)
Revert "Add colour to the output of `mypy_test` (#7872)"

This reverts commit 753eb053ac.
2022-05-18 17:13:06 -07:00
Alex Waygood 753eb053ac Add colour to the output of mypy_test (#7872)
And gracefully exit on KeyboardInterrupt.
2022-05-19 00:36:59 +01:00
Sebastian Rittau 3aaa1d0ada Upgrade pyright to 1.1.247 (#7867) 2022-05-18 19:56:19 +01:00
Sebastian Rittau 7ca82d5fb4 stubtest third party: remove extra line when skipping a distribution (#7864) 2022-05-18 20:15:55 +02:00
Alex Waygood a98a1ead06 Improve output of mypy_test when reporting errors (#7863) 2022-05-18 19:10:54 +01:00
Jelle Zijlstra 7998906226 re: 3.11 fixes (#7859) 2022-05-17 21:42:23 -07:00
Jelle Zijlstra bd394d2486 builtins: add BaseException.add_note in py311 (#7860) 2022-05-17 20:32:28 -07:00
Jelle Zijlstra a01f98c361 sqlite3.Blob: fix stubtest errors (#7858) 2022-05-17 19:50:19 -07:00
Jelle Zijlstra 8f5a83516b tempfile.SpooledTemporaryFile: inherit from IOBase on 3.11 (#7802)
python/cpython#29560

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-05-17 18:41:47 -07:00
Jelle Zijlstra eab82c838a asyncio: updates for 3.11 (#7844)
CPython changes:

- https://github.com/python/cpython/commit/13c10bfb777483c7b02877aab029345a056b809c
- https://github.com/python/cpython/commit/9523c0d84f351a610dc651b234461eb015fa3b82
- https://github.com/python/cpython/commit/9f04ee569cebb8b4c6f04bea95d91a19c5403806
- https://github.com/python/cpython/commit/d03acd7270d66ddb8e987f9743405147ecc15087
- https://github.com/python/cpython/commit/195a46d6ffd4cec6c5fb69c5890f8b1758ac91ca

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-05-17 18:11:29 -07:00
Sebastian Rittau b65ef3a722 Make third party stubtest output more succinct (#7853)
stubtest_third_party.py will now only print a single line when the test
succeeds for a certain distribution, unless the "-v" option is given.
When the test fails or "-v" is given, will still print the full output.

The success status is now colored to make spotting failures easier.

stdout/stderr is now used consistently: The distribution name and
success status is always printed to stdout, all other output goes to
stderr. Running the script with "2>/dev/null" will only show the success
status of the test, one per line.
2022-05-17 16:10:58 -07:00
Alex Waygood 171ea08f0d Add __class_getitem__ to classes in logging and csv (#7830)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-05-17 14:12:42 +01:00
Shantanu cb45a4387f stubtest: organise allowlists (#7847)
Co-authored-by: hauntsaninja <>
2022-05-16 21:29:39 -07:00
Shantanu b445bb8856 stubtest: test against 3.11 (#7845) 2022-05-16 19:50:30 -07:00
Shantanu 05c929d42c stubtest_stdlib: [minor] remove unused code (#7846)
Co-authored-by: hauntsaninja <>
2022-05-16 19:40:46 -07:00
Rick Voormolen 693c4f19b4 Mark Future._callbacks as a @property (#7829) 2022-05-11 11:13:29 +02:00
Shantanu 468d8adff1 stubtest_third_party: show package versions on failure (#7826)
Co-authored-by: hauntsaninja <>
2022-05-11 08:08:02 +02:00
Alex Waygood f8547a3f31 Use flake8-pyi 22.5.0, remove redundant parts of check_new_syntax (#7821) 2022-05-10 09:34:41 -07:00
Jelle Zijlstra 5c13f8bbce ast: FormattedValue.conversion cannot be None (#7810)
```
In [4]: ast.dump(ast.parse('f"{x!r}"'))
Out[4]: "Module(body=[Expr(value=JoinedStr(values=[FormattedValue(value=Name(id='x', ctx=Load()), conversion=114)]))], type_ignores=[])"

In [5]: ast.dump(ast.parse('f"{x}"'))
Out[5]: "Module(body=[Expr(value=JoinedStr(values=[FormattedValue(value=Name(id='x', ctx=Load()), conversion=-1)]))], type_ignores=[])"
```
(On 3.9 but I don't think this has changed since 3.6.)

The stdlib also assumes this: https://github.com/python/cpython/blob/main/Lib/ast.py#L1211 (`chr(None)` doesn't work).
2022-05-08 19:42:38 -07:00
Alex Waygood 8d8420bc54 Fix bugs in check_new_syntax.py (#7808) 2022-05-08 21:59:19 +01:00
Alex Waygood bb39bdfd30 Add test cases for pow that are meant to fail a type check (#7760) 2022-05-08 08:16:37 -07:00
Alex Waygood 3ed7e3ba50 csv: annotate keyword arguments in various functions and methods (#7788) 2022-05-07 21:01:20 -07:00
Alex Waygood c6b3211afa Improve test-suite documentation (#7756)
- mypy_test and pyright no longer just test the stubs, they now also test other parts of typeshed as well.
- pytype_test.py can now be run on 3.10, meaning the whole test suite can now also be run on 3.10.
- Various test scripts now have from `__future__ import annotations`, meaning they can now only be run on 3.7+.
- Clean up the description of pyright_test.py, which had a slightly confusing wording.
- Also fix the `--dry-run` config option in mypy_test.py, which I accidentally broke in #7746
2022-04-30 12:43:48 -06:00
Alex Waygood 8b118b236d Run mypy on the test cases and test scripts (#7746) 2022-04-30 06:39:07 -06:00
Alex Waygood 9d450cb50c Make test scripts pass mypy --strict (#7745)
- Add several type hints to untyped functions.
- While we're at it, upgrade several annotations to use modern syntax by using `from __future__ import annotations`. This means that the tests can't be run on Python 3.6, but 3.6 is EOL, and it is already the case that some scripts in this directory can only be run on more recent Python versions. E.g. `check_new_syntax.py` uses `ast.unparse`, which is only available in Python 3.9+.
- Fix a few pieces of code that didn't type check.
2022-04-29 21:55:12 -06:00
Alex Waygood 002c8e2586 Cleanup mypy_test.py (#7738) 2022-04-28 12:00:54 -06:00
Akuli bfa918880f asyncio: expose WriteTransport.get_write_buffer_limits on all Python versions (#7718) 2022-04-27 16:38:25 +03:00
Sebastian Rittau 02310d93da Update pyright to 1.1.240 (#7701) 2022-04-27 15:02:30 +02:00
Sebastian Rittau f7aa41245e Drop Python 2 support in third-party stubs (#7703) 2022-04-27 15:32:17 +03:00