Commit Graph

5014 Commits

Author SHA1 Message Date
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
Sebastian Rittau
9b366daaec Explain adding new third-party stubs (#5951)
Closes: #5438
2021-08-23 20:47:54 -07:00
Sebastian Rittau
db0f37ccdf Modernize mock stubs (#5949)
* Import from `collections.abc`, instead of `typing`.
* Replace `Text` with `str`.
* Remove version checks.
* Convert mock into a package
2021-08-23 11:53:03 -07:00
Gary Yendell
28f2953b49 mock: Remove version checks, remove Python 2 (#5948)
The mock package is a backport of the latest `unittest.mock` module for all supported Python versions, making version checks unnecessary.

Also update the package version. The latest version doesn't support Python 2 anymore.
2021-08-23 13:57:34 +02:00
SeenicRoot
034a5f6aec Fix return type of Image.reduce() in Pillow (#5946)
Image.reduce() should return an Image instead of None.
2021-08-22 20:03:22 -07:00
Johan Walles
e4879abb59 text_type should be a type alias, not a variable (#5945) 2021-08-22 12:44:23 +02:00
Anton Grübel
29c63e0d9c add ParamSpec to importlib.util (#5944) 2021-08-21 08:24:25 -07:00
Anton Grübel
2f499c7e90 add ParamSpec to trace.runfunc (#5940) 2021-08-20 10:46:34 +02:00
Niklas Gustafsson
918c7d0b84 Add ZipInfo type hint to members argument of ZipFile.extractall (#5936) 2021-08-20 10:43:45 +02:00
JHeilCoveo
7144118995 Add keys module to cachetools package (#5938) 2021-08-20 09:59:15 +02:00
Rebecca Chen
fac273a545 Stop using pytype.pytd.typeshed.get_python_major_versions. (#5941)
We deleted this method as part of our Python 2 cleanup efforts.
2021-08-19 18:36:19 -07:00
Anton Grübel
c54909ab69 Use ParamSpec for unittest.signals.removeHandler() (#5905) 2021-08-19 18:32:24 +02:00
Henry Schreiner
2002649395 fix(Deprecated): use literal for actions (#5939) 2021-08-19 18:06:23 +02:00
Henry Schreiner
eec10a6c7a fix(Deprecated): support any warning for category (#5937) 2021-08-19 17:55:14 +02:00
wouter bolsterlee
757d962237 Improve ssl module annotations (#5934)
This improves the type annotations for the ‘ssl’ module:

- Various APIs taking file names (e.g. keyfile=, certfile=, cafile=,
  capath=, ...) were annotated as accepting only strings, while actually
  they accept str, bytes, and os.PathLike (such as pathlib.Path).
  CPython's _ssl.c module has always used PyUnicode_FSConverter to
  handle (normalize) these. Change the annotations accordingly using the
  internal _typeshed.StrOrBytesPath alias.

- Tighten the ‘purpose=’ argument in various functions to use the
  already defined ‘Purpose’ enum instead of accepting ‘Any’.
2021-08-18 08:23:31 -07:00
Louis Duperier
bfff7d763b add type stubs (#5932) 2021-08-18 17:02:14 +03:00
Nathan Naze
34b3f0bf7c Add missing attributes to IncompleteRead (#5933) 2021-08-17 21:27:09 -07:00
Marc Mueller
837b57fdd1 Rename nmap to python-nmap (#5931) 2021-08-16 16:44:04 -07:00
Hackrrr
3ce5502675 Added str type to modifying methods on PageElement (#5929)
Co-authored-by: Hackrrr <Hackrrr@users.noreply.github.com>
2021-08-15 08:15:34 -07:00
Sebastian Rittau
5f2e117bba CONTRIBUTING: Use PEP 604 syntax (#5925)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-08-14 20:48:40 -07:00
Jeremy Nation
0e62c8ab06 Add missing stub for _CursesWindow.noutrefresh (#5928) 2021-08-14 23:55:43 +02:00
Sam Martin
c83a455d67 Fix malformed typeschool URL (#5927) 2021-08-14 22:57:46 +03:00
Sam Martin
a2bc47a682 docutils - added missing stubs for __init__ methods (#5924)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-08-14 20:35:02 +03:00
Oleg Höfling
9715657994 bump black + isort (#5926)
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
2021-08-14 14:03:58 +02:00
Oleg Höfling
a6ce6fdce6 More specific type hints for dateparser (#5920)
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
2021-08-14 12:33:32 +02:00
Oleg Höfling
ff63953188 Switch to PEP-604 syntax in python2 stubs (#5915)
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
2021-08-14 11:12:30 +02:00
Rebecca Chen
431c4f7fc1 Improve a few types in xml.dom.minidom. (#5923)
* Changes the return type of getDOMImplementation from implicit Any to
  DOMImplementation | None.
* DOMImplementation.createDocument() and createDocumentType() allow None for all arguments.
2021-08-13 23:28:47 +02:00
Rebecca Chen
774da45449 Add some missing properties to xml.dom.minidom.Node. (#5919) 2021-08-13 21:57:22 +02:00
jack1142
e415a7fad8 Make ChainMap's new_child() and parents return subclass (#5922) 2021-08-13 19:30:48 +02:00
jack1142
bfa1d043d7 Add RawJSON to simplejson stubs (#5921)
Update METADATA.toml version
2021-08-13 17:50:59 +02:00
Oleg Höfling
5e0fc46073 Add stubs for entrypoints package (#5831) 2021-08-13 11:24:00 +03:00
Gabe Joseph
92aecadf6b Memoryview.cast: shape= can be tuple of any number of ints (#5918) 2021-08-13 00:04:35 +02:00
Nsukami _
5691ea6d6a Stubs for dateparser (#5778)
Stubgen and manual fixes.

Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-08-12 18:38:52 +03:00
Anton Grübel
ae86a93f45 add ParamSpec to atexit (#5896)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2021-08-11 20:49:30 -07:00
Rebecca Chen
10cfccfafd Bump pytype version to 2021.08.11. (#5916)
This version contains a fix for a pytype bug that is blocking
https://github.com/python/typeshed/pull/5896.
2021-08-11 19:58:37 -07:00
Oleg Höfling
64f481189f drop ellipsis assignments from module vars, classvars and instance attrs (#5914)
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
2021-08-11 19:26:58 +02:00
Sebastian Rittau
6c41e3cead Improve six stubs (#5908)
* Update version field in METADATA.toml.
* Import from collections.abc in Python 3 stub.
* Add six.__author__.
* Annotate PY2, PY3, and PY34 as literals.
* Correctly annotate *_type and replace instances where they were used
  as type aliases.
* Use new union syntax in Python 2 stub.
* Use built-in generics in Python 2 stub where possible.
* Renamed _LazyDescriptor to _LazyDescr to match implementation.
* Derive _LazyDescr from object in Python 2 stub.
2021-08-11 07:40:09 -07:00
Anders Kaseorg
96358fd944 beautifulsoup4 stub improvements (#5907) 2021-08-10 20:04:48 -07:00
Rebecca Chen
4e228870bb Stop running pytype_test on Python 2-only stubs. (#5904)
pytype is finally dropping Python 2 support (in the upcoming release
after 2021.08.03), so pytype_test can no longer run with
--python_version=2.
2021-08-10 09:36:10 +02:00
Sténio Jacinto
32a6257de0 Add missing stdlib xml stubs (#5895) 2021-08-09 22:41:55 +02:00
Shantanu
98846a65e2 More shards for stubtest_third_party (#5902)
Co-authored-by: hauntsaninja <>
2021-08-09 13:36:54 -07:00
Sebastian Rittau
30ad9e945f Mention discussions forum (#5901) 2021-08-09 22:11:41 +02:00
Sebastian Rittau
978659643d Upgrade bleach version to 4 and drop Python 2 (#5897)
bleach 4 has no API changes, but dropped support for old Python
versions.
2021-08-09 07:26:30 -07:00
Akuli
9af9cca7f3 lowercase list and dict in the rest of stdlib (#5892) 2021-08-09 00:13:08 +02:00
Akuli
191aac3b0e lowercase list and dict for 3rd party stubs (#5893)
* stubs/decorator/decorator.pyi

* stubs/frozendict/frozendict.pyi

* stubs/Jinja2/jinja2/nodes.pyi

* stubs/Pygments/pygments/token.pyi

* stubs/requests/requests/models.pyi

* stubs/Werkzeug/werkzeug/http.pyi
2021-08-08 13:25:18 -07:00
Stanislav Schmidt
64903b85d7 PyYAML: fix yaml.add_foo() functions (#5828)
Added / modified types for the following functions:
- `add_implicit_resolver(...)`
- `add_path_resolver(...)`
- `add_constructor(...)`
- `add_multi_constructor(...)`
- `add_representer(...)`
- `add_multi_representer(...)`

* Remove yaml.add_constructor from allowlist

* Use TypeVars and overloads
2021-08-08 21:49:06 +03:00
Bas van Beek
7edad1034e Use a typevar in object.__new__ (#5891) 2021-08-08 20:45:22 +02:00
Hasan Ramezani
8b9d771b67 Add filters to stdlib/warnings.pyi (#5889) 2021-08-08 21:18:47 +03:00