Commit Graph

4861 Commits

Author SHA1 Message Date
Nikita Sobolev
6188a3eec7 Improves psutil/_common.pyi (#6010)
* Improves `psutil/_common.pyi`

In this iteration I've fixed the most obvious types and corrected several mistakes.
We can go deeper in the next iteration(s).

* We don't need to import `Union`

* Update _common.pyi

* Update _common.pyi

* Update _common.pyi
2021-09-06 20:37:53 +02:00
Fares Ahmed
d8ec167681 Fix type of stroke_width parameter in Pillow's ImageDraw.*text* functions (#6008) 2021-09-06 13:13:28 +02:00
Sebastian Rittau
2620120a90 Update deprecated.sphinx.deprecated signature (#6005)
The signature was changed in Deprecated 1.2.13.
2021-09-05 19:11:27 -07:00
Nikita Sobolev
1f7b87b6b7 Adds more missing ContextManager types (#6007)
1. c3e63b4dd5/psutil/_psbsd.py (L571)
2. c3e63b4dd5/psutil/_psosx.py (L365)
2021-09-05 17:57:33 -07:00
Nikita Sobolev
5d7e201784 Fix return type of Process.oneshot() (#6006) 2021-09-05 21:03:45 +02:00
Gergely Kalmár
96b5254056 Fix python-slugify replacements argument type (#6004)
Update version field, remove Python 2 compatibility marker
2021-09-05 20:44:23 +02:00
Bas van Beek
d599a535b2 Allow math.trunc to only accept __trunc__-supporting objects (#6003)
Add SupportsTrunc protocol
2021-09-04 18:16:53 +02:00
Anton Grübel
3819f8e6ff add missing functions in sys (#6001) 2021-09-04 16:30:13 +02:00
Akuli
832a24c8a1 Create send2trash stubs (#6000) 2021-09-03 22:51:03 +02:00
Andrew Svetlov
c0030b2b12 Fix msg parameter type for asyncio Future.cancel() and Task.cancel() (#5999) 2021-09-03 09:07:20 -07:00
HunterAP23
ffaa0ea3d1 Added initial rework of the concurrent.futures module (#5646)
* Added initial rework of the concurrent.futures module

* Minor fixes

* Fixed some generics & changed to collections over typing for some types

* Switched thread to use queues instead of multiprocessing.queues

* More fixes

* More fixes following results from running tests locally

* Tmp commit of changes

* Minor flake8 fix

* Fixing some issues

* Fixed a weakref.ref issue

* Fixed one more weakref issue

* Fixed some issues with required version

* Fixed more python min version requirements

* More min version fixes

* Fixed misc error in workflow regarded outdated pip

* Replaced any usage of Optional and Union with proper form as described in the contributions guide

* Fixed issue with using Callable definition

* Fixed last seen issues as per review

* Fixed some basic issues & more proper import calls

* Update stdlib/concurrent/futures/process.pyi

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>

* Update stdlib/concurrent/futures/process.pyi

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>

* Minor fixes

* More minor fixes

* Fixed up some issues & cleaned up imports

* Removed usage of Union

* Changed wait method to use Set of Future to work with mypy-primer for Optuna repo

* Reverted change to wait method and DoneAndNotDoneFutures class

* Fixed DoneAndNotDoneFutures again

Co-authored-by: Akuli <akuviljanen17@gmail.com>
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2021-09-03 13:06:48 +02:00
Anton Grübel
1af6810b5d Improve typing in zipfile (#5991)
* Improve typing in zipfile

* fix CR suggestions
2021-09-03 13:02:11 +02:00
Carl Meyer
003f916acd Add SymbolTableFactory to symtable stub (#5998)
This is not documented API, but AFAIR the typeshed policy is now that stubs should preferably reflect reality rather than solely documented API.

See https://github.com/python/cpython/blob/main/Lib/symtable.py#L21
2021-09-03 00:15:17 -07:00
Peter Law
425a35309a Relax DictWriter.fieldnames closer to implementation (#5994)
Fixes #5993
2021-09-02 20:17:30 +02:00
JP Sugarbroad
d5ff0e8399 dateutil.parser: Complete the isoparser module (#5983) 2021-09-02 14:57:16 +02:00
Anthony Sottile
f1e367851c Fix types of enum _member_names, etc. (#5986)
Move fields onto EnumMeta
2021-09-02 11:46:57 +02:00
Akuli
6307bfd421 Delete yaml.CDangerLoader and yaml.CDangerDumper (#5990)
These no longer exist in PyYAML 4.2.
2021-09-01 10:50:30 +03:00
Jon Dufresne
a9a612df98 Add certifi.contents() (#5989)
Added in commit:
3e585603ff

Available since version 2020.04.05.
2021-08-31 21:10:04 -07:00
Ashley Whetter
026405b014 Add C{Full,Unsafe}Loader and UnsafeConstructor (#5988) 2021-09-01 00:50:31 +02:00
Jon Dufresne
2d8fe52d08 Remove geoip2 stubs in favor of upstream (#5964)
The geoip2 package has shipped a PEP 561 py.typed file since Jul 28,
2020.

Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-08-31 23:15:55 +02:00
Torsten Wörtwein
d4f0725452 BUG: typing.final supports properties (#5985)
Fixes #5984
2021-08-31 09:07:57 +02:00
Sebastian Rittau
5f77310418 Update bleach version (no changes) (#5982) 2021-08-30 07:15:23 -07:00
Jon Dufresne
4381e0a558 Remove @python2-only third party stubs that aren't also dependencies (#5975)
Closes #5969
2021-08-30 14:23:28 +02:00
Sebastian Rittau
bc19a28c0d CI: use one runner per mypy version (#5909)
This makes it easier to see in which version(s) an error occurred.
2021-08-29 04:00:10 -07:00
Akuli
8d5452e873 do not use mypy-specific syntax in '# type: ignore' comments (#5953) 2021-08-29 03:58:34 -07:00
Akuli
cd90721604 Clean up tests/check_pep_604.py (#5980) 2021-08-28 21:56:53 -07:00
github-actions[bot]
ed25989ef2 Remove unused stubtest allowlist entries (#5981)
Co-authored-by: hauntsaninja <hauntsaninja@users.noreply.github.com>
2021-08-28 21:22:24 -07:00
Shantanu
2d4fcbc81e zipfile: py310 changes, fix open (#5979)
Co-authored-by: hauntsaninja <>
2021-08-28 22:45:01 +02:00
Sebastian Rittau
8e0e13a2d5 Commit messages for stubs are now used as changelog (#5950) 2021-08-28 12:11:22 -07:00
Sebastian Rittau
f1532745bc A few html5lib annotations (#5913) 2021-08-28 12:08:45 -07:00
Shantanu
ba998cd5f9 multiprocessing.pool: fix __init__ methods (#5833)
Co-authored-by: hauntsaninja <>
2021-08-28 12:04:08 -07:00
Shantanu
670929e908 dateparser: use PEP 604 (#5977)
Co-authored-by: hauntsaninja <>
2021-08-28 21:03:02 +02:00
Shantanu
f6e4c9c38f Check for PEP 604 usage in CI (#5903)
Since this is a common review issue and our stubs have all been
converted

Co-authored-by: hauntsaninja <>
2021-08-28 11:37:50 -07:00
Jon Dufresne
9d02cd265d Remove leftover openssl-python in pyright configuration (#5976)
The package was renamed in a98fceca2f.
2021-08-28 19:05:24 +02:00
Jon Dufresne
33b08cb3d7 Remove leftover pyright tornado configuration (#5974)
tornado was removed in 5a7f25584e.
2021-08-28 08:29:40 -07:00
Sebastian Rittau
27af44fee2 Deprecate geoip stubs (#5967)
Geoip comes with its own type hints starting at version 4.0.2.
2021-08-28 14:58:38 +03:00
Sebastian Rittau
5a7f25584e Remove tornado stubs again (#5973) 2021-08-27 20:48:32 +02:00
Jon Dufresne
b50ebafa79 Tighten return type of OpenSSL Connection.get_protocol_name() (#5972)
The method always returns a str. See implementation at:

30e82d4ba5/src/OpenSSL/SSL.py (L2420-L2430)

If version were ever None, it would raise an exception on the .decode()
line.
2021-08-27 10:54:27 -07:00
JP Sugarbroad
3dbaf34bd5 yaml.cyaml: Switch Optional to new pipe-based union (#5971) 2021-08-27 19:21:44 +02:00
Sebastian Rittau
47dd8549d2 Temporarily restore tornado stubs and add obsolete_since (#5968)
The stubs can be removed again, once a new release was built.
2021-08-27 10:00:37 -07:00
Jon Dufresne
da8d291bdb Update versions of Python 2 stubs to prepare for eventual removal (#5970) 2021-08-27 18:15:13 +02:00
Jon Dufresne
2e1e91e3c8 Remove tornado stubs in favor of upstream (#5965)
The tornado package has shipped a PEP 561 py.typed file since Mar 1,
2019.
2021-08-27 08:55:41 +02:00
JP Sugarbroad
07a58c3266 Add methods to yaml.cyaml.CParser (#5963) 2021-08-26 19:28:17 -07:00
Anton Grübel
ac2ef6e8c9 Use paramspec in no_type_check_decorator (#5942) 2021-08-26 22:46:27 +03:00
Sam Martin
f1da797c62 Addition of aws-xray-sdk package (#5961) 2021-08-26 01:03:38 +02:00
Jon Dufresne
ac39a73d38 Add type for undocumented copyreg.dispatch_table (#5959) 2021-08-26 00:59:23 +02:00
Anders Kaseorg
65a88ace0a Add email.message.Message.__iter__ (#5960)
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2021-08-25 22:43:20 +02:00
Oleg Höfling
a74624d31b Introduce generic logger type in loggeradapter (#5954) 2021-08-25 05:45:56 -07:00
Ruben Opdebeeck
e567af01e5 Fix collections.UserString __reversed__ and __iter__ (#5958) 2021-08-25 15:27:20 +03:00
Alex Nelson
d34d047002 Add DOOR, PORT, and WHT type signatures for stat module (#5955)
Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
2021-08-24 21:22:24 +02:00