Commit Graph
100 Commits
Author SHA1 Message Date
Akuli f77d0f80a8 requests: allow immutable headers (#7932) 2022-05-25 20:22:05 -07:00
Akuli 9a09db46f5 Fix requests.Session().hooks (#7871)
Fixes #7776

Mutating hooks, as in `session.hooks['response'] = ...`, should work. Reassigning it like `session.hooks = ...` is probably a bad idea, so it will always be a `dict`.
2022-05-18 19:31:34 -07:00
Akuli 6c6c669ada Run mypy_primer in all pull requests (#7804) 2022-05-07 09:58:53 +03:00
Akuli 58f2e317c1 tkinter: add _windowingsystem() (#7803) 2022-05-06 23:45:47 -07:00
Akuli 7d046654f1 Accept lists of tuples in tkinter.Canvas.create_foo() methods (#7722)
Fixes #7698.

At runtime, these methods call `tkinter._flatten()`, which recursively turns lists or tuples (but not other sequences) into a flat tuple of items. Unfortunately we don't have recursive types yet.
2022-04-30 06:52:56 -06:00
Akuli 205959917b sys: delete unnecessary python version check (#7742) 2022-04-29 22:58:36 +02:00
Akuli e613fc483b Delete python 2 branches from third-party stubs (#7741)
Since #7703, we no longer have third-party stubs that support Python 2, so code like `if sys.version_info >= (3, 0)` can be simplified.
2022-04-29 20:53:01 +01:00
Akuli bfa918880f asyncio: expose WriteTransport.get_write_buffer_limits on all Python versions (#7718) 2022-04-27 16:38:25 +03:00
Akuli 7576c5e1d5 asyncio: add missing methods to _FlowControlMixin (#7719) 2022-04-27 16:32:22 +03:00
Akuli f87e811345 Remove old comments about pinned Python versions (#7622) 2022-04-14 00:58:47 -07:00
Akuli 40553277ad asyncio: use WriteTransport in StreamWriter (#7611) 2022-04-09 07:03:34 -07:00
Akuli f9cb7c3ed4 Use Literal for statistics.quantiles() (#7463)
I'm going to merge; I think this is consistent with what we've done with e.g. the `byteorder` argument for `int.from_bytes` :)
2022-03-08 21:38:31 +00:00
6c967d4202 Update cachetools to 5.0.0 (#7455)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-03-08 19:20:22 +00:00
Akuli 30a424c661 Finish renaming stubtest.yml to daily.yml (#7448) 2022-03-07 11:09:24 +02:00
Akuli dff461fc6a improve tkinter.Treeview.heading and tkinter.Treeview.item (#6999) 2022-01-23 14:53:30 +01:00
Akuli a22ca2ec51 make the default positional-or-keyword in Mapping.get and MutableMapping.pop (#6694) 2022-01-22 07:19:01 -08:00
AkuliandNikita Sobolev 61495d80aa Automatically create an issue if the nightly stubtest run fails (#6978)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-01-20 18:24:14 +02:00
Akuli 80c75fb029 Stricter pyright checks for playsound (#6948) 2022-01-18 16:36:51 +01:00
Akuli 5d20635890 pygments: delete _TokenType.__init__ (#6918) 2022-01-14 19:13:14 -08:00
Akuli f9c650d167 Delete duplicate union members (#6916) 2022-01-14 17:41:06 +02:00
Akuli df0fe16456 requests: remove an unused allowlist entry (#6911) 2022-01-13 20:35:37 +01:00
Akuli 62f22ef0cc CONTRIBUTING.md: remove duplicate info about how CI runs tests (#6910) 2022-01-13 08:01:20 -08:00
Akuli b77f994801 Improve _tkinter (#6908) 2022-01-13 17:05:20 +02:00
Akuli 11642f866c Recommend scripts/create_baseline_stubs.py in CONTRIBUTING.md (#6906) 2022-01-13 15:11:20 +01:00
Akuli b2375ddaeb Enable pyright for Python 3.11 (#6904) 2022-01-12 20:07:57 +01:00
Akuli 423ae7f8fd requests: Remove an unused allowlist entry (#6897) 2022-01-12 00:53:43 -08:00
Akuli e743ea9ca7 Improve turtle.ScrolledCanvas (#6757) 2022-01-09 11:24:45 -08:00
Akuli 950cff21f6 create_baseline_stubs.py: Fix stubgen invocation (#6856) 2022-01-08 12:33:29 +01:00
Akuli a7886bfa55 Fix several typos in comments (#6830) 2022-01-05 18:44:34 +01:00
Akuli b5666d473d Improve comments of builtins.function (#6818) 2022-01-04 14:04:33 -06:00
Akuli 38a08fcf04 List returned from re.split() can contain Nones (#6763) 2021-12-30 13:27:39 -06:00
Akuli 0f7dbd811e move stat.FILE_ATTRIBUTE_* to _stat.pyi and fix availability (#6761) 2021-12-30 13:07:28 -06:00
Akuli 7fc402a6d0 Move IO_REPARSE_TAG_* constants to _stat (#6760) 2021-12-30 18:26:57 +01:00
Akuli c3cc5e47c0 delete very old autogenerated comments (#6755) 2021-12-30 17:16:06 +01:00
Akuli a89e5bb0cf Relax check_new_syntax.py to allow elif statements for old versions (#6729) 2021-12-29 18:50:11 +02:00
Akuli bae606da8d Enable stubtest for jack (#6727) 2021-12-29 11:42:28 +01:00
Akuli 4aa4cb9ae2 stubtest_third_party: do not install apt packages in the same script (#6714) 2021-12-28 11:33:49 +01:00
Akuli 1c43c6b30d Fix CI failure (#6707) 2021-12-26 23:26:37 +02:00
Akuli 66ed211691 Re-enable stdlib stubtest on macos (#6696) 2021-12-26 19:59:04 +01:00
Akuli 9efc0c0dca pygments: Annotate several generator functions (#6695) 2021-12-26 13:53:41 +01:00
Akuli 48f13e451a shorten tkinter's comments (#6675) 2021-12-23 14:07:19 +02:00
Akuli 714ba1747b stubtest: temporary pin to python 3.10.0 (#6602) 2021-12-16 12:47:47 +02:00
Akuli dc4c9534c7 allowlists: add comment to hmac.HMAC.blocksize (#6539) 2021-12-07 13:13:35 -08:00
Akuli 91465a1d07 toposort: Make argument types less restrictive (#6531) 2021-12-07 16:26:09 +01:00
Akuli f31b49699a fix mypy_primer_comment workflow for more shards (#6533) 2021-12-07 16:12:00 +01:00
Akuli 7155bdae63 Re-export more os functions in posix, tweak availability on linux (#6529) 2021-12-07 16:10:41 +01:00
Akuli 44f71867c7 add tkinter.EventType aliases (#6516) 2021-12-07 15:10:39 +02:00
Akuli 3da1db2698 shard mypy_primer more (#6530) 2021-12-07 15:03:59 +02:00
Akuli af85e18bec tkinter Pack,Grid,Place: delete commented-out aliases and explain in allowlist (#6518) 2021-12-06 09:09:06 -08:00
Akuli 08649177f1 Add codecs.BOM* constants (#6515) 2021-12-06 17:36:09 +02:00
Akuli bc912ea472 correct traceback.print_exception and traceback.format_exception on python 3.10 (#6512) 2021-12-06 15:43:32 +01:00
AkuliandJelle Zijlstra a4118b1a09 trust_server_pasv_ipv4_address: move comments to allowlists (#6496)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2021-12-05 23:59:47 +02:00
Akuli 7225dfafcf add several re-exports to posix (#6495) 2021-12-05 08:45:24 -08:00
Akuli 24afb531ff stubtest_stdlib: get rid of --ignore-missing-stub (#6491)
* get rid of --ignore-missing-stub

* update allowlists based on github actions logs, with script

import re

platforms = ["linux", "win32", "darwin"]
versions = ["py36", "py37", "py38", "py39", "py310"]

entries_by_pv = {}
for p in platforms:
    for v in versions:
        p_name = {"linux": "ubuntu", "darwin": "macos", "win32": "windows"}[p]
        v_name = "3." + v.replace("py3", "")
        if v_name == "3.9":
            v_name = "3.9.7"

        entries = set()
        with open(f"la/Check stdlib with stubtest ({p_name}-latest, {v_name})/6_Run stubtest.txt") as file:
            for line in file:
                m = re.search(r"error: (.*) is not present in stub$", line.strip())
                if m:
                    entries.add(m.group(1))
        entries_by_pv[p, v] = entries

def remove_intersection(sets):
    sets = list(sets)
    result = set(sets[0])
    for s in sets[1:]:
        result &= s
    for s in sets:
        for r in result:
            s.remove(r)
    return result

common_to_all = remove_intersection(entries_by_pv.values())

common_to_version = {}
for v in versions:
    common_to_version[v] = remove_intersection([
        entries
        for (p, v2), entries in entries_by_pv.items()
        if v == v2
    ])

common_to_platform = {}
for p in platforms:
    common_to_platform[p] = remove_intersection([
        entries
        for (p2, v), entries in entries_by_pv.items()
        if p == p2
    ])

def write(fname, entries):
    with open(f"tests/stubtest_allowlists/{fname}.txt", "a") as file:
        file.write("\n# Exists at runtime, but missing from stubs\n")
        for i in sorted(entries):
            file.write(i + "\n")

write("py3_common", common_to_all)
for v, entries in common_to_version.items():
    write(v, entries)
for p, entries in common_to_platform.items():
    write(p, entries)
for (p, v), entries in entries_by_pv.items():
    write(p + "-" + v, entries)

* Manually combine __main__ attributes into a single entry

* move and comment entries manually
2021-12-04 16:58:44 -08:00
Akuli 3f281881c2 get rid of remaining references to pallets stubs (#6474) 2021-12-02 21:41:40 +02:00
AkuliandSebastian Rittau ec0051a59b ci: fix stubtest_third_party while loop (#6468)
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2021-12-01 19:32:33 +02:00
Akuli 50d29ef424 ci: Do not run stubtest_third_party for deleted stubs (#6467) 2021-12-01 18:15:17 +01:00
Akuli 4631b74919 Fix various issues in redis.client (#6464) 2021-12-01 17:09:48 +01:00
Akuli ea3f962860 Move all definitions except environ from posix to os (#6442) 2021-12-01 17:07:33 +01:00
Akuliandpre-commit-ci[bot] bdf906e2bc stubtest_stdlib: fail if there are unused allowlist entries (#6424)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-12-01 12:10:27 +02:00
deaa764915 redis: fix several stubtest warnings (#6378)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2021-12-01 12:00:07 +02:00
AkuliandAlex Waygood b3e8073bac Create unittest._log stub and improve _AssertLogsContext (#6428)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2021-11-30 21:39:14 -08:00
Akuli c8c5519fa6 sqlite3: stubtest fixes (#6441) 2021-11-29 11:07:20 -08:00
Akuli f29f0a5394 importlib: stubtest fixes for py310 (#6443) 2021-11-29 11:05:54 -08:00
Akuli 52559e83cf add comment about CodeType.replace to stubtest allowlists (#6447) 2021-11-29 09:01:00 -08:00
Akuli 71999b7cde operator.countOf takes Iterable (#6431) 2021-11-28 14:34:05 -08:00
Akuli 99f6e022f7 ipaddress: return unions from ip_address, ip_network, ip_interface (#6400) 2021-11-28 08:06:22 -08:00
Akuli 2b702233c6 tests/check_new_syntax.py: check order of if statements (#6423) 2021-11-28 08:04:46 -08:00
Akuli 6d54c10387 Make posix module empty on windows (#6427) 2021-11-28 07:54:30 -08:00
Akuli 524775d45e move definitions from operator to _operator (#6429) 2021-11-28 07:52:57 -08:00
Akuli 6130c2459e Delete duplicate comment (#6391) 2021-11-26 12:56:27 -08:00
Akuli 31c1865b91 Don't trigger mypy_primer from commits created by pre-commit.ci (#6385)
If pre-commit makes a change immediately after a PR has been made, it's important that the stubtest/mypy/pytype/pyright checks are run again, as line numbers might have changed. However, there's no reason to start a new run of mypy_primer, since pre-commit will make no substantive changes to a PR, only cosmetic changes, and that shouldn't affect the diff from mypy_primer.
2021-11-26 07:37:55 -08:00
Akuli a5bc1e037f Add mypy error codes to '# type: ignore' comments (#6379) 2021-11-26 07:07:56 +01:00
Akuli 32a38e787f Fix prints in stubtest_third_party (#6380) 2021-11-25 13:09:14 -08:00
Akuli 0cd1135219 Revert "do not use mypy-specific syntax in '# type: ignore' comments" (#6338) 2021-11-18 20:13:07 +02:00
Akuli 230f149539 Remove unnecessary pyrightconfig excludes (#6271) 2021-11-09 20:00:59 +02:00
Akuli ece04a288e Use TypeVar for WeakMethod (#6199) 2021-10-25 12:52:02 +02:00
Akuli 8454a48c5e allow file descriptors in os.stat wrapper functions (#6198) 2021-10-25 13:00:27 +03:00
Akuli 739cc27cc4 fix shutil.disk_usage() argument type (#6197) 2021-10-25 11:52:04 +02:00
Akuli 53087be4eb get rid of tkinter._TkinterSequence type alias (#6181) 2021-10-18 10:22:01 +02:00
Akuli 5b03ad18cc tkinter.ttk.Treeview: more Literal[""] (#6182) 2021-10-16 18:41:52 +02:00
Akuli 994b69ef8f Use lowercase tuple where possible (#6170) 2021-10-14 17:18:19 -07:00
Akuli b2082ce559 check_new_syntax.py: improve dicts in error message (#6168)
Improve error message for bad dict. Before dict[(int, str)] now dict[int, str]
2021-10-13 18:14:05 -07:00
Akuli 75ca712f3c check_new_syntax.py: check nested annotations (#6167) 2021-10-14 00:28:38 +03:00
Akuli f30b5ae363 dateparser.search.search_dates: allow arbitrary-length tuples for languages argument (#6166) 2021-10-13 23:22:58 +03:00
Akuli e72a4034bf Cleanup: use lower-case list and dict, add a test (#6161) 2021-10-13 22:59:27 +03:00
Akuli 62f27cf6b8 Remove unncessary MutableMapping overrides (#6097) 2021-09-30 18:02:38 +02:00
Akuli 3eee9e1d88 Add back and update cachetools stubs to cachetools 4.2.4 (#6096) 2021-09-30 16:53:01 +02:00
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
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
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
Akuli e69ca588ac Stubs for ttkthemes (#6024) 2021-09-10 15:59:12 +02:00
Akuli 832a24c8a1 Create send2trash stubs (#6000) 2021-09-03 22:51:03 +02:00
Akuli 6307bfd421 Delete yaml.CDangerLoader and yaml.CDangerDumper (#5990)
These no longer exist in PyYAML 4.2.
2021-09-01 10:50:30 +03:00
Akuli 8d5452e873 do not use mypy-specific syntax in '# type: ignore' comments (#5953) 2021-08-29 03:58:34 -07:00
Akuli cd90721604 Clean up tests/check_pep_604.py (#5980) 2021-08-28 21:56:53 -07:00
Akuli 9af9cca7f3 lowercase list and dict in the rest of stdlib (#5892) 2021-08-09 00:13:08 +02:00