Commit Graph

4848 Commits

Author SHA1 Message Date
Shantanu
67e8979ac1 stubtest_third_party: more newlines in printing (#6060)
Co-authored-by: hauntsaninja <>
2021-09-21 23:16:12 +02:00
Estelle Poulin
15cec1da8e Change Traversable to be inline with pathlib.Path (#5818)
`pathlib.Path` objects are now valid `importlib.abc.Traversable`s.
2021-09-21 21:36:10 +03:00
Matthew Hughes
d1a556cec9 Update Session.prepare_request, .get_adapter (#6058) 2021-09-21 19:15:45 +02:00
Gregory Oschwald
28eb7c8b4d Remove maxminddb stubs in favor of upstream (#6043) 2021-09-20 16:19:07 -07:00
Akuli
eb7b97ee78 Add types to Markdown (#6045)
Most methods and attributes were previously untyped or `Any`-typed.

Co-authored-by: PythonCoderAS <13932583+PythonCoderAS@users.noreply.github.com>
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2021-09-20 18:39:53 +03:00
Edgar Ramírez
8ea6d6f331 Support name, content-type and headers in file upload (#6052)
`requests` supports not only passing binary file-like objects for multi-part file uploads but also additionally passing a name,  content-type and headers. This adds type hints for those options.

See https://docs.python-requests.org/en/master/user/quickstart/#post-a-multipart-encoded-file.
2021-09-20 06:46:22 -07:00
Sebastian Rittau
915feaceb6 maxminddb: Update version field and set obsolete_since (#6055) 2021-09-20 06:44:34 -07:00
Akuli
196f69b27e dict.__init__: support dict(string.split(sep) for string in iterable) (#6050) 2021-09-20 13:52:41 +02:00
Akuli
aff3e4d1c5 Create stubs for appdirs (#6047) 2021-09-20 13:20:06 +02:00
KotlinIsland
1b5c4e1d57 Add support for dict.{keys,values,items}.mapping (#6039)
Co-authored-by: KotlinIsland <kotlinisland@users.noreply.github.com>
2021-09-19 22:30:14 -07:00
Akuli
75c75a093e ttkthemes: allow constructing ThemedStyle with no arguments (#6046) 2021-09-19 15:11:08 -07:00
Akuli
7ed8da4415 Create stubs for toposort (#6048) 2021-09-19 14:04:23 -07:00
Akuli
afad78343a change prints in scripts/create_baseline_stubs.py (#6051) 2021-09-19 12:38:23 -07:00
Anton Grübel
caa642dd3b improve typing in inspect (#6020) 2021-09-18 20:11:55 -07:00
Sebastian Rittau
0506182348 Allow three-component third-party versions (#5995)
Closes: #5992
2021-09-18 20:08:51 -07:00
Sebastian Rittau
d7bae50199 Update third-party package versions (#5996) 2021-09-18 20:08:38 -07:00
Sebastian Rittau
aa4a0c763a Fix distribution name backports.ssl_match_hostname (#5997)
Bump version number to latest version available on pypi

Turn backports.ssl_match_hostname into a package to match upstream
2021-09-18 20:08:21 -07:00
Sebastian Rittau
db69e41fda Add setuptools stubs (#5762) 2021-09-18 19:45:23 -07:00
Rebecca Chen
d74a5a9ef8 Add undocumented attribute multiprocessing.process.BaseProcess._identity (#6041)
A user filed an issue against pytype about this attribute being missing:
https://github.com/google/pytype/issues/1010. I determined its type from
the source code:
https://github.com/python/cpython/blob/3.9/Lib/multiprocessing/process.py.
2021-09-17 13:14:07 -07:00
SupImDos
e4c2c0f302 Add SysLogHandler.address attribute (#6037) 2021-09-14 13:58:02 +02:00
Bas van Beek
a1ca55037a Update the xxhash and hashlib stubs (#6031)
* `name`, `block_size`, `digest_size` and `digestsize` attributes of hash objects were made read-only.
* It is now a type-checking error to subclass `xxhash` classes, such as `xxhash.xxh32`. Previously it was an error only at runtime.
* `xxhash` functions now accept strings as input and any object with `__index__()` method for `seed` (instead of requiring an integer). They also fail the type checking if no arguments are given.
2021-09-14 12:01:11 +03:00
Sebastian Rittau
ca38856670 Fix set annotations in concurrent.futures._base (#6034) 2021-09-14 11:50:20 +03:00
Sebastian Rittau
b562d233ae (a)next only requires __(a)next__, not Iterator (#6036) 2021-09-14 11:43:21 +03:00
Sam Martin
8a704ab290 Add more annotations to aws_xray_sdk.core.recorder (#6029) 2021-09-13 14:05:47 +02:00
Screwtapello
4c6e98ed0c Add many missing tkinter type annotations (#6002)
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-09-12 11:42:12 +03:00
Shantanu
8576b344b8 binhex: removed in py311 (#6011) 2021-09-10 15:27:24 -07:00
Shantanu
c74fd22931 Update pytype (#6026)
Co-authored-by: hauntsaninja <>
2021-09-11 01:11:05 +03:00
Sander
7bfdacb4c4 stdlib/logging use object over Any for parameter types (#6025) 2021-09-10 16:04:32 +02:00
Akuli
e69ca588ac Stubs for ttkthemes (#6024) 2021-09-10 15:59:12 +02:00
Nikita Sobolev
392c81d767 Switch from toml to tomli (#6023) 2021-09-10 15:48:15 +02:00
Nikita Sobolev
7d41e670ad Annotate more NamedTuples for psutil (#6021) 2021-09-10 14:14:36 +02:00
Jungkook Park
18d4868fce Fix type of blocking_timeout argument to redis.lock.Lock (#6019) 2021-09-10 04:27:05 +02:00
Sebastian Rittau
9295c70ec0 'module' argument to ForwardRef.__init__() added in Python 3.9.7 (#6017)
Pin Python 3.9.7 for stubtest and update 3.10.0 to rc2
2021-09-10 01:10:28 +02:00
Nikita Sobolev
6122b5e8b4 Annotate several NamedTuples in psutil (#6016) 2021-09-09 22:37:00 +02:00
Nikita Sobolev
2a6f4afc80 Annotate more methods of psutil.Process (#6012) 2021-09-09 21:30:56 +02:00
Sebastian Rittau
2f3964e24b Return ItemsView/KeysView from Mapping methods (#6014)
* Return ItemsView/KeysView from Mapping methods

* Make RawConfigParser compatible with Mapping
2021-09-09 07:37:26 -07:00
Bas van Beek
b9e1d7d522 Replace Mapping with types.MappingProxyType (#6013)
Mark `Signature.parameters` and `.return_annotation` as read-only properties
2021-09-09 09:58:53 +02:00
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