Commit Graph

60 Commits

Author SHA1 Message Date
Semyon Moroz 33414287a7 [aiofiles] Update to 25.1.* (#14860) 2025-10-10 12:38:43 +02:00
Jelle Zijlstra ca44e4c45d Add __slots__ to third-party packages using stubdefaulter (#14619) 2025-08-21 15:38:13 -07:00
Jelle Zijlstra 573b57d8da Add missing defaults to third-party stubs (#14617) 2025-08-21 13:36:29 -07:00
Brian Schubert 81c8fcb2e6 Mark stub-only private symbols as @type_check_only in third-party stubs (#14545) 2025-08-08 11:29:48 +02:00
Sebastian Rittau 3f08a4ed10 Split tool.stubtest.platforms metadata key (#13746)
Co-authored-by: Avasam <samuel.06@hotmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-07-31 12:07:20 -04:00
Semyon Moroz e27ad6d19b [aiofiles] Remove from pyrightconfig (#14310) 2025-07-07 14:29:38 +02:00
Alexey Vaganov 1730d1c16b Fix AiofilesContextManagerTempDir type argument (#14349) 2025-07-07 13:24:14 +02:00
Viktor 5a619a53e4 aiofiles: add type for executor parameter (#14226)
Fix partially unknown executor
2025-06-05 16:57:30 -07:00
Sebastian Rittau 126768408a Replace Incomplete | None = None in third party stubs (#14063) 2025-05-15 21:37:43 +02:00
Semyon Moroz 9234985c3d Add __all__ (#13704) 2025-03-25 14:09:32 +01:00
Sébastien Quioc 3d87311595 [aiofiles] Fix the file argument type in AsyncBase (#13717) 2025-03-25 13:02:33 +01:00
Stephen Morton 097581ea47 Update to mypy 1.14 (#13272) 2024-12-20 17:29:38 -08:00
Sebastian Rittau b13bb947c3 [aiofiles] Update to 24.1 (#12207) 2024-06-25 16:51:01 -07:00
Max Muoto f2d96aea32 Add missing delete on close arg for aiofiles.NamedTemporaryFile (#12110) 2024-06-22 12:19:27 -07:00
Sebastian Rittau 6d19a17f57 [aiofiles] Annotate AiofilesContextManagerTempDir (#11705) 2024-04-02 15:44:44 +02:00
Sebastian Rittau 33de88879f Remove bare Incomplete annotations in third-party stubs (#11671) 2024-03-30 18:34:51 -07:00
Shantanu 88fa182253 Use PEP 570 syntax in third party stubs (#11554) 2024-03-10 14:11:43 +01:00
Shantanu 4d8ae17776 Bump mypy to 1.9, add to json.encoder, small fixups (#11549)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-03-09 14:25:00 -08:00
Sebastian Rittau b6eaadcfe5 Update typing_extensions imports in third-party stubs (#11245) 2024-01-05 15:40:13 +01:00
Sebastian Rittau 695d41f487 Bump aiofiles to 23.2.* (#10584) 2023-08-16 12:05:42 +01:00
Sebastian Rittau afe18e95a9 Add an upstream_repository field to METADATA.toml (#10487)
Closes: #10478
2023-07-20 16:45:41 +02:00
Sebastian Rittau 786bd22343 [aiofiles] Use file mode alias from _typeshed (#10233) 2023-06-07 06:14:03 -07:00
Abtin 31f4b8cf80 add typing support to more aiofiles wrapped functions (#10175)
add stubs for missing functions:

- renames
- unlink
- link
- listdir
2023-05-22 07:44:00 -07:00
Jelle Zijlstra 17edf76275 aiofiles: use ReadableBuffer (#10105)
Part of #9006
2023-04-29 15:50:48 +01:00
Alex Waygood b9fedd20ce Add defaults for third-party stubs A-D (#9952) 2023-03-27 16:49:58 +01:00
Mehdi Drissi 390058eb39 Update aiofiles for v23.1.* (#9711)
Co-authored-by: Mehdi Drissi <mdrissi@snapchat.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-03-09 17:25:03 +00:00
Avasam ed6748fb32 Stubtest settings: change ignore_missing_stub default to false (#9779)
If you're reading about this commit from an autogenerated changelog entry, this should have no user-visible impact on how the stubs are interpreted by a type checker; it's just an internal change to how typeshed's tests work.
2023-02-20 22:37:45 +00:00
Alex Waygood 7180d0223b Use typing_extensions.Self instead of _typeshed.Self (#9702) 2023-02-15 11:32:43 +01:00
Avasam 372073d35b Use _typeshed.FileDescriptorOrPath in stubs (#9695) 2023-02-09 08:30:19 +01:00
Alex Waygood a4e3cfefac Improve pre-commit config (#9563)
- Add a few more hooks. These are all very fast, and I've found them useful in other projects:
  - Autofixes:
    - `trailing-whitespace`: fixes trailing whitespace
    - `requirements-txt-fixer`: alphabetises items in `requirements.txt` files
    - `end-of-file-fixer`: makes sure every file ends with a single newline character
    - `mixed-line-ending`: Makes sure Windows users don't accidentally introduce CRLF line endings into a file that uses LF line endings
  - None-autofixes:
    - `check-yaml`: loads YAML files to validate syntax
    - `check-toml`: loads TOML files to validate syntax
    - `check-merge-conflict`: detects merge-conflict strings in files and blocks them from accidentally being committed
    - `check-case-conflict`: checks for files with names that would conflict on a case-insensitive filesystem like MacOS HFS+ or Windows FAT; blocks them from being committed.
  - Change the bot schedule to quarterly, to reduce noisy PRs
  - Change the `black` language target-version to Python 3.10, synching the setting here with the changes that were made to our `pyproject.toml` file in #7538
2023-01-18 06:29:18 -08:00
Alex Waygood 4fea314594 Replace Any with Incomplete in many places (#9558) 2023-01-18 08:48:16 +00:00
Maxwell G 553e7d46f0 Add aiofiles.os.scandir (#9280) 2022-11-25 18:36:00 -08:00
Avasam 033d21e775 Complete stubtest for aiofiles + fix on Windows (#9184) 2022-11-13 06:45:20 -08:00
Nikita Sobolev c0e9038f0d Fix and allow classes with missing metaclasses (#9136) 2022-11-08 18:13:59 +00:00
Nikita Sobolev 10f05d3fb6 Remove aiofiles/tempfile/temptypes.pyi from pyright exclude (#9104) 2022-11-05 07:10:50 -07:00
github-actions[bot] 8a8db9c6d4 [stubsabot] Bump aiofiles to 22.1.* (#8714)
Co-authored-by: stubsabot <>
2022-09-08 18:25:46 -07:00
Alex Waygood e2211cb420 Delete some unused # noqa comments (#8639) 2022-08-29 12:56:06 +01:00
Alex Waygood 35616b439f Run pycln as a pre-commit hook in CI (#8304) 2022-07-18 09:27:28 +02:00
Andrej Shadura 043d9dac61 Add missing aiofiles.tempfile classes (#7523)
Fixes: #6524

Co-authored-by: Andrej Shadura <andrew.shadura@collabora.co.uk>
Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
2022-07-05 23:50:19 +02:00
Alex Waygood 653f2c6ba4 Third-party stubs: import from collections.abc where possible (#7637) 2022-04-16 14:52:57 +01:00
Alex Waygood 740193a8fc Use TypeAlias where possible for type aliases (#7630) 2022-04-15 18:01:00 -07:00
Alex Waygood a3245db63c Remove unneeded # noqa comments, fix broken # noqa comments (#7561) 2022-03-28 23:17:44 +02:00
Alex Waygood 3ab250eec8 Use PEP 604 syntax wherever possible (#7493) 2022-03-16 16:01:33 +01:00
Shantanu 9796b9ed69 Improve open overloads when mode is a literal union (#7428)
As pointed out by @gvanrossum in https://github.com/python/typing/issues/1096

Improves type inference in cases when we know that mode is
OpenBinaryMode, but don't know anything more specific:
```
def my_open(name: str, write: bool):
    mode: Literal['rb', 'wb'] = 'wb' if write else 'rb'
    with open(name, mode) as f:
        reveal_type(f)  # previously typing.IO[Any], now typing.BinaryIO
```

You may be tempted into thinking this is some limitation of type
checkers. mypy does in fact have logic for detecting if we match
multiple overloads and union-ing up the return types of matched
overloads. The problem is the last overload interferes with this logic.
That is, if you remove the fallback overload (prior to this PR), you'd get
"Union[io.BufferedReader, io.BufferedWriter]" in the above example.

Co-authored-by: hauntsaninja <>
2022-03-06 15:45:34 -08:00
Joseph Young 13e31aa3bf Add stubs for aiofiles.os.path (#6787) 2022-01-13 12:31:19 +02:00
Alex Waygood a40d79a4e6 Use lowercase type everywhere (#6853) 2022-01-08 16:09:29 +01:00
Joseph Young 4538770404 Add missing functions and keyword arguments to aiofiles.os (#6785)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2022-01-02 20:08:00 +02:00
Alex Waygood 8d5d2520ac Use PEP 585 syntax wherever possible (#6717) 2021-12-28 11:31:43 +01:00
Sebastian Rittau d065ee4aef Enable stubtest for aiofiles (#6698) 2021-12-26 15:54:42 +02:00
Sebastian Rittau bb77f39b7c Add a 'stubtest' flag to METADATA.toml (#6687)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-12-25 17:02:57 +02:00