Commit Graph

7406 Commits

Author SHA1 Message Date
Alex Waygood
910397c714 mypy_test.py: Simplify add_third_party_files() (#9476) 2023-01-08 12:25:06 -08:00
Avasam
41de5317b5 Add FileDescriptorOrPath and Unused type aliases (#9475) 2023-01-08 10:05:51 +00:00
Avasam
f115a3c58d Offer sensible default VSCode settings (#9436) 2023-01-08 09:50:20 +00:00
Alex Waygood
4d6fda99f0 mypy_test.py: Allow non-types dependencies (#9408)
The approach is pretty similar to the approach I took in #9382 for regr_test.py: dynamically create virtual environments for testing stubs packages in isolation. However, since mypy_test.py tests all of typeshed's stubs in succession (and since lots of typeshed's stubs packages depend on other typeshed stubs packages), the performance issues with creating a virtual environment for testing each stubs package are even more severe than with regr_test.py.

I mitigate the performance issues associated with dynamically creating virtual environments in two ways:

- Dynamically creating venvs is mostly slow due to I/O bottlenecks. Creating the virtual environments can be sped up dramatically by creating them concurrently in a threadpool. The same goes for pip installing the requirements into the venvs -- though unfortunately, we have to use pip with --no-cache-dir, as the pip cache gets easily corrupted if you try to do concurrent reads and writes to the pip cache.

- If types-pycocotools requires numpy>=1 and types-D3DShot also requires numpy>=1 (for example), there's no need to create 2 virtual environments. The same requirements have been specified, so they can share a virtual environment between them. This means we don't have to create nearly so many virtual environments.
2023-01-07 23:57:49 +00:00
hamdanal
2c9816e788 Add stubs for netaddr (#9431)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-01-07 16:22:09 +00:00
Avasam
64e02a05c2 Use pyasn1 in python-jose (#9469) 2023-01-07 15:32:28 +00:00
github-actions[bot]
319597cba4 [stubsabot] Bump ujson to 5.7.* (#9473)
Release: https://pypi.org/pypi/ujson/5.7.0
Homepage: https://github.com/ultrajson/ultrajson
Diff: https://github.com/ultrajson/ultrajson/compare/5.6.0...5.7.0

Stubsabot analysis of the diff between the two releases:
 - Total lines of Python code added: 38.
 - Total lines of Python code deleted: 0.

If stubtest fails for this PR:
- Leave this PR open (as a reminder, and to prevent stubsabot from opening another PR)
- Fix stubtest failures in another PR, then close this PR

Note that you will need to close and re-open the PR in order to trigger CI

Co-authored-by: stubsabot <>
2023-01-07 00:17:21 +00:00
Avasam
e584337a72 Update actively supported type checker list in readme (#9472)
- Added pyright mention in readme
- Add links to help navigate away readers looking for type-checkers
- Add missing code-block
2023-01-06 13:45:51 -08:00
Avasam
b5048a00e6 Add stubs for pyasn1 (#9437)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-01-06 18:25:48 +00:00
Sebastian Rittau
b1cb9c8a8f Update SQLAlchemy stubs to 1.4.46 (#9464)
Replace `Any` with `Incomplete` where applicable
2023-01-05 19:37:12 +00:00
bzoracler
dfe844c200 gdb-stubs fixes (#9439)
* fix: Union subprinters with `None`

See a4418a9c6f/gdb/python/lib/gdb/printing.py (L52-L55)

* fix: Allow callables as argument to `printer`

See a4418a9c6f/gdb/python/lib/gdb/printing.py (L77) and the description of "function / old way" in the body of `register_pretty_printer`.

The new union's signature is equivalent to `gdb.printing.PrettyPrinter(...).__call__`.

* fix: make `gdb.Block` iterable over `gdb.Symbol`

See https://sourceware.org/gdb/onlinedocs/gdb/Blocks-In-Python.html#Blocks-In-Python:

> A gdb.Block is iterable. The iterator returns the symbols (see [Symbols In Python](https://sourceware.org/gdb/onlinedocs/gdb/Symbols-In-Python.html#Symbols-In-Python)) local to the block.

Implementation of `gdb.BlockIterator` is given in https://github.com/bminor/binutils-gdb/blob/gdb-12-branch/gdb/python/py-block.c. As with many of the other classes, `BlockIterator` is actually imported from the built-in `_gdb` module (a4418a9c6f/gdb/python/lib/gdb/__init__.py (L28)).

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-01-05 16:07:36 +00:00
Juan Amari
605378de6e Bump redis to 4.4.0 (#9458)
Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
2023-01-05 15:25:11 +00:00
Spencer Brown
3dfc3a383c Add type annotations for babel.messages subpackage (#9455) 2023-01-05 12:39:41 +01:00
Avasam
6a6a677ae3 Improve various jmespath types
Merge `jmespath` from microsoft/python-type-stubs
2023-01-05 11:37:08 +00:00
Avasam
3b94e71280 Add types-html5lib as a dependency of types-beautifulsoup4 (#9462)
Remove the need for subclassing `Any`
2023-01-05 10:40:17 +00:00
Avasam
9041a925cf Add types-docutils as a dependency of types-setuptools (#9460)
Remove the need for subclassing `Any`
2023-01-05 10:37:44 +00:00
Avasam
7fdbb7228c Bump Pillow to 9.4 (#9453)
Closes #9448
2023-01-04 23:38:41 +01:00
Avasam
70025c3723 Support third-party stub external dependencies in pytype (#9449)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-01-04 19:32:23 +00:00
github-actions[bot]
8365b1aaef Bump mock to 5.0.* (#9423) 2023-01-04 11:29:58 +01:00
Martin Fischer
554989e31f stdlib: Fix types of semi-public Message methods (#9456) 2023-01-04 11:21:33 +01:00
Ethan Furman
3aceb1abd5 Update SimpleHTTPRequestHandler for changes in 3.12 (#9452)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-01-03 23:59:40 +00:00
Alex Waygood
28abff4efe Revert "Use --additional-flags='check-untyped-defs' when running mypy_primer" (#9451)
Revert "Use `--additional-flags='check-untyped-defs'` when running mypy_primer (#9433)"

This reverts commit f794cdd582.
2023-01-03 22:58:32 +00:00
Avasam
3e24c65c3b Rework how pyright is run in CI to allow for non-types dependencies(#9434)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-01-03 22:43:56 +00:00
Avasam
7c15e6998f Autoformat YAML files (#9450) 2023-01-03 08:55:06 +01:00
github-actions[bot]
56742bd2c2 [stubsabot] Bump singledispatch to 4.0.* (#9447)
Release: https://pypi.org/pypi/singledispatch/4.0.0
Homepage: https://github.com/jaraco/singledispatch
Diff: https://github.com/jaraco/singledispatch/compare/v3.7.0...v4.0.0

Stubsabot analysis of the diff between the two releases:
 - Total lines of Python code added: 381.
 - Total lines of Python code deleted: 266.

If stubtest fails for this PR:
- Leave this PR open (as a reminder, and to prevent stubsabot from opening another PR)
- Fix stubtest failures in another PR, then close this PR

Note that you will need to close and re-open the PR in order to trigger CI

Co-authored-by: stubsabot <>
2023-01-03 00:21:56 +00:00
github-actions[bot]
69077291fe [stubsabot] Bump pyOpenSSL to 23.0.* (#9446)
Release: https://pypi.org/pypi/pyOpenSSL/23.0.0
Homepage: https://pyopenssl.org/
Diff: https://github.com/pyca/pyopenssl/compare/22.1.0...23.0.0

Stubsabot analysis of the diff between the two releases:
 - Total lines of Python code added: 83.
 - Total lines of Python code deleted: 37.

If stubtest fails for this PR:
- Leave this PR open (as a reminder, and to prevent stubsabot from opening another PR)
- Fix stubtest failures in another PR, then close this PR

Note that you will need to close and re-open the PR in order to trigger CI

Co-authored-by: stubsabot <>
2023-01-03 00:21:40 +00:00
Avasam
0edcfa13ad Add syntax highlight to all shell code blocks (#9445) 2023-01-02 23:55:25 +00:00
Avasam
c45999d905 Re-enable NQA102 (#9426)
re-enable NQA102
2023-01-02 23:49:02 +00:00
Avasam
4a7e14e5ad Deduplicate stubtest command in actions (#9444) 2023-01-02 22:19:47 +00:00
Sebastian Rittau
feb9b2dc9f [influxdb-client] Annotate Point and partially client classes (#9442) 2023-01-02 18:14:39 +01:00
Alex Waygood
a7f1d3c08d Improve mypy flags for regr_test.py and typecheck_typeshed.py (#9441)
- Remove redundant flags that are now enabled by default
- Add `--pretty` to `typecheck_typeshed.py`
2023-01-02 12:01:44 +00:00
github-actions[bot]
ca28b1f24d [stubsabot] Bump Pygments to 2.14.* (#9440)
Release: https://pypi.org/pypi/Pygments/2.14.0
Homepage: https://pygments.org/
Changelog: https://github.com/pygments/pygments/blob/master/CHANGES
Diff: https://github.com/pygments/pygments/compare/2.13.0...2.14.0

Stubsabot analysis of the diff between the two releases:
 - 11 public Python files have been added.
 - 0 files included in typeshed's stubs have been deleted.
 - 7 files included in typeshed's stubs have been modified or renamed: `pygments/__init__.py`, `pygments/formatters/__init__.py`, `pygments/formatters/html.py`, `pygments/formatters/irc.py`, `pygments/lexer.py`, `pygments/lexers/__init__.py`, `pygments/sphinxext.py`.
 - Total lines of Python code added: 3094.
 - Total lines of Python code deleted: 1387.

If stubtest fails for this PR:
- Leave this PR open (as a reminder, and to prevent stubsabot from opening another PR)
- Fix stubtest failures in another PR, then close this PR

Note that you will need to close and re-open the PR in order to trigger CI

Co-authored-by: stubsabot <>
2023-01-02 00:35:13 +00:00
Avasam
c41fbc1303 Add typing-extensions to requirements-tests.txt (#9438) 2023-01-01 11:25:51 +00:00
Avasam
46f0d918ef A more accurate termcolor.colored fallback (#9435) 2022-12-31 22:52:26 +00:00
Alex Waygood
f794cdd582 Use --additional-flags='check-untyped-defs' when running mypy_primer (#9433) 2022-12-31 11:01:54 -08:00
Alex Waygood
ba54f148ef Colorize third-party stubtest and stubsabot outputs in CI (#9432) 2022-12-31 14:22:22 +00:00
hamdanal
6c32486971 pytype_test.py: fix f-string missing “f” (#9430) 2022-12-31 10:07:02 +00:00
Sebastian Rittau
3e00c01ca6 Add stubs for influxdb-client (#9429) 2022-12-30 14:54:56 -08:00
Ned Batchelder
379d449894 zipimporter.get_data returns bytes, not str(#9428)
Fixes #9427
2022-12-29 13:59:51 -08:00
Nikita Sobolev
6f6dad117d compile can only work with ast.Module | ast.Expression | ast.Interactive (#9424) 2022-12-29 11:25:07 +01:00
Alex Waygood
5fb21861f9 Colorize flake8 output in CI (#9422) 2022-12-28 12:49:51 +01:00
Avasam
23ac9bff19 Check for unused pyright: ignore and differentiate from mypy ignores (#9397) 2022-12-28 10:44:29 +00:00
Avasam
07f587dc70 Bump python-xlib to 0.33 (#9420) 2022-12-27 20:07:12 -08:00
Avasam
3c58efd9a2 mypy_primer: Resolve node.js 12 actions deprecation warning (#9421) 2022-12-28 02:23:44 +00:00
Gulshan Singh
c13a9ed985 Add type stubs for gdb.Value comparison operators (#9411) 2022-12-27 21:56:19 +00:00
Sebastian Rittau
0cf685cc17 Fully annotate ExifRead (#9403)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-12-27 17:46:54 +00:00
Alex Waygood
27983aa929 ast.NodeVisitor: add visit_TryStar on 3.11+ (#9418) 2022-12-27 18:36:53 +01:00
Alex Waygood
fd3e64ac3e regr_test.py: Fix out-of-date comment (#9419) 2022-12-27 17:26:48 +00:00
Will Frey
f174355b31 Allow indent to be str in JSONEncoder (#9417) 2022-12-27 16:26:16 +01:00
Alex Waygood
2704a8d916 pyaudio: fix stubtest failures (#9416) 2022-12-27 16:11:01 +01:00