Commit Graph

4616 Commits

Author SHA1 Message Date
kasium
c4a60ce94c Add pytest-lazyfixture stubs (#5745)
This change will add stubs for pytest-lazyfixture. It is particual useful for projects which type their tests and use pytest-lazyfixture.
The included functions and classes are the scope which can be considered documented by the module. Any other function is related to pytest hook implementations and are normally not called by an user.

Please note, that if a user uses 'pytest.lazy_fixture' these stubs will not work. As recommneded in https://github.com/TvoroG/pytest-lazy-fixture/issues/51 the package needs to imported directly.

Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-07-09 12:52:22 +03:00
Sebastian Rittau
aca5952361 Wrap vobject.win32tz in platform check (#5747) 2021-07-09 11:32:57 +02:00
Nipunn Koorapati
c5dd23ac0d Allow unicode and bytes in EnumTypeWrapper.Value (#5743) 2021-07-09 11:22:38 +02:00
Akuli
fdf073627c maybe fix stubtest (#5746)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2021-07-09 12:06:26 +03:00
Sebastian Rittau
a7446632f7 Add third-party vobject stubs (#5733) 2021-07-08 18:26:24 -07:00
Sebastian Rittau
788b20e326 Upgrade Pillow stubs for Pillow 8.3 (#5731)
* Upgrade Pillow stubs for Pillow 8.3

* stubtest: ignore PIL._tkinter_finder

* Annotate TiffTags.py

* Pillow: stubtest and various other fixes

* Remove tkinter modules from stubtest_allowlist
2021-07-08 18:22:07 -07:00
Thomas Grainger
c968614bae fix type of FileIO.__init__ opener kwarg (#5738)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-07-08 13:50:56 -07:00
Anton Grübel
0085539df3 Add missing type hints in http.client (#5734)
* Add missing type hints in http.client

* Add http.client.HTTPConnection.response_class to exclude list
2021-07-08 14:43:42 +03:00
opsyne
9d5046ee7f polib: fix ordered_metadata return type (#5735)
Also update version in METADATA.toml.
2021-07-07 19:07:17 +02:00
Akuli
42247feefb use Self in async context managers (#5724) 2021-07-06 08:47:49 +02:00
Peter Pentchev
ff2b92f340 pathlib2: most of the methods support the "unicode" type. (#5727)
Closes: #5726
2021-07-05 12:47:18 +02:00
Unrud
2ee7b1346b Replace IO[str] with IO[bytes] in urllib.request (#5728) 2021-07-05 09:41:59 +02:00
Josh
2b497f7227 importlib.util.resolve_name package argument accepts None (#5730) 2021-07-05 09:21:40 +02:00
Anton Grübel
d68701c0ec Use _typeshed.Self with __enter__ (#5723)
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-07-04 21:10:01 +03:00
Fabian Raab
1a131a489e [UserList]: Return type for slice is set to whatever self is (#5722) 2021-07-02 21:20:17 +02:00
Anton Grübel
de19554dcc Add json.py_encode_basestring stubs (#5720) 2021-07-02 11:18:35 +03:00
Anton Grübel
8a107464a8 Use _typeshed.Self with __enter__ (#5719) 2021-07-01 23:15:13 +02:00
Anton Grübel
96e0660fba Use _typeshed.Self with __enter__ (#5717)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-07-01 12:32:32 +02:00
Shantanu
04f0113d16 dataclasses: work around default factory issues (#5718) 2021-07-01 08:07:00 +02:00
Luis Marsano
c6b78354e6 stdlib logging: specify style type as literal choice (#5716)
documented for style parameter: https://docs.python.org/3/library/logging.html#logging.Formatter
2021-06-30 14:50:21 -07:00
Akuli
b06352556d Use Literal["little", "big"] for byteorder (#5715) 2021-06-30 13:15:50 -07:00
Sebastian Rittau
1cffceb767 Add httplib2 third-party stubs (#5713) 2021-06-30 07:54:02 -07:00
Sebastian Rittau
2b35ea5f91 Add caldav third-party stubs (#5684)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2021-06-30 16:28:40 +02:00
Sebastian Rittau
40b127d46a Add third-party commonmark stubs (#5702) 2021-06-30 07:19:43 -07:00
kasium
2c97c3cab9 Flag LogRecord.args as optional (#5714)
Resolves #5710
2021-06-30 14:51:32 +02:00
Sebastian Rittau
f260ea2383 Add html5lib third-party stubs (#5701) 2021-06-29 21:15:59 -07:00
Jake Bailey
bb981bd726 Merge last of PIL stubs from Pylance (#5706)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2021-06-29 21:05:04 -07:00
Anton Grübel
c38171a0b3 Use _typeshed.Self with __enter__ (#5712) 2021-06-29 15:19:25 -07:00
Anton Grübel
35cc7491db Add __defaults__ and __closure__ to types.MethodType (#5707) 2021-06-29 10:21:06 -07:00
Thomas Grainger
bd50dacd76 add py3.10 async contextlib.nullcontext (#5711) 2021-06-29 08:35:44 -07:00
Charly C
389b92cb04 fix the stub files for the stdlib mmap module (#5705)
In Python 3:
- The `mmap` type is `Iterable[int]`, not `Iterable[bytes]`.
- The `read_byte` method returns an `int`, and the `write_byte` method only accepts an `int` as its first and only argument.
- The `__setitem__` method accepts any `ReadableBuffer` object, not just `bytes`.

In both Python 2 and 3:
- The `__delitem__` method always raises a `TypeError`, so the proper return type is `NoReturn`.
- The `mmap` type isn't generic, so I've simplified the stubs by removing the unnecessary `_mmap` class.
2021-06-29 08:01:32 -07:00
Thomas Grainger
14add7520b widen _SupportsAclose (#5708)
see https://github.com/python-trio/trio-typing/issues/31#issuecomment-867534826
2021-06-28 15:29:21 -07:00
Sebastian Rittau
2b64f54008 Support @tests/requirements-stubtest.txt files (#5704) 2021-06-28 19:42:27 +02:00
Jake Bailey
6b8f047b05 Update some PIL stubs (#5692)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-06-28 10:29:17 -07:00
Jelle Zijlstra
14d7431ff1 Recommend Self in CONTRIBUTING.md (#5699)
Part of #5676.

Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-06-27 23:17:28 +03:00
Dominic Davis-Foster
58559e56b3 Use _typeshed.Self where __enter__ returns self (#5698) 2021-06-27 22:58:58 +03:00
github-actions[bot]
1fb100dca4 Remove unused stubtest allowlist entries (#5697)
Co-authored-by: hauntsaninja <hauntsaninja@users.noreply.github.com>
2021-06-26 21:28:00 -07:00
Bas van Beek
50f5858a56 Use SupportsIndex where applicable for 5 classes (#5694)
Use `SupportsIndex` where applicable:

* `str`
* `bytes`
* `bytearray`
* `memoryview`
* `markupsafe.Markup`
2021-06-26 19:05:40 +03:00
Thomas Grainger
c522e8e53c contextlib.nullcontext is a class (#5695)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-06-26 08:19:03 -07:00
JHeilCoveo
64c85cdd44 Fix cachetools decorators (#5690) 2021-06-25 08:45:42 -07:00
Jelle Zijlstra
5fe2459779 Make SigParameter.replace and Signature.replace return Self (#5689) 2021-06-24 18:01:58 +02:00
Thomas Grainger
2cd7e6511b fix abcmeta.ABCMeta type (#5688)
Add __abstractmethods__, __instancecheck__ and __subclasscheck__

Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-06-24 16:56:09 +03:00
Maximilian Hils
f58c9c7e7d Extend pyOpenSSL stubs (#5687) 2021-06-24 12:21:05 +02:00
Sebastian Rittau
bda76bb7d8 Re-add python2 keys to METADATA temporarily (#5686) 2021-06-24 00:48:05 +02:00
Jake Bailey
96429cd4bd Update pyright to 1.1.152 (#5685) 2021-06-24 00:11:33 +02:00
Sebastian Rittau
dd441645ad Make logging.StreamHandler generic over stream (#5681)
Closes #5680
2021-06-23 17:03:18 +03:00
Sebastian Rittau
816a92b8e8 Add Self type var to _typeshed (#5677)
Cf. #5676
2021-06-22 22:15:27 +02:00
Jelle Zijlstra
73b4c21cce Make ZipFile.__enter__ return self (#5675) 2021-06-22 17:01:11 +02:00
Sebastian Rittau
3ec061022a Improve logging.StreamHandler and FileHandler (#5663)
* Use PEP 604, instead of Optional.
* Override FileHandler.stream and setStream to require a TextIOWrapper
  instead of a SupportsWrite object.
* FileHandler._open() now returns a TextIOWrapper instead of IO. Using
  anything but a file opened in text mode would not work.
2021-06-21 22:50:49 +02:00
Akuli
11b99e1141 @python2 nits (#5672)
* tiny tests/mypy_test.py cleanup

* try to make CONTRIBUTING.md less confusing
2021-06-21 21:42:45 +03:00