Commit Graph
6423 Commits
Author SHA1 Message Date
cb5b31cf15 Add LiteralString overloads to path module (#7727)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-05-25 08:52:52 -07:00
Alex WaygoodandGitHub ac9efd8573 stubtest_stdlib: run on PRs updating requirements-tests.txt (#7949) 2022-05-25 15:29:05 +02:00
Sebastian RittauandGitHub 301caad709 Update mypy to 0.960 (#7948) 2022-05-25 14:44:22 +02:00
Jelle ZijlstraandGitHub d5bc48d29b builtins, collections: Fix unconstrained overloads for container constructors (#7944)
See https://github.com/microsoft/pyright/issues/3501#issuecomment-1135979479

Related to #7928
2022-05-25 10:07:23 +01:00
Jaakko LappalainenandGitHub 773ddb15bb Pillow: use union type for Image.paste (#7893) 2022-05-25 10:04:59 +01:00
Jelle ZijlstraandGitHub 796a689fc1 mock: Fix unconstrained TypeVar (#7945)
The first overload covers the case where `new` is not given.

Part of #7928
2022-05-25 06:52:40 +01:00
Jelle ZijlstraandGitHub 070e6c2a2d invoke: Fix unconstrained TypeVar (#7943)
Part of #7928 

https://github.com/pyinvoke/invoke/blob/f34c6c9413146a34ede3a5b529916b4cee649887/invoke/tasks.py#L328
2022-05-25 06:48:49 +01:00
Jelle ZijlstraandGitHub bb119544d8 pkg_resources: Fix unconstrained TypeVars (#7941)
https://github.com/pypa/setuptools/blob/499c468a57d240e5bb450bdb6daedc3e559541dd/pkg_resources/__init__.py#L1049

Part of #7928
2022-05-24 19:49:22 -07:00
Alex WaygoodandGitHub 54e11a1ec4 mypy_extensions: fix TypeVar usage (#7937)
#7928
2022-05-24 11:26:35 -07:00
1e097a75cb markdown: Annotate methods of Registry (#7926)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-05-24 10:23:48 -07:00
Jelle ZijlstraandGitHub d950ec37ca fileinput: Fix TypeVar usage (#7934)
* fileinput: Fix TypeVar usage

Fixes #7922, part of #7928.
2022-05-24 17:55:35 +01:00
Petter FribergandGitHub c1aba8059f Extend digest argument type for hmac.digest (#7931)
Now allows a `Callable` and `ModuleType` in addition to `str`
2022-05-24 11:38:00 +01:00
Jelle ZijlstraandGitHub 158293257e optparse: fix unconstrained TypeVar (#7936)
Part of #7928
2022-05-23 19:39:31 -07:00
Amy PircherandGitHub 8a07787f48 Add precise overloads for SSLContext.get_ca_certs (#7933) 2022-05-23 17:06:09 -07:00
Jelle ZijlstraandGitHub b4518bfb2b argparse: remove incorrect default in overload (#7929)
Part of #7928
2022-05-23 18:12:19 +01:00
ShantanuandGitHub 8968eb4fc9 bdb: update for py311 (#7927) 2022-05-23 09:20:48 +02:00
Jelle ZijlstraandGitHub 9660ee97ee codecs: add missing function, reflect runtime import * (#7918) 2022-05-22 16:06:21 -07:00
18433202ba concurrent.futures: new params in 3.11 (#7919)
https://github.com/python/cpython/commit/fdc0e09c3316098b038996c428e88931f0a4fcdb

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-05-22 15:51:09 -07:00
ShantanuandGitHub ceda368abc shutil: update rmtree for py311 (#7925) 2022-05-22 15:40:06 -07:00
ShantanuGitHubhauntsaninja <>
c0aafb9a34 termios: update for py311 (#7924)
Co-authored-by: hauntsaninja <>
2022-05-22 15:36:50 -07:00
ShantanuGitHubhauntsaninja <>
5b1ef8b119 mmap: add MADV_FREE on darwin (#7923)
Co-authored-by: hauntsaninja <>
2022-05-22 15:30:09 -07:00
Rens OliemansandGitHub 6e18441a2c Update emoji stubs for version 1.7 (#7884) 2022-05-22 11:44:01 +01:00
Jelle ZijlstraandGitHub 54c2e23a55 3.11 allowlist: move inspect._ParameterKind.description to wontfix section (#7920) 2022-05-22 12:04:11 +03:00
ef887b7beb More setuptools.command.easy_install definitions. (#7145)
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2022-05-22 00:31:31 +03:00
Jelle ZijlstraandGitHub 3dcfbf3745 urllib.request: add code 308 handler for 3.11 (#7917)
https://github.com/python/cpython/commit/c379bc5ec9012cf66424ef3d80612cf13ec51006
2022-05-21 14:13:17 -07:00
ShantanuGitHubhauntsaninja <>
f2ea124e82 random: explicitly mention int for seed (#7916)
https://github.com/python/typeshed/pull/7906#discussion_r878750404
I felt this better documents how seed is used in practice

Co-authored-by: hauntsaninja <>
2022-05-21 13:00:05 -07:00
Jelle ZijlstraandGitHub 1220a99399 unicodedata: add UCD.is_normalized (#7915) 2022-05-21 12:59:44 -07:00
Sebastian RittauandGitHub a412ddb437 Update pyright (#7914)
Required for #7865
2022-05-21 19:15:06 +01:00
eggplantsandGitHub 6d372ffc09 Add docopt.printable_usage (#7913) 2022-05-21 18:33:04 +02:00
Jelle ZijlstraandGitHub ddc6eda10a symtable: has_exec was removed in 3.9 (#7911) 2022-05-21 17:50:27 +02:00
Jelle ZijlstraandGitHub 39c777f70c pydoc: 3.11 changes (#7910) 2022-05-21 17:49:39 +02:00
Jelle ZijlstraandGitHub 237b1bb189 binascii.a2b_base64: new param in 3.11 (#7909)
https://github.com/python/cpython/commit/35b98e38b6edd63153fc8e092f94cb20725dacc1
2022-05-21 08:36:03 -07:00
Jelle ZijlstraandGitHub 9c0c631e46 gettext.install: names is kw-only in 3.11 (#7908) 2022-05-21 08:22:34 -07:00
Jelle ZijlstraandGitHub 8b58371278 subprocess: new params in 3.11 (#7907) 2022-05-21 16:07:50 +01:00
David RobertsonandGitHub e5594aac60 Annotations for psycopg2.ConnectionInfo (#7834)
* Annotations for psycopg2.ConnectionInfo

These annotations come from the documentation here:

https://www.psycopg.org/docs/extensions.html#psycopg2.extensions.ConnectionInfo
If there was doubt, I referred to the libpq documentation cited by
psycopg2's docs.

I wasn't completely sure about `dsn_parameters`. Psycopg2's docs list it
as an `dict`, and the example suggests it's a `dict[str, str]` at that.
From psycopg2's source I found

    https://github.com/psycopg/psycopg2/blob/1d3a89a0bba621dc1cc9b32db6d241bd2da85ad1/psycopg/conninfo_type.c#L183-L206

which is implemented here:

    https://github.com/psycopg/psycopg2/blob/1d3a89a0bba621dc1cc9b32db6d241bd2da85ad1/psycopg/utils.c#L251-L279

I'm no expert in CPython's API, but this looks to me like it's building
a `dict[str, str]`.

Additionally, the libpq docs

https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PQCONNINFO
https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PQCONNDEFAULTS

show that the underlying data just consists of strings.

Additionally, I'm pretty sure from this chunk of source

    https://github.com/psycopg/psycopg2/blob/1d3a89a0bba621dc1cc9b32db6d241bd2da85ad1/psycopg/conninfo_type.c#L581-L598

That `ConnectionInfo.__init__` takes one positional-only argument, which
must be a `psycopg2.connection`. But I don't think users are intended to
be constructing this type, so I've not added that annotation.

* Annotate `connection.info` and related attributes

* Make ConnectionInfo attributes properties

According to https://github.com/psycopg/psycopg2/blob/1d3a89a0bba621dc1cc9b32db6d241bd2da85ad1/psycopg/conninfo_type.c#L534-L563

* Mark connection attributes as readonly

according to https://github.com/psycopg/psycopg2/blob/8ef195f2ff187454cc709d7857235676bb4176ee/psycopg/connection_type.c#L1244

* Explain why some properties aren't `T | None`
2022-05-21 07:38:52 -07:00
Jelle ZijlstraandGitHub 0198d75153 types: 3.11 (and earlier) fixes (#7900)
- New attributes in 3.11
- Arguments to CodeType.__init__ are always positional (have fun)
- co_consts can use object instead of Any
2022-05-21 07:37:11 -07:00
Alex WaygoodandGitHub 76a4bd796b Simplify and correct many numeric unions (#7906)
Unblocks PyCQA/flake8-pyi#222
2022-05-21 15:25:00 +01:00
7576805aee zipfile: 3.11 fixes (#7898)
* zipfile: 3.11 fixes

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-05-21 09:22:32 +01:00
Alex WaygoodandGitHub aa70cc8abb CI: Don't install tomli for stubtest_stdlib (#7901)
The script doesn't import tomli
2022-05-20 19:33:06 -07:00
Jelle ZijlstraandGitHub 585517b20e stubtest: put all the incorrect __get__ sigs together (#7899) 2022-05-20 09:47:02 -07:00
Alex WaygoodandGitHub d54d018e2d CI: Fix stubtest workflow; make paths for other workflows more specific (#7897) 2022-05-20 16:37:02 +01:00
Alex WaygoodandGitHub e2cf6c21d5 CI: Don't run stubtest_stdlib on PRs that don't touch the stdlib (#7895)
* Don't run stubtest_stdlib on PRs that don't touch the stdlib
2022-05-20 15:56:29 +01:00
Jukka LehtosaloandGitHub cd039c9b73 Ignore mypy errors in Python 2 builtins and typing (#7894)
Similar errors are already ignored in Python 3 stubs. The
errors break Python 2 tests of mypy.

See https://github.com/python/typeshed/issues/7367#issuecomment-1131472225
for context.
2022-05-20 15:27:09 +01:00
Sebastian RittauandGitHub adf48f1f96 Only run CI on pushes to main/master and pull requests (#7883)
Currently, when a maintainer opens a pull request from a branch in the
typeshed repository (instead of a fork), CI is run twice: once for the
PR and once for the push. This not only wastes CI minutes (and it seems
we're running into some limits lately), but also makes CI output twice
as large and more difficult to process.

The disadvantage is that a PR needs to be opened to run CI.
Alternatively, CI can be triggered manually.
2022-05-20 14:14:25 +02:00
Jelle ZijlstraandGitHub e7cbde0928 xml: stubtest fixes (#7890) 2022-05-20 13:03:45 +02:00
Jaakko LappalainenandGitHub 611fa18b5c Use bytes for resp param of imaplib.Internaldate2tuple (#7892) 2022-05-20 12:45:20 +02:00
Jelle ZijlstraandGitHub 26fa57ab78 traceback: update for py311 (#7886) 2022-05-19 19:14:12 -07:00
Jelle ZijlstraandGitHub 0b7df3b2aa dataclasses: fix and sort stubtest complaints (#7888) 2022-05-19 19:13:22 -07:00
Jelle ZijlstraandGitHub 4220712aab dis: add adaptive argument for 3.11 (#7889) 2022-05-19 18:27:34 -07:00
64766c8521 locale: add locale.getencoding (#7887)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-05-19 18:20:16 -07:00