Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d5a3c29
Add types to directly defined objects in _file_io
TeamSpen210 Jul 12, 2023
ef272eb
Implement methods on AsyncIOWrapper using a pile of self-type-propert…
TeamSpen210 Jul 12, 2023
822381a
Add types for open_file()
TeamSpen210 Jul 12, 2023
c2fa19e
Set parameter defaults
TeamSpen210 Jul 12, 2023
bec946d
Reformat
TeamSpen210 Jul 12, 2023
67858f3
Suppress the duplicate type hints for trio.open_file()
TeamSpen210 Jul 12, 2023
2bb8bf1
Add types to Path wrapper class
TeamSpen210 Jul 15, 2023
d3474d3
Overloads are never executed, so they should be ignored by coverage
TeamSpen210 Jul 16, 2023
ae706f6
Type trio._util.async_wraps
TeamSpen210 Jul 16, 2023
b063e50
Add mostly-any types for internal _path functions
TeamSpen210 Jul 16, 2023
1b190e5
Disallow untyped definitions in _path and _file_io
TeamSpen210 Jul 16, 2023
616bc66
Update verify_types.json
TeamSpen210 Jul 16, 2023
4d722d2
Try and explain the type hints better
TeamSpen210 Jul 17, 2023
abddbf6
Reformat
TeamSpen210 Jul 17, 2023
a624ffe
Suppress errors about missing paramspec annotations
TeamSpen210 Jul 17, 2023
67653e6
Copy signature for path methods, improving docs display
TeamSpen210 Jul 17, 2023
f787ed6
Make signature assignment typesafe.
TeamSpen210 Jul 17, 2023
f8d8fa7
Merge upstream/master into typed-filewrapper
TeamSpen210 Jul 18, 2023
ce7a985
These parameters do not need to be Any
TeamSpen210 Jul 20, 2023
41b513b
Use modern positional argument syntax
TeamSpen210 Jul 20, 2023
1efebb0
Apply suggested changes from A5Rocks
TeamSpen210 Jul 20, 2023
7dc9647
Add test to confirm file_io type stubs match the to-wrap lists.
TeamSpen210 Jul 21, 2023
1e56d42
Remove outdated comment.
TeamSpen210 Jul 21, 2023
dd9c157
Fix type check errors
TeamSpen210 Jul 21, 2023
9a333b1
Exclude from coverage, these should never trigger.
TeamSpen210 Jul 21, 2023
561fb6a
This shouldn't exhaust itself either
TeamSpen210 Jul 21, 2023
4a4c94e
Merge remote-tracking branch 'upstream/master' into typed-filewrapper
TeamSpen210 Jul 27, 2023
b702c4f
Apply suggested changes from A5Rocks
TeamSpen210 Jul 27, 2023
65cd7f1
Pass tests
TeamSpen210 Jul 27, 2023
0c60452
Merge branch 'master' into typed-filewrapper
TeamSpen210 Jul 27, 2023
d90a4ed
Sort imports, replace a use of Any
TeamSpen210 Jul 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ exclude_lines =
abc.abstractmethod
if TYPE_CHECKING:
if _t.TYPE_CHECKING:
@overload

partial_branches =
pragma: no branch
Expand Down
2 changes: 2 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
("py:obj", "trio._abc.T"),
("py:obj", "trio._abc.T_resource"),
("py:class", "types.FrameType"),
("py:class", "P.args"),
("py:class", "P.kwargs"),
# TODO: figure out if you can link this to SSL
("py:class", "Context"),
# TODO: temporary type
Expand Down
6 changes: 4 additions & 2 deletions docs/source/reference-io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -637,9 +637,11 @@ Asynchronous path objects
Asynchronous file objects
~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: open_file
.. Suppress type annotations here, they refer to lots of internal types.
The normal Python docs go into better detail.
.. autofunction:: open_file(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=None, opener=None)

.. autofunction:: wrap_file
.. autofunction:: wrap_file(file)

.. interface:: Asynchronous file interface

Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ disallow_untyped_defs = false

# DO NOT use `ignore_errors`; it doesn't apply
# downstream and users have to deal with them.
[[tool.mypy.overrides]]
module = [
"trio._path",
"trio._file_io",
]
disallow_untyped_defs = true

[[tool.mypy.overrides]]
module = [
Expand Down
Loading