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
Sebastian Rittau and Akuli
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
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
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 and Jelle Zijlstra
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
Sebastian Rittau
746db19c3f
Mark attrs stubs as obsolete ( #5580 )
2021-06-06 18:17:29 +03:00
Sebastian Rittau
7e1b8384a0
Return concrete server from abstract event loop ( #5566 )
...
https://docs.python.org/3/library/asyncio-eventloop.html?highlight=abstracteventloop#creating-network-servers
documents the methods as returning a concrete server object.
2021-06-03 07:03:45 -07:00
Sebastian Rittau
6ee67483a3
Rework socket ( #5545 )
...
* Extract _socket.pyi from socket.pyi.
* Extract _socket.socket from socket.socket.
* Fix socket.family annotation.
* Annotate SocketIO properly.
* SocketType is an alias of _socket.socket.
* Sort items in socket.pyi in the same order as in socket.py.
* Remove socket.EINTR.
* Use _typeshed.WriteableBuffer instead of custom alias.
* Add errorTab (Windows only).
* Add _socket.dup().
* Mark positional-only argments.
* Remove constructors from socket exceptions.
* socket.timeout is an alias for TimeoutError, starting with Python 3.10.
* Use PEP 604 in changed lines.
* Add alias for fileno arguments.
* getaddrinfo() port can be bytes.
* Explicitly override some SSLSocket methods.
* Allow ReadableBuffer in _CMSG arguments.
2021-05-30 20:17:33 +02:00
Sebastian Rittau
f562713939
Use protocols instead of IO for bz2 ( #5499 )
2021-05-29 09:01:43 -07:00
Sebastian Rittau
9795bae6f7
Remove mypy_test_suite ( #5543 )
...
Closes : #5540
2021-05-28 05:00:48 -07:00
Sebastian Rittau
ca256b85b9
asyncio.Server.socket fixes ( #5538 )
...
* Move socket from AbstractServer to Server.
* Fix Server.socket type on Python 3.7+.
* Use Iterable instead of list for socket argument.
Closes : #5535
2021-05-27 16:14:36 +02:00
Sebastian Rittau
acca3181ed
Improve dict.fromkeys() with None value ( #5514 )
...
Closes : #5512
2021-05-21 20:30:33 +03:00
Sebastian Rittau
21e647a184
Document _typeshed ( #5501 )
...
* Document _typeshed
Closes : #5486
* Allow README.md files
2021-05-19 22:15:21 +03:00
Sebastian Rittau
2c7bae6901
Use only literal overloads for ZipFile.__init__() ( #5504 )
2021-05-19 20:54:03 +02:00
Sebastian Rittau
8d6314b8f3
mypy test suite is broken, disable temporarily ( #5505 )
2021-05-19 19:33:57 +03:00
Sebastian Rittau
54a0bd80ee
Add a comment about _typeshed to VERSIONS ( #5447 )
2021-05-19 11:01:33 +02:00
Sebastian Rittau
1ea3d0f003
tarfile improvements ( #5492 )
...
* Remove explicit Iterable super class
* Use Literals for mode parameters
* Import from collections.abc
* Use protocols for TarFile(fileobj=) and Tarfile.gzopen()
* Use object instead of Any as protocol return types
2021-05-19 10:13:35 +02:00
Sebastian Rittau
de0c62ffeb
zipfile: Replace an instance of IO with a protocol ( #5471 )
2021-05-18 18:42:59 -07:00
Sebastian Rittau
f0bf6eebbd
AnyStr cleanup ( #5487 )
...
* Replace all uses of StrPath, BytesPath, and AnyPath in Python 2 stubs.
* Add StrOrBytesPath as preferred alias for AnyPath.
* Replace all remaining AnyPath instances with StrOrBytesPath.
* Mark AnyPath as obsolete.
Part of #5470
2021-05-17 20:45:48 +02:00
Sebastian Rittau and Akuli
51b7248154
Try to fix mypy_primer comment permissions ( #5478 )
...
Split the workflows again so the comment workflow has write
access to the repository.
Based on https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
Co-authored-by: Akuli <akuviljanen17@gmail.com >
2021-05-17 20:32:14 +02:00
Sebastian Rittau and Jelle Zijlstra
7a9a107a63
Move IdentityFunction to _typeshed ( #5483 )
...
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com >
2021-05-17 12:04:35 +02:00
Sebastian Rittau
453963b536
Describe METADATA.toml files ( #5436 )
2021-05-16 22:26:49 +02:00
Sebastian Rittau
a7302dc6cb
Add aliases for 'function classes' to multiprocessing ( #5346 )
...
Part of #4313
2021-05-16 12:46:17 -07:00
Sebastian Rittau
e5abd08f93
Replace PathLike unions with aliases from _typeshed ( #5467 )
...
Standardize on 'from os import PathLike'
2021-05-16 21:38:00 +02:00
Sebastian Rittau
d72b1e8149
Give primer comment task all write permissions ( #5475 )
...
Cf. #5459
2021-05-16 12:26:31 -07:00
Sebastian Rittau
35acd2ad6f
check_consistent: allow dots in module names ( #5472 )
2021-05-16 11:01:00 -07:00
Sebastian Rittau
6a9c89e928
Replace 'Text' with 'str' in py3 stdlib ( #5466 )
2021-05-16 07:10:48 -07:00
Sebastian Rittau
dbe77b6ae9
importlib.resources was added in 3.7 ( #5468 )
...
Describe sub-module versioning
2021-05-16 07:04:28 -07:00
Sebastian Rittau
4a3b6eb8d8
Update explanation for importing builtins.str ( #5465 )
2021-05-16 13:55:08 +02:00
Sebastian Rittau
841a365284
Remove compatibility aliases ( #5464 )
...
* Remove compatibility aliases
Remove a few instances of Text
Use aliases from _typeshed
* Remove unused imports
2021-05-15 20:49:20 +03:00
Sebastian Rittau
056981b957
Try to fix mypy_primer permissions ( #5462 )
...
Cf. #5459
2021-05-15 14:37:27 +02:00
Sebastian Rittau
f94d838814
Fix primer comment permissions ( #5452 )
2021-05-15 00:15:55 +02:00
Sebastian Rittau
5b739e0ccb
Split stdlib into Python 2 and 3 versions ( #5442 )
...
All new files in stdlib/@python2 are straight copies of the
corresponding files in stdlib.
2021-05-14 12:04:12 -07:00
Sebastian Rittau
8971c242cb
Remove migration script; migration has happened ( #5446 )
...
* Remove migration script; migration has happened
2021-05-14 19:33:57 +03:00
Sebastian Rittau
322396bb32
configparser available since Python 3.0 ( #5443 )
...
It was called ConfigParser in Python 2.
Split out from #5442 .
2021-05-14 05:24:50 -07:00
Sebastian Rittau
3ba35f3552
Split the tests section, extend ToC ( #5433 )
...
Move and consolidate venv setup and running isort/black/flake8 into
separate sections and link those sections from the ToC. Also extend
those sections slightly.
Move the tests section into a separate file.
Make venv name in pre-commit match name in CONTRIBUTING.
2021-05-13 15:41:04 +02:00
Sebastian Rittau
d98fdd934c
Move VERSIONS description to file itself ( #5434 )
2021-05-13 06:14:44 -07:00
Sebastian Rittau
a34e5a36a8
Describe third-party removal process ( #5435 )
2021-05-13 06:08:55 -07:00
Sebastian Rittau
1b188921fd
Move code of conduct to separate file ( #5432 )
...
The file CODE_OF_CONDUCT.md is the standard location for it and
is treated specially by GitHub, for example by linking to it directly
when opening issues and PRs.
2021-05-13 06:04:31 -07:00
Sebastian Rittau
b1577ad1cb
Rework README and CONTRIBUTING ( #5429 )
...
This shuffles sections around between README.md and CONTRIBUTING.md. CONTRIBUTING now contains information pertaining to opening PRs, README all other information. I have also moved the list of maintainers to a separate file.
I have kept most information intact for now, with two main exceptions:
I removed duplicated information.
For brevity's sake, I trimmed some explanations from the section about version checks.
I have restructured the CONTRIBUTING file to follow the order of the introductory "contribution process at a glance" section. This now serves as a bit of a table of contents.
Closes : #5422
2021-05-12 16:25:47 -07:00
Sebastian Rittau
2f30adad19
Remove two files from pytype's exclude list ( #5427 )
2021-05-12 11:58:48 -07:00
Sebastian Rittau
3db20f09ca
pyjwt includes annotations since version 2.0.0 ( #5426 )
...
Relates to #4856
2021-05-12 19:57:48 +03:00
Sebastian Rittau
6a4583d0a8
Deprecate pallets stubs ( #5424 )
...
Part of #5423
* Support new metadata fields in check_consistent
2021-05-12 19:17:42 +03:00
Sebastian Rittau
7372952e29
Upgrade pyptype ( #5420 )
2021-05-12 07:12:03 -07:00
Sebastian Rittau
8787c7f496
Use newer mypy version for mypy_primer ( #5397 )
...
This will hopefully fix the mypy primer errors
2021-05-10 17:23:51 +03:00
Sebastian Rittau and Akuli
5f6dbe3d3e
Limit mypy primer comment to 30000 chars ( #5396 )
...
* Limit mypy primer comment to 30000 chars
GitHub enforces a limit of 64kB
Co-authored-by: Akuli <akuviljanen17@gmail.com >
2021-05-10 16:51:58 +03:00
Sebastian Rittau
1eb64b4372
Mark stdlib modules with upper version bounds ( #5394 )
...
* Mark stdlib modules with upper version bounds
* Add minus to all versions and enforce in check_consistent
* Fix check_consistent and mypy_test to work with new VERSIONS format
2021-05-10 16:29:43 +03:00
Sebastian Rittau
d16017ba0d
Drop mypy self test ( #5344 )
...
Closes : #5303
2021-05-06 06:55:49 -07:00
Sebastian Rittau
4ac3ccad45
black: enable skip_magic_trailing_comma ( #5252 )
...
* black: enable skip_magic_trailing_comma
* Remove spurious commas
2021-04-27 08:32:32 -07:00
Sebastian Rittau
f1cd416dcf
Allow comments workflow appropriate permission ( #5258 )
2021-04-27 00:58:56 -07:00
Sebastian Rittau
7ca219f9c4
Add permissions to all workflows ( #5255 )
2021-04-26 16:51:35 +02:00
Sebastian Rittau
45916045c8
Upgrade black to 21.4b0 and reformat ( #5250 )
...
This introduces newlines before decorators.
2021-04-26 13:58:27 +02:00
Sebastian Rittau
48b060cfa0
mypy self check: Use mypy version from requirements file ( #5245 )
2021-04-26 12:51:28 +02:00
Sebastian Rittau
bac1918b5f
PathLike cleanup ( #5242 )
...
Copy builtins._PathLike to os.PathLike
Use os.PathLike exclusively outside of builtins
2021-04-23 10:15:07 -07:00
Sebastian Rittau
f527e96dc3
Remove docutils.nodes.reference, which has no resemblance to the implementation ( #5235 )
2021-04-20 14:59:39 +02:00
Sebastian Rittau
4d734e38dd
Add docutils definitions and (incomplete) modules ( #5192 )
2021-04-16 11:50:23 -07:00
Sebastian Rittau
ba0f2b929b
Always generate a comment for mypy_primer ( #5197 )
...
This way, runs without output after runs with output can be clearly
determined. This also makes it easier to recognize when a run was not
completed.
2021-04-15 09:18:13 +02:00
Sebastian Rittau and Jelle Zijlstra
190e07236f
Tighten ensure_future() return type using overloads ( #5190 )
...
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com >
2021-04-08 17:31:45 +02:00
Sebastian Rittau
2b9cd1e342
Suggest splitting Python 2 stubs ( #5189 )
...
Closes : #5049
2021-04-08 14:40:46 +02:00
Sebastian Rittau
9fbcc6cf95
Use protocols for gzip and _compression ( #5170 )
...
Closes : #5099
2021-04-07 20:06:19 -07:00
Sebastian Rittau and Akuli
1906b98a4f
Add @Akuli as maintainer ( #5156 )
...
* Add @Akuli as maintainer
Co-authored-by: Akuli <akuviljanen17@gmail.com >
2021-03-30 19:36:21 +03:00
Sebastian Rittau
5f52e38fdd
Use SupportsWrite instead of IO ( #5069 )
2021-03-22 19:46:45 -07:00
Sebastian Rittau
29061d36ae
Fix dict type if constructing with kwargs ( #4987 )
...
Closes #4846
2021-03-22 19:30:01 -07:00
Sebastian Rittau
0cea325bc7
Modernize logging ( #5068 )
2021-03-22 19:26:43 -07:00
Sebastian Rittau
2b19c761ec
Fix build ( #5086 )
...
Run the mypy test suite using Ubuntu 18.04. Ubuntu 20.04 doesn't have a package for virtualenv on Python 2.
Also, curses.color_pair() now has a named argument.
2021-03-04 17:11:37 +01:00
Sebastian Rittau
08b26b9e8e
Split and restore correct Python 2 version of cgi.pyi ( #5064 )
...
* Split cgi.pyi into Py2 and 3 versions
* Restore correct Python 2 version of cgi.pyi
* Remove unnecessary version checks in cgi.pyi
* Use collections.abc
* Use List in Python 2 stub
2021-02-24 14:46:03 -08:00
Sebastian Rittau
c152e050f5
Fix stubtest errors ( #5063 )
...
A security fix added a "separator" argument to several URL parsing
functions and method in point releases:
* 3.6.13
* 3.7.10
* 3.8.8
* 3.9.2
Until all these versions are available on the GitHub Actions runners,
we need to whitelist the functions in the stubtests.
2021-02-24 14:37:38 +01:00
Sebastian Rittau
c21329b68a
Recommend using PEP 585 ( #5055 )
...
* Remove conventions enforced by black
Remove old note about optional default arguments (now part of
PEP 484 and enforced by CI)
* Recommend to use PEP 585
Cf. #4820
* Try out using collections.abc
* Reference mypy bug
2021-02-23 16:41:31 -08:00
Sebastian Rittau
c8df617726
Use built-in generic ( #5050 )
2021-02-23 10:04:51 +01:00
Sebastian Rittau
cf81a6df34
Remove unnecessary overloads from _patch.__init__() ( #4824 )
...
None of the arguments to __init__() are optional, so leaving out "new"
is not possible.
2021-01-24 14:29:38 +01:00
Sebastian Rittau
5961fe4aa8
Allow arguments to (memoryview,bytearray).hex ( #4883 )
...
Closes #4798
2021-01-01 15:00:03 -08:00
Sebastian Rittau
91582e6921
Drop old branches in stdlib/3/os/path.pyi ( #4878 )
...
* Drop support for Python 3.5 in stdlib/3/os/path.pyi
* Remove more obsolete branches
2020-12-30 12:41:09 -08:00
Sebastian Rittau
1c6ac09b82
Add EllipsisType, NoneType, and NotImplementedType (Python 3.10) ( #4822 )
2020-12-14 18:38:35 +01:00
Sebastian Rittau
c26b804055
Remove a missing import ( #4821 )
...
Works around #4815 , although a proper fix is needed.
2020-12-14 11:49:22 +01:00
Sebastian Rittau
d2a7889fe0
Drop support for Python 3.5 ( #4675 )
...
Python 3.5 EOL was on 2020-09-30.
2020-11-02 16:18:20 +01:00
Sebastian Rittau
cdc4de1af4
Derive Reversible from Iterable ( #4622 )
...
Closes : #4615
2020-11-01 13:17:41 -08:00
Sebastian Rittau
8aa3346a9c
Remove some TODOs from IO classes ( #4654 )
...
At this point, it is too late to add methods to these semi-protocols as
it would break lots of existing code. Additionally, we are moving away
from these classes to finer-grained protocols anyway.
2020-11-01 13:11:19 -08:00
Sebastian Rittau
c5aca0d533
Only add a mypy_primer comment if there is output ( #4725 )
2020-10-28 20:07:12 +01:00
Sebastian Rittau
4603728a15
Clean up files with former forced consistency ( #4717 )
...
Replace Text with str in Python 3 code
2020-10-27 07:52:35 +01:00
0583738a41
Add a mypy self test ( #4337 )
...
Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com >
Co-authored-by: hauntsaninja <>
2020-10-24 17:58:04 -07:00
Sebastian Rittau
3de732e188
Split distutils for Python 2 and 3 ( #4685 )
...
Addresses #4679 , but also starts addressing #4674 .
2020-10-22 19:24:17 -07:00
Sebastian Rittau
5927e5ca30
Remove most consistency checks and split builtins.pyi into py2/3 files ( #4686 )
...
Split builtins.pyi in Python 2 and 3 versions
Partly addresses #4674
2020-10-22 13:39:06 -07:00
Sebastian Rittau
5b11606d16
CI: Update Python and mypy versions ( #4656 )
...
* Use 3.9 final instead of 3.9-dev
* Remove explicit Python versions from utility scripts
* Use mypy 0.390 for stubtests
2020-10-12 15:01:09 +02:00
Sebastian Rittau
473044cf1f
Add information about removing third-party packages ( #4637 )
...
Closes : #4608
2020-10-09 16:27:56 +02:00
Sebastian Rittau
35f4ade96f
Replace bool.__init__() with __new__() ( #4614 )
...
Fixes #4612
2020-10-09 00:20:03 +02:00
Sebastian Rittau
2157c4a448
Fix patch() used as decorator ( #4592 )
...
Closes : #4591
2020-10-02 09:05:25 +02:00
Sebastian Rittau
bf5651e7a6
Use GitHub Actions to run mypy ( #4594 )
2020-10-01 14:42:31 -07:00
Sebastian Rittau
27dfbf68aa
Use __new__ instead of __init__ for some builtin classes ( #4555 )
...
Closes #4514 #2630 #2686
2020-09-30 00:00:06 -07:00