Commit Graph

7330 Commits

Author SHA1 Message Date
hamdanal
3592dba338 Stubtest_third_party.py: better error message if ensurepip isn't available 2022-12-18 12:05:31 +00:00
Alex Waygood
7a9818e565 Colorize output of stdlib stubtest in CI (#9379) 2022-12-17 13:08:17 -08:00
Sam Bull
62accb35b8 Improve netrc types on py311+ (#9376) 2022-12-17 14:02:22 +00:00
Alex Waygood
04d4cbd92f pycurl: Add missing constants (#9373) 2022-12-16 17:48:14 -08:00
Jukka Lehtosalo
2b20b70cf2 Revert "Use Literal for compression in zipfile (#9346)" (#9367)
This reverts commit 034cfab4d6.

The commit exposed the value of the compression constants, which seem
to be implementation details, in the public API. I don't see anything
in the documentation about the values of the constants such as
`ZIP_STORED`:
https://docs.python.org/3/library/zipfile.html?highlight=zipfile#zipfile.ZipFile

Example where this makes a difference:
```
from typing import Literal
import zipfile

def f1(p: str, compression: int) -> None:
    """Error: compression should have the type Literal[0, 8, 12, 14]"""
    zipfile.ZipFile(p, compression=compression)

def f2(p: str, compression: Literal[0, 8, 12, 14]) -> None:
    """Works, but cryptic and exposes internal implementation details"""
    zipfile.ZipFile(p, compression=compression)
```

The values are of constants need to be explicitly specified if somebody
wants to wrap `zipfipe.ZipFile`, which arguably exposes implementation
details in a problematic fashion.

Here is a real-world example where this caused a regression:
https://github.com/pytorch/vision/blob/main/torchvision/datasets/utils.py#L301
2022-12-16 13:49:16 +00:00
github-actions[bot]
119cc62b77 [stubsabot] Bump hdbcli to 2.15.* (#9369)
Release: https://pypi.org/pypi/hdbcli/2.15.17
Homepage: https://www.sap.com/
2022-12-16 00:18:41 +00:00
Alex Waygood
c78bc57f78 shutil.rmtree: add avoids_symlink_attacks attribute (#9366) 2022-12-15 09:56:58 +00:00
Alex Waygood
9bddd3a3f1 Bump pyright to 1.1.284 (#9363) 2022-12-14 20:07:27 +00:00
Sebastian Rittau
fe9c7384fd pika: Make Method generic, annotate DeclareOk (#9360)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-12-14 19:42:57 +00:00
Alex Waygood
b356abcbda Stdlib stubtest: Temporarily pin Python to 3.10.8 and 3.11.0 in CI (#9361)
Stubtest: pin Python to 3.10.8 and 3.11.0 in CI
2022-12-14 10:48:22 -08:00
Álvaro Mondéjar
95be7512ed Add types for jmespath internals (#9338)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-12-14 18:30:04 +00:00
Sebastian Rittau
92d130f6b6 Distribute our pika stubs under an alternate name (#9358)
Cf. #9246
2022-12-14 11:36:13 +00:00
Sebastian Rittau
d30941c747 Update to SQLAlchemy 1.4.45 (#9359)
Use Incomplete in touched files
2022-12-14 11:02:16 +00:00
Viicos
034cfab4d6 Use Literal for compression in zipfile (#9346) 2022-12-14 10:46:15 +00:00
github-actions[bot]
e476c12e0d Update dockerfile-parse to 2.0.* (#9357) 2022-12-14 11:30:55 +01:00
github-actions[bot]
65dae123e5 Update dj-database-url to 1.2.* (#9355) 2022-12-14 11:30:01 +01:00
AMBER MURTUZA ANSARI
956873d0ce Fpdf2: annotate more graphics_state properties (#9337) 2022-12-13 18:12:09 +00:00
pre-commit-ci[bot]
12671e87e2 Bump black and isort (#9356)
updates:
- [github.com/psf/black: 22.10.0 → 22.12.0](https://github.com/psf/black/compare/22.10.0...22.12.0)
- [github.com/pycqa/isort: 5.10.1 → 5.11.1](https://github.com/pycqa/isort/compare/5.10.1...5.11.1)

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-12-13 02:09:02 +00:00
Lucina
da2d39f16d Mark asyncio.Runner as final (#9353)
As per 71b032635d/Lib/asyncio/runners.py (L47)
2022-12-12 00:33:30 -08:00
Lucina
ae41747836 Add loop_factory argument to asyncio.run on 3.12+ (#9354) 2022-12-12 07:07:31 +00:00
Terrance
4661af99c3 Annotate unittest.TestCase.skipTest() as no-return (#9352)
Annotate unittest.TestCase.skipTest() as no-return

This method unconditionally raises unittest.SkipTest, which ends a test
method early.  unittest.TestCase.fail() works similarly, and is already
annotated with NoReturn to indicate this behaviour.
2022-12-11 18:07:09 +00:00
Dominik Lenart
75d5a5b936 Improve typing for ast nodes which represent assignment behaviour (#9326) 2022-12-11 16:54:38 +00:00
Jelle Zijlstra
7ca7b0c659 Add Nikita Sobolev to maintainers (#9351) 2022-12-11 09:43:59 +03:00
Jelle Zijlstra
388d7839d9 regr_test.py: improve interaction between --all and --quiet flags (#9349)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-12-10 21:39:33 +00:00
Joshua Bronson
1ba0c9815e Fix false positive with calling .register() on KeysView subclass (#9348)
* Revert "`Collection` is `Sized` (#8977)"

This reverts commit 5bbba5d008.

* Revert "typing: remove metaclass from Sized (#9058)"

This reverts commit a3ce512095.

* Add regression test for issue 9296.
2022-12-10 10:09:28 -08:00
Sebastian Rittau
a74df38df0 Message.get_content_charset() returns None by default (#9344) 2022-12-09 07:19:18 -08:00
Avasam
307dd08a6e Bump pyinstaller to 5.7.* (#9343) 2022-12-08 10:45:30 +00:00
Alex Waygood
40bfc266f7 3rd-party stubtest: run on Python 3.10 (#9342) 2022-12-07 20:25:57 +00:00
Alex Waygood
0220577a31 Remove stubs for certifi (#9341)
Closes #8048
2022-12-07 08:06:35 -08:00
github-actions[bot]
0eecaf4716 [stubsabot] Make google-cloud-ndb a namespace package; bump pinned version to 2.0.* (#9339)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-12-07 10:16:16 +00:00
github-actions[bot]
b1554be2c0 [stubsabot] Bump flake8-bugbear to 22.12.6 (#9340)
Release: https://pypi.org/pypi/flake8-bugbear/22.12.6
Homepage: https://github.com/PyCQA/flake8-bugbear
Changelog: https://github.com/PyCQA/flake8-bugbear#change-log
Diff: https://github.com/PyCQA/flake8-bugbear/compare/22.10.27...22.12.6

Stubsabot analysis of the diff between the two releases:
 - 1 public Python file has been added: `tests/b905_py310.py`.
 - 0 files included in typeshed's stubs have been deleted.
 - 1 file included in typeshed's stubs has been modified or renamed: `bugbear.py`.
 - Total lines of Python code added: 55.
 - Total lines of Python code deleted: 9.

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 <>
2022-12-07 00:15:30 +00:00
Eddie Darling
0880741ba3 Update jsonschema protocols.pyi (#9295)
These take in an instance, which need not be a JSON object. 
They could for example be arrays. 
See [this example](https://python-jsonschema.readthedocs.io/en/stable/api/jsonschema/protocols/#jsonschema.protocols.Validator.iter_errors) on the jsonschema docs.

```python
>>> schema = {"maxItems" : 2}
>>> Draft202012Validator(schema).is_valid([2, 3, 4])
False
```
2022-12-06 21:08:11 +00:00
Alex Waygood
fc69819a89 Don't run mypy_primer on stubsabot PRs (#9332)
We can be fairly confident that PRs updating only a `METADATA.toml` file will never produce an interesting `mypy_primer` diff.
2022-12-05 23:47:59 -08:00
Mike Placentra
89fb1d5521 fix type for multiprocessing.log_to_stderr(): allow int level (#9334)
Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
2022-12-05 22:44:26 +00:00
Avasam
0c3cf8f5e6 More pywin32 stub completion (#9308)
Completed based on usage of the following libraries in mypy_primer:
- apprise
- comtypes
As well as some of the most popular libraries that use both pywin32 and mypy (all over 1k stars on github):
- certbot
- anki
- flexget
- monkey
- twisted
- salt

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-12-05 22:23:35 +00:00
Huazuo Gao
cdf5cc34f2 types: fix signature of coroutine (#9333) 2022-12-05 12:00:32 -08:00
Ilya Konstantinov
578cebe1c5 protobuf: Annotate well_known_types.pyi (#9323)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-12-05 18:49:55 +00:00
AMBER MURTUZA ANSARI
503eab31d7 fpdf:annotation of underline, font_style, font_streching (#9327)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-12-05 15:02:15 +00:00
Josiah Outram Halstead
540e0b0aa4 PIL: fix image convert palette type (#9331) 2022-12-05 13:36:30 +00:00
Steve Dignam
1c940e8914 PIL: add optimize param to save (#9328) 2022-12-05 00:16:54 +00:00
Benjamin Jones
d084079fc3 openpyxl stub: add open as an alias for load_workbook (#9324) 2022-12-02 23:24:48 +00:00
Avasam
c6b9b4ce85 Stricter settings in mypy_test (#9294) 2022-12-02 18:55:55 +00:00
Nikita Sobolev
fce46d22ff Mark dateparser as complete (#9312)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-12-02 18:50:21 +00:00
Jelle Zijlstra
00483b63e6 http.client.HTTPConnection.request accepts str as the body (#9322)
See code around ab02262cd0/Lib/http/client.py (L1328)
2022-12-02 10:49:33 -08:00
Nikita Sobolev
bc1da6a748 Remove unused code from pytype_test.py (#9317) 2022-12-02 18:33:24 +00:00
github-actions[bot]
c6126b5f52 [stubsabot] Mark chardet as obsolete since 5.1.0 (#9318)
Release: https://pypi.org/pypi/chardet/5.1.0
Homepage: https://github.com/chardet/chardet
Diff: https://github.com/chardet/chardet/compare/5.0.0...5.1.0

Co-authored-by: stubsabot <>
2022-12-01 18:24:26 -08:00
github-actions[bot]
069dbffba9 [stubsabot] Bump ujson to 5.6.* (#9319)
Release: https://pypi.org/pypi/ujson/5.6.0
Homepage: https://github.com/ultrajson/ultrajson
Diff: https://github.com/ultrajson/ultrajson/compare/5.5.0...5.6.0

Stubsabot analysis of the diff between the two releases:
 - Total lines of Python code added: 13.
 - Total lines of Python code deleted: 0.
2022-12-01 16:30:41 -08:00
AMBER MURTUZA ANSARI
ba0e073430 fpdf2: annotate draw_color, fill_color, text_color (#9282) 2022-12-01 20:46:36 +00:00
Nikita Sobolev
3c9d1bd942 Mark httplib2 as complete (#9311)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-12-01 15:21:01 +00:00
Nikita Sobolev
91c72cffd1 Remove dockerfile-parse from pyright's exclude (#9310)
Remove unnecessary dependency on types-six
2022-12-01 13:05:57 +00:00