Commit Graph

4554 Commits

Author SHA1 Message Date
Akuli
515aa6fa3d pymysql: query arguments can be any value (#5653) 2021-06-17 11:02:37 +02:00
Thomas Grainger
74091411ea widen contextlib._SupportsClose and _SupportsAclose (#5655) 2021-06-17 11:58:49 +03:00
Maarten ter Huurne
0d9521970d Mark enum.Flag.name as Optional[str] (#5611)
* Mark enum.Flag.name as Optional[str]

* Annotate enum.Flag.value
2021-06-16 19:25:47 +03:00
Sebastian Rittau
a98fceca2f Rename openssl-python to pyOpenSSL (#5649)
Remove stubtest allowlist

Set package version
2021-06-16 08:22:45 -07:00
Vasily Zakharov
ff75793531 Improve OpenSSL stubs (#5645)
* Support Python 3.
* Add OpenSSL.SSL.
* Extend OpenSSL.crypto.

Co-authored-by: Vasily Zakharov <v.zakharov@wwpass.com>
2021-06-16 16:54:30 +02:00
Jelle Zijlstra
e58070cd35 socket: allow ReadableBuffer on send* methods (#5648) 2021-06-16 15:36:56 +02:00
Sebastian Speitel
04d81a8499 Allow merging dicts of different types (#5520) 2021-06-16 06:03:15 -07:00
Oleg Höfling
725b5ef71b Loosen mapping as input type in mapping representer (#5644)
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
2021-06-16 12:05:43 +02:00
Oleg Höfling
5a1dbf7cee loosen type restrictions for mapping representer input (#5640)
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
2021-06-15 15:35:12 +02:00
joooeey
3072046430 Add Python 3.9 support in logging.basicConfig (#5639) 2021-06-15 11:33:38 +02:00
Marius Gedminas
524947dbdc Fix incorrect markupsafe.Markup return types (#5638)
Closes #5632.
2021-06-15 10:02:33 +02:00
Oleg Höfling
03809dc604 Add type hints for representer registration functions (#5636)
bump version to the current major release of PyYAML

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
2021-06-14 17:53:59 +02:00
Jelle Zijlstra
04627bfb83 Update PEP 612 status in CONTRIBUTING.md (#5635)
And add a new "Partially supported" section
2021-06-14 17:20:27 +02:00
Jelle Zijlstra
4581501c98 use ParamSpec for @contextmanager (#5476) 2021-06-14 16:38:39 +02:00
Oleg Höfling
b65fa0ed52 Add stubs for yaml.nodes and yaml.representer (py3) (#5634)
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
2021-06-14 16:13:45 +02:00
Sebastian Rittau
4c3e3a68a6 Update bleach stubs (#5631) 2021-06-14 06:50:51 -07:00
Sebastian Rittau
beb6891a3b Fix imports in paramiko (#5606) 2021-06-13 12:41:58 -07:00
Sebastian Rittau
d3ba8a3858 Pillow: fix errors found by stubtest (#5629)
* Update Pillow stubtest allowlist

* Update cryptography allowlist
2021-06-13 15:15:51 +03:00
Oleg Höfling
0744d8c30a Add stubs for yaml.error (#5627)
* type yaml.error
2021-06-13 15:13:42 +03:00
Sebastian Rittau
3368258e4a Add distributions arg to third-party stubtest (#5628)
* Add distributions arg to third-party stubtest

Make stubtest_third_party.py executable

Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-06-13 14:53:29 +03:00
Sebastian Rittau
a3a355433d Add missing Pillow stubs (#5626)
These were generated with stubgen and then slightly hand edited, mostly
by fixing imports and a few other bits and bobs.
2021-06-12 18:38:59 -07:00
Shantanu
7244ea1f71 Test third party stubs with stubtest (#5615) 2021-06-13 00:17:40 +02:00
Josh Smith
9565c595ca use TextIOWrapper for sys.__stdin__, sys.__stdout__, sys.__stderr__ (#5623) 2021-06-12 22:53:27 +02:00
Dominic Davis-Foster
48a346920b Use a TypeVar for the return types of TarFile classmethods. (#5602)
* Use a TypeVar for the return types of TarFile classmethods.

* Add TypeVar annotation to TarFile.__enter__
2021-06-12 10:54:34 +03:00
Sebastian Rittau
f28100af19 Mark cryptography as obsolete (#5619)
Bump version to 3.3 (last version before Python 2 removal)
2021-06-12 10:51:53 +03:00
Rebecca Turner
72f4057d81 Signal handler callables take int, not Signals (#5622)
The documentation for [`signal.signal`][1] points out that the current
annotation for signal handlers might be wrong (emphasis my own):

> The handler is called with two arguments: the signal **number** and the
> current stack frame (**`None` or** a frame object; for a description of frame
> objects, see the description in the type hierarchy or see the attribute
> descriptions in the `inspect` module).

And when we use them, we can see that the signal number is passed as an `int`,
not a `signal.Signals` member:

import signal

    def handler(signal_number, frame):
        print("In signal handler!")
        print("Signal number:", signal_number, type(signal_number))
        print("Stack frame:  ", frame, type(frame))

    # Set signal handler:
    signal.signal(signal.SIGHUP, handler)

    # Use it:
    signal.raise_signal(signal.SIGHUP)

Which prints:

    In signal handler!
    Signal number: 1 <class 'int'>
    Stack frame:   <frame at 0x7f804402abe0, file '<stdin>', line 12, code <module>> <class 'frame'>

[1]: https://docs.python.org/3/library/signal.html#signal.signal
2021-06-11 20:28:20 +03:00
Jelle Zijlstra
967d0b2167 Add self type to requests.Session.__enter__ (#5620)
Fixes microsoft/pyright#1976
2021-06-11 16:48:48 +02:00
Shantanu
e66ceceed0 Rename whitelist to allowlist (#5614)
Resolves #4436

I want to add stubtest for third party stubs, and figured it'd be easier
to make this change now.

Co-authored-by: hauntsaninja <>
2021-06-10 14:33:44 -07:00
Jake Bailey
c4dc935b3f Add a stricter config pass for pyright (#5612) 2021-06-10 20:10:12 +02:00
Ethan Smith
cb76f32826 Allow passing complex to complex constructor (#5609) 2021-06-09 22:58:22 +02:00
Sebastian Rittau
d143a5d04b Metadata versions field now reflects the latest supported version (#5600) 2021-06-09 20:30:44 +02:00
Sebastian Rittau
6a6d5d8fd2 Fix zincrby argument order (#5608) 2021-06-09 21:16:34 +03:00
Sebastian Rittau
d7d3926b2c Fix generate protobuf script and run formatters (#5605)
* Fix generate protobuf script

* Install and run black and isort
2021-06-09 19:13:31 +03:00
Sebastian Rittau
5d811e18b5 Add rudimentary Pillow stubs (#5594)
* Add rudimentary Pillow stubs

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2021-06-09 17:36:46 +03:00
Sebastian Rittau
67a2ed7dd7 Fix PyJWT package name (#5604)
The "jwt" package on PyPI is actually a different, incompatible package,
called python-jwt. Fix the name, so that the package name is corrected
from types-jwt to types-PyJWT, matching the upstream name.
2021-06-09 16:36:27 +02:00
Sebastian Rittau
6e153a3a4e Bump versions of obsolete packages (#5601)
To latest version pre obsoletion
2021-06-09 07:24:38 -07:00
Sebastian Rittau
711580722b Enable pyright for all Python 3 stubs (#5597)
* pyright: disable reportUnknownParameterType

Unknown parameter types are preferred over Any annotations for
incomplete stubs. Especially larger stubs are expected to be
incomplete for some time and it would be a shame to lose the
other pyright warnings for those stubs.

* Also disable reportUnknownVariableType

Fix problems with tkinter

* Disable reportUnknownMemberType

Fix pyright problems
2021-06-09 07:14:22 -07:00
Sebastian Rittau
c601d5cf3d Use stable mypy (#5595)
Use stable mypy

Pin all package versions

Don't upgrade pip itself
2021-06-09 11:27:45 +02:00
Sebastian Rittau
4edbeff5cc Update black, isort, flake8* (#5596) 2021-06-09 10:51:15 +03:00
Sebastian Rittau
87e805bce6 Remove AnyPath (#5592)
Part of #5470
2021-06-09 00:25:01 +02:00
Sebastian Rittau
52dd232a23 Rework Match.group handling (#5557)
* Rework Match.group handling

Standardize group(), groups(), groupdict(), and __getattr__() to return
Any instead of AnyStr. Also special case group(0) and __getattr__(0) to
always return AnyStr. Use PEP 604 for unions in changed lines.
2021-06-09 00:27:49 +03:00
Akuli
63fd1688c5 Delete attrs (#5585)
Closes #5581
2021-06-08 16:02:38 +02:00
Marc Mueller
bad2fea551 Use Literal for MatchSingleton (#5590) 2021-06-08 13:25:41 +02:00
Akuli
200260e685 move DndSource to tkinter/dnd.pyi (#5588) 2021-06-07 07:07:57 -07:00
Akuli
ec80fdaeb5 add types to most common tkinter.Entry methods (#5586)
* most common tkinter.Entry methods

* type-ignore tkinter's lsp violation
2021-06-07 11:55:35 +03:00
jack1142
0209b6f95f random.choices: weights can be Fractions (#5587) 2021-06-06 21:39:31 -07:00
Akuli
4b66a9cd4e add types to tkinter invoke methods (#5582) 2021-06-06 20:32:30 +02:00
Akuli
68dbab81f4 More types for tkinter.Treeview (#5584) 2021-06-06 19:19:23 +02:00
Akuli
6159136006 finish types of tkinter.Menu (#5583) 2021-06-06 19:15:37 +02:00
Sebastian Rittau
746db19c3f Mark attrs stubs as obsolete (#5580) 2021-06-06 18:17:29 +03:00