basedpyright 1.13.1 → 1.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/dist/pyright-langserver.js +1 -1
  2. package/dist/pyright-langserver.js.map +1 -1
  3. package/dist/pyright.js +1 -1
  4. package/dist/pyright.js.map +1 -1
  5. package/dist/typeshed-fallback/commit.txt +1 -1
  6. package/dist/typeshed-fallback/stdlib/VERSIONS +3 -1
  7. package/dist/typeshed-fallback/stdlib/_ast.pyi +1 -1
  8. package/dist/typeshed-fallback/stdlib/_bisect.pyi +221 -221
  9. package/dist/typeshed-fallback/stdlib/_csv.pyi +213 -213
  10. package/dist/typeshed-fallback/stdlib/_curses.pyi +1 -2
  11. package/dist/typeshed-fallback/stdlib/_heapq.pyi +67 -67
  12. package/dist/typeshed-fallback/stdlib/_interpchannels.pyi +84 -0
  13. package/dist/typeshed-fallback/stdlib/_json.pyi +92 -92
  14. package/dist/typeshed-fallback/stdlib/_lsprof.pyi +92 -92
  15. package/dist/typeshed-fallback/stdlib/_random.pyi +30 -30
  16. package/dist/typeshed-fallback/stdlib/_tkinter.pyi +7 -0
  17. package/dist/typeshed-fallback/stdlib/_weakref.pyi +3 -2
  18. package/dist/typeshed-fallback/stdlib/argparse.pyi +6 -2
  19. package/dist/typeshed-fallback/stdlib/array.pyi +281 -281
  20. package/dist/typeshed-fallback/stdlib/asyncio/events.pyi +56 -37
  21. package/dist/typeshed-fallback/stdlib/asyncio/tasks.pyi +4 -1
  22. package/dist/typeshed-fallback/stdlib/asyncio/unix_events.pyi +156 -134
  23. package/dist/typeshed-fallback/stdlib/asyncio/windows_events.pyi +3 -2
  24. package/dist/typeshed-fallback/stdlib/audioop.pyi +95 -95
  25. package/dist/typeshed-fallback/stdlib/binascii.pyi +123 -123
  26. package/dist/typeshed-fallback/stdlib/cmath.pyi +112 -112
  27. package/dist/typeshed-fallback/stdlib/dataclasses.pyi +1 -1
  28. package/dist/typeshed-fallback/stdlib/logging/__init__.pyi +2 -5
  29. package/dist/typeshed-fallback/stdlib/math.pyi +424 -424
  30. package/dist/typeshed-fallback/stdlib/mmap.pyi +160 -154
  31. package/dist/typeshed-fallback/stdlib/multiprocessing/context.pyi +10 -6
  32. package/dist/typeshed-fallback/stdlib/multiprocessing/sharedctypes.pyi +33 -12
  33. package/dist/typeshed-fallback/stdlib/os/__init__.pyi +10 -10
  34. package/dist/typeshed-fallback/stdlib/posixpath.pyi +3 -13
  35. package/dist/typeshed-fallback/stdlib/spwd.pyi +9 -0
  36. package/dist/typeshed-fallback/stdlib/subprocess.pyi +8 -0
  37. package/dist/typeshed-fallback/stdlib/tarfile.pyi +23 -1
  38. package/dist/typeshed-fallback/stdlib/telnetlib.pyi +1 -0
  39. package/dist/typeshed-fallback/stdlib/typing.pyi +21 -2
  40. package/dist/typeshed-fallback/stdlib/weakref.pyi +4 -1
  41. package/dist/typeshed-fallback/stdlib/xml/sax/handler.pyi +1 -1
  42. package/dist/typeshed-fallback/stdlib/zlib.pyi +157 -157
  43. package/dist/typeshed-fallback/stubs/Flask-SocketIO/flask_socketio/__init__.pyi +4 -4
  44. package/dist/typeshed-fallback/stubs/aiofiles/METADATA.toml +1 -1
  45. package/dist/typeshed-fallback/stubs/aiofiles/aiofiles/base.pyi +6 -20
  46. package/dist/typeshed-fallback/stubs/aiofiles/aiofiles/os.pyi +2 -0
  47. package/dist/typeshed-fallback/stubs/aiofiles/aiofiles/ospath.pyi +5 -3
  48. package/dist/typeshed-fallback/stubs/aiofiles/aiofiles/tempfile/__init__.pyi +143 -79
  49. package/dist/typeshed-fallback/stubs/aiofiles/aiofiles/threadpool/__init__.pyi +5 -5
  50. package/dist/typeshed-fallback/stubs/assertpy/assertpy/extracting.pyi +7 -1
  51. package/dist/typeshed-fallback/stubs/docker/docker/_types.pyi +8 -0
  52. package/dist/typeshed-fallback/stubs/docker/docker/api/container.pyi +2 -2
  53. package/dist/typeshed-fallback/stubs/docker/docker/api/image.pyi +3 -2
  54. package/dist/typeshed-fallback/stubs/docker/docker/api/network.pyi +32 -15
  55. package/dist/typeshed-fallback/stubs/docker/docker/models/containers.pyi +36 -7
  56. package/dist/typeshed-fallback/stubs/docker/docker/models/images.pyi +67 -5
  57. package/dist/typeshed-fallback/stubs/docker/docker/models/networks.pyi +20 -3
  58. package/dist/typeshed-fallback/stubs/docker/docker/types/containers.pyi +78 -70
  59. package/dist/typeshed-fallback/stubs/docker/docker/utils/json_stream.pyi +4 -7
  60. package/dist/typeshed-fallback/stubs/flake8/METADATA.toml +1 -1
  61. package/dist/typeshed-fallback/stubs/fpdf2/fpdf/fpdf.pyi +16 -5
  62. package/dist/typeshed-fallback/stubs/fpdf2/fpdf/image_datastructures.pyi +2 -1
  63. package/dist/typeshed-fallback/stubs/fpdf2/fpdf/table.pyi +4 -2
  64. package/dist/typeshed-fallback/stubs/fpdf2/fpdf/text_region.pyi +7 -7
  65. package/dist/typeshed-fallback/stubs/hdbcli/METADATA.toml +1 -1
  66. package/dist/typeshed-fallback/stubs/hdbcli/hdbcli/dbapi.pyi +1 -0
  67. package/dist/typeshed-fallback/stubs/hvac/METADATA.toml +1 -1
  68. package/dist/typeshed-fallback/stubs/hvac/hvac/api/system_backend/raft.pyi +9 -0
  69. package/dist/typeshed-fallback/stubs/hvac/hvac/api/system_backend/wrapping.pyi +1 -0
  70. package/dist/typeshed-fallback/stubs/influxdb-client/METADATA.toml +1 -1
  71. package/dist/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/_pages.pyi +37 -0
  72. package/dist/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/bucket_api.pyi +5 -1
  73. package/dist/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/tasks_api.pyi +4 -3
  74. package/dist/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/bucket.pyi +6 -6
  75. package/dist/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/task.pyi +6 -6
  76. package/dist/typeshed-fallback/stubs/networkx/METADATA.toml +3 -1
  77. package/dist/typeshed-fallback/stubs/olefile/olefile/olefile.pyi +41 -31
  78. package/dist/typeshed-fallback/stubs/openpyxl/METADATA.toml +1 -1
  79. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/cell/rich_text.pyi +3 -0
  80. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/chart/trendline.pyi +1 -2
  81. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/base.pyi +1 -1
  82. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/container.pyi +18 -0
  83. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/sequence.pyi +20 -12
  84. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/custom.pyi +1 -1
  85. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/extended.pyi +2 -2
  86. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/relationship.pyi +6 -11
  87. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/cache.pyi +66 -135
  88. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/fields.pyi +2 -2
  89. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/styles/alignment.pyi +0 -1
  90. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/styles/borders.pyi +0 -2
  91. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/styles/fills.pyi +3 -3
  92. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/styles/named_styles.pyi +5 -10
  93. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/utils/cell.pyi +2 -2
  94. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/utils/indexed_list.pyi +2 -2
  95. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/defined_name.pyi +2 -2
  96. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_read_only.pyi +11 -3
  97. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/datavalidation.pyi +2 -2
  98. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/dimensions.pyi +6 -3
  99. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/filters.pyi +26 -22
  100. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/hyperlink.pyi +3 -5
  101. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/views.pyi +5 -2
  102. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/worksheet.pyi +4 -2
  103. package/dist/typeshed-fallback/stubs/peewee/METADATA.toml +1 -1
  104. package/dist/typeshed-fallback/stubs/peewee/peewee.pyi +6 -1
  105. package/dist/typeshed-fallback/stubs/protobuf/METADATA.toml +2 -2
  106. package/dist/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor_pb2.pyi +84 -15
  107. package/dist/typeshed-fallback/stubs/psutil/METADATA.toml +1 -1
  108. package/dist/typeshed-fallback/stubs/psutil/psutil/__init__.pyi +3 -1
  109. package/dist/typeshed-fallback/stubs/psutil/psutil/_common.pyi +0 -2
  110. package/dist/typeshed-fallback/stubs/psutil/psutil/_compat.pyi +0 -1
  111. package/dist/typeshed-fallback/stubs/psutil/psutil/_psaix.pyi +1 -1
  112. package/dist/typeshed-fallback/stubs/psutil/psutil/_psbsd.pyi +1 -1
  113. package/dist/typeshed-fallback/stubs/psutil/psutil/_pslinux.pyi +2 -2
  114. package/dist/typeshed-fallback/stubs/psutil/psutil/_psosx.pyi +1 -1
  115. package/dist/typeshed-fallback/stubs/psutil/psutil/_pssunos.pyi +1 -1
  116. package/dist/typeshed-fallback/stubs/psutil/psutil/_psutil_osx.pyi +1 -1
  117. package/dist/typeshed-fallback/stubs/psutil/psutil/_pswindows.pyi +1 -1
  118. package/dist/typeshed-fallback/stubs/pyinstaller/METADATA.toml +1 -1
  119. package/dist/typeshed-fallback/stubs/pyinstaller/PyInstaller/__main__.pyi +1 -0
  120. package/dist/typeshed-fallback/stubs/pyinstaller/PyInstaller/building/splash.pyi +0 -2
  121. package/dist/typeshed-fallback/stubs/pyinstaller/PyInstaller/compat.pyi +2 -3
  122. package/dist/typeshed-fallback/stubs/reportlab/METADATA.toml +3 -2
  123. package/dist/typeshed-fallback/stubs/requests/requests/models.pyi +2 -2
  124. package/dist/typeshed-fallback/stubs/seaborn/METADATA.toml +2 -1
  125. package/dist/typeshed-fallback/stubs/setuptools/METADATA.toml +1 -1
  126. package/dist/typeshed-fallback/stubs/setuptools/pkg_resources/__init__.pyi +80 -50
  127. package/dist/typeshed-fallback/stubs/setuptools/setuptools/__init__.pyi +2 -4
  128. package/dist/typeshed-fallback/stubs/setuptools/setuptools/build_meta.pyi +6 -3
  129. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/bdist_egg.pyi +3 -9
  130. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/bdist_wheel.pyi +61 -0
  131. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/build_ext.pyi +2 -2
  132. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/build_py.pyi +12 -1
  133. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/easy_install.pyi +1 -1
  134. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/egg_info.pyi +4 -4
  135. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/install_lib.pyi +3 -4
  136. package/dist/typeshed-fallback/stubs/setuptools/setuptools/compat/py311.pyi +1 -1
  137. package/dist/typeshed-fallback/stubs/setuptools/setuptools/config/expand.pyi +0 -1
  138. package/dist/typeshed-fallback/stubs/shapely/METADATA.toml +2 -1
  139. package/dist/typeshed-fallback/stubs/shapely/shapely/_geometry.pyi +3 -3
  140. package/dist/typeshed-fallback/stubs/shapely/shapely/constructive.pyi +6 -6
  141. package/dist/typeshed-fallback/stubs/shapely/shapely/geometry/base.pyi +3 -3
  142. package/dist/typeshed-fallback/stubs/shapely/shapely/io.pyi +2 -2
  143. package/dist/typeshed-fallback/stubs/shapely/shapely/strtree.pyi +9 -9
  144. package/dist/typeshed-fallback/stubs/tree-sitter-languages/METADATA.toml +1 -1
  145. package/package.json +1 -1
  146. package/dist/typeshed-fallback/stubs/tree-sitter/METADATA.toml +0 -7
  147. package/dist/typeshed-fallback/stubs/tree-sitter/tree_sitter/__init__.pyi +0 -17
  148. package/dist/typeshed-fallback/stubs/tree-sitter/tree_sitter/binding.pyi +0 -115
@@ -1,3 +1,4 @@
1
+ import sys
1
2
  from _typeshed import (
2
3
  BytesPath,
3
4
  Incomplete,
@@ -10,77 +11,13 @@ from _typeshed import (
10
11
  StrPath,
11
12
  )
12
13
  from asyncio import AbstractEventLoop
13
- from typing import AnyStr, Literal, TypeVar, overload
14
+ from typing import AnyStr, Literal, overload
14
15
 
15
16
  from ..base import AiofilesContextManager
16
17
  from ..threadpool.binary import AsyncBufferedIOBase, AsyncBufferedReader, AsyncFileIO
17
18
  from ..threadpool.text import AsyncTextIOWrapper
18
19
  from .temptypes import AsyncTemporaryDirectory
19
20
 
20
- _T_co = TypeVar("_T_co", covariant=True)
21
- _V_co = TypeVar("_V_co", covariant=True)
22
- _T_contra = TypeVar("_T_contra", contravariant=True)
23
-
24
- # Text mode: always returns AsyncTextIOWrapper
25
- @overload
26
- def NamedTemporaryFile(
27
- mode: OpenTextMode,
28
- buffering: int = -1,
29
- encoding: str | None = None,
30
- newline: str | None = None,
31
- suffix: AnyStr | None = None,
32
- prefix: AnyStr | None = None,
33
- dir: StrOrBytesPath | None = None,
34
- delete: bool = True,
35
- loop: AbstractEventLoop | None = None,
36
- executor: Incomplete | None = None,
37
- ) -> AiofilesContextManager[None, None, AsyncTextIOWrapper]: ...
38
-
39
- # Unbuffered binary: returns a FileIO
40
- @overload
41
- def NamedTemporaryFile(
42
- mode: OpenBinaryMode,
43
- buffering: Literal[0],
44
- encoding: None = None,
45
- newline: None = None,
46
- suffix: AnyStr | None = None,
47
- prefix: AnyStr | None = None,
48
- dir: StrOrBytesPath | None = None,
49
- delete: bool = True,
50
- loop: AbstractEventLoop | None = None,
51
- executor: Incomplete | None = None,
52
- ) -> AiofilesContextManager[None, None, AsyncFileIO]: ...
53
-
54
- # Buffered binary reading/updating: AsyncBufferedReader
55
- @overload
56
- def NamedTemporaryFile(
57
- mode: OpenBinaryModeReading | OpenBinaryModeUpdating = "w+b",
58
- buffering: Literal[-1, 1] = -1,
59
- encoding: None = None,
60
- newline: None = None,
61
- suffix: AnyStr | None = None,
62
- prefix: AnyStr | None = None,
63
- dir: StrOrBytesPath | None = None,
64
- delete: bool = True,
65
- loop: AbstractEventLoop | None = None,
66
- executor: Incomplete | None = None,
67
- ) -> AiofilesContextManager[None, None, AsyncBufferedReader]: ...
68
-
69
- # Buffered binary writing: AsyncBufferedIOBase
70
- @overload
71
- def NamedTemporaryFile(
72
- mode: OpenBinaryModeWriting,
73
- buffering: Literal[-1, 1] = -1,
74
- encoding: None = None,
75
- newline: None = None,
76
- suffix: AnyStr | None = None,
77
- prefix: AnyStr | None = None,
78
- dir: StrOrBytesPath | None = None,
79
- delete: bool = True,
80
- loop: AbstractEventLoop | None = None,
81
- executor: Incomplete | None = None,
82
- ) -> AiofilesContextManager[None, None, AsyncBufferedIOBase]: ...
83
-
84
21
  # Text mode: always returns AsyncTextIOWrapper
85
22
  @overload
86
23
  def TemporaryFile(
@@ -93,7 +30,7 @@ def TemporaryFile(
93
30
  dir: StrOrBytesPath | None = None,
94
31
  loop: AbstractEventLoop | None = None,
95
32
  executor: Incomplete | None = None,
96
- ) -> AiofilesContextManager[None, None, AsyncTextIOWrapper]: ...
33
+ ) -> AiofilesContextManager[AsyncTextIOWrapper]: ...
97
34
 
98
35
  # Unbuffered binary: returns a FileIO
99
36
  @overload
@@ -107,7 +44,7 @@ def TemporaryFile(
107
44
  dir: StrOrBytesPath | None = None,
108
45
  loop: AbstractEventLoop | None = None,
109
46
  executor: Incomplete | None = None,
110
- ) -> AiofilesContextManager[None, None, AsyncFileIO]: ...
47
+ ) -> AiofilesContextManager[AsyncFileIO]: ...
111
48
 
112
49
  # Buffered binary reading/updating: AsyncBufferedReader
113
50
  @overload
@@ -121,7 +58,7 @@ def TemporaryFile(
121
58
  dir: StrOrBytesPath | None = None,
122
59
  loop: AbstractEventLoop | None = None,
123
60
  executor: Incomplete | None = None,
124
- ) -> AiofilesContextManager[None, None, AsyncBufferedReader]: ...
61
+ ) -> AiofilesContextManager[AsyncBufferedReader]: ...
125
62
 
126
63
  # Buffered binary writing: AsyncBufferedIOBase
127
64
  @overload
@@ -135,7 +72,134 @@ def TemporaryFile(
135
72
  dir: StrOrBytesPath | None = None,
136
73
  loop: AbstractEventLoop | None = None,
137
74
  executor: Incomplete | None = None,
138
- ) -> AiofilesContextManager[None, None, AsyncBufferedIOBase]: ...
75
+ ) -> AiofilesContextManager[AsyncBufferedIOBase]: ...
76
+
77
+ # 3.12 added `delete_on_close`
78
+ if sys.version_info >= (3, 12):
79
+ # Text mode: always returns AsyncTextIOWrapper
80
+ @overload
81
+ def NamedTemporaryFile(
82
+ mode: OpenTextMode,
83
+ buffering: int = -1,
84
+ encoding: str | None = None,
85
+ newline: str | None = None,
86
+ suffix: AnyStr | None = None,
87
+ prefix: AnyStr | None = None,
88
+ dir: StrOrBytesPath | None = None,
89
+ delete: bool = True,
90
+ delete_on_close: bool = True,
91
+ loop: AbstractEventLoop | None = None,
92
+ executor: Incomplete | None = None,
93
+ ) -> AiofilesContextManager[AsyncTextIOWrapper]: ...
94
+
95
+ # Unbuffered binary: returns a FileIO
96
+ @overload
97
+ def NamedTemporaryFile(
98
+ mode: OpenBinaryMode,
99
+ buffering: Literal[0],
100
+ encoding: None = None,
101
+ newline: None = None,
102
+ suffix: AnyStr | None = None,
103
+ prefix: AnyStr | None = None,
104
+ dir: StrOrBytesPath | None = None,
105
+ delete: bool = True,
106
+ delete_on_close: bool = True,
107
+ loop: AbstractEventLoop | None = None,
108
+ executor: Incomplete | None = None,
109
+ ) -> AiofilesContextManager[AsyncFileIO]: ...
110
+
111
+ # Buffered binary reading/updating: AsyncBufferedReader
112
+ @overload
113
+ def NamedTemporaryFile(
114
+ mode: OpenBinaryModeReading | OpenBinaryModeUpdating = "w+b",
115
+ buffering: Literal[-1, 1] = -1,
116
+ encoding: None = None,
117
+ newline: None = None,
118
+ suffix: AnyStr | None = None,
119
+ prefix: AnyStr | None = None,
120
+ dir: StrOrBytesPath | None = None,
121
+ delete: bool = True,
122
+ delete_on_close: bool = True,
123
+ loop: AbstractEventLoop | None = None,
124
+ executor: Incomplete | None = None,
125
+ ) -> AiofilesContextManager[AsyncBufferedReader]: ...
126
+
127
+ # Buffered binary writing: AsyncBufferedIOBase
128
+ @overload
129
+ def NamedTemporaryFile(
130
+ mode: OpenBinaryModeWriting,
131
+ buffering: Literal[-1, 1] = -1,
132
+ encoding: None = None,
133
+ newline: None = None,
134
+ suffix: AnyStr | None = None,
135
+ prefix: AnyStr | None = None,
136
+ dir: StrOrBytesPath | None = None,
137
+ delete: bool = True,
138
+ delete_on_close: bool = True,
139
+ loop: AbstractEventLoop | None = None,
140
+ executor: Incomplete | None = None,
141
+ ) -> AiofilesContextManager[AsyncBufferedIOBase]: ...
142
+
143
+ else:
144
+ # Text mode: always returns AsyncTextIOWrapper
145
+ @overload
146
+ def NamedTemporaryFile(
147
+ mode: OpenTextMode,
148
+ buffering: int = -1,
149
+ encoding: str | None = None,
150
+ newline: str | None = None,
151
+ suffix: AnyStr | None = None,
152
+ prefix: AnyStr | None = None,
153
+ dir: StrOrBytesPath | None = None,
154
+ delete: bool = True,
155
+ loop: AbstractEventLoop | None = None,
156
+ executor: Incomplete | None = None,
157
+ ) -> AiofilesContextManager[AsyncTextIOWrapper]: ...
158
+
159
+ # Unbuffered binary: returns a FileIO
160
+ @overload
161
+ def NamedTemporaryFile(
162
+ mode: OpenBinaryMode,
163
+ buffering: Literal[0],
164
+ encoding: None = None,
165
+ newline: None = None,
166
+ suffix: AnyStr | None = None,
167
+ prefix: AnyStr | None = None,
168
+ dir: StrOrBytesPath | None = None,
169
+ delete: bool = True,
170
+ loop: AbstractEventLoop | None = None,
171
+ executor: Incomplete | None = None,
172
+ ) -> AiofilesContextManager[AsyncFileIO]: ...
173
+
174
+ # Buffered binary reading/updating: AsyncBufferedReader
175
+ @overload
176
+ def NamedTemporaryFile(
177
+ mode: OpenBinaryModeReading | OpenBinaryModeUpdating = "w+b",
178
+ buffering: Literal[-1, 1] = -1,
179
+ encoding: None = None,
180
+ newline: None = None,
181
+ suffix: AnyStr | None = None,
182
+ prefix: AnyStr | None = None,
183
+ dir: StrOrBytesPath | None = None,
184
+ delete: bool = True,
185
+ loop: AbstractEventLoop | None = None,
186
+ executor: Incomplete | None = None,
187
+ ) -> AiofilesContextManager[AsyncBufferedReader]: ...
188
+
189
+ # Buffered binary writing: AsyncBufferedIOBase
190
+ @overload
191
+ def NamedTemporaryFile(
192
+ mode: OpenBinaryModeWriting,
193
+ buffering: Literal[-1, 1] = -1,
194
+ encoding: None = None,
195
+ newline: None = None,
196
+ suffix: AnyStr | None = None,
197
+ prefix: AnyStr | None = None,
198
+ dir: StrOrBytesPath | None = None,
199
+ delete: bool = True,
200
+ loop: AbstractEventLoop | None = None,
201
+ executor: Incomplete | None = None,
202
+ ) -> AiofilesContextManager[AsyncBufferedIOBase]: ...
139
203
 
140
204
  # Text mode: always returns AsyncTextIOWrapper
141
205
  @overload
@@ -151,7 +215,7 @@ def SpooledTemporaryFile(
151
215
  dir: StrOrBytesPath | None = None,
152
216
  loop: AbstractEventLoop | None = None,
153
217
  executor: Incomplete | None = None,
154
- ) -> AiofilesContextManager[None, None, AsyncTextIOWrapper]: ...
218
+ ) -> AiofilesContextManager[AsyncTextIOWrapper]: ...
155
219
  @overload
156
220
  def SpooledTemporaryFile(
157
221
  max_size: int,
@@ -164,7 +228,7 @@ def SpooledTemporaryFile(
164
228
  dir: StrOrBytesPath | None = None,
165
229
  loop: AbstractEventLoop | None = None,
166
230
  executor: Incomplete | None = None,
167
- ) -> AiofilesContextManager[None, None, AsyncTextIOWrapper]: ...
231
+ ) -> AiofilesContextManager[AsyncTextIOWrapper]: ...
168
232
 
169
233
  # Unbuffered binary: returns a FileIO
170
234
  @overload
@@ -180,7 +244,7 @@ def SpooledTemporaryFile(
180
244
  dir: StrOrBytesPath | None = None,
181
245
  loop: AbstractEventLoop | None = None,
182
246
  executor: Incomplete | None = None,
183
- ) -> AiofilesContextManager[None, None, AsyncFileIO]: ...
247
+ ) -> AiofilesContextManager[AsyncFileIO]: ...
184
248
  @overload
185
249
  def SpooledTemporaryFile(
186
250
  max_size: int,
@@ -193,7 +257,7 @@ def SpooledTemporaryFile(
193
257
  dir: StrOrBytesPath | None = None,
194
258
  loop: AbstractEventLoop | None = None,
195
259
  executor: Incomplete | None = None,
196
- ) -> AiofilesContextManager[None, None, AsyncFileIO]: ...
260
+ ) -> AiofilesContextManager[AsyncFileIO]: ...
197
261
 
198
262
  # Buffered binary reading/updating: AsyncBufferedReader
199
263
  @overload
@@ -208,7 +272,7 @@ def SpooledTemporaryFile(
208
272
  dir: StrOrBytesPath | None = None,
209
273
  loop: AbstractEventLoop | None = None,
210
274
  executor: Incomplete | None = None,
211
- ) -> AiofilesContextManager[None, None, AsyncBufferedReader]: ...
275
+ ) -> AiofilesContextManager[AsyncBufferedReader]: ...
212
276
 
213
277
  # Buffered binary writing: AsyncBufferedIOBase
214
278
  @overload
@@ -224,7 +288,7 @@ def SpooledTemporaryFile(
224
288
  dir: StrOrBytesPath | None = None,
225
289
  loop: AbstractEventLoop | None = None,
226
290
  executor: Incomplete | None = None,
227
- ) -> AiofilesContextManager[None, None, AsyncBufferedIOBase]: ...
291
+ ) -> AiofilesContextManager[AsyncBufferedIOBase]: ...
228
292
  @overload
229
293
  def SpooledTemporaryFile(
230
294
  max_size: int,
@@ -237,7 +301,7 @@ def SpooledTemporaryFile(
237
301
  dir: StrOrBytesPath | None = None,
238
302
  loop: AbstractEventLoop | None = None,
239
303
  executor: Incomplete | None = None,
240
- ) -> AiofilesContextManager[None, None, AsyncBufferedIOBase]: ...
304
+ ) -> AiofilesContextManager[AsyncBufferedIOBase]: ...
241
305
  @overload
242
306
  def TemporaryDirectory(
243
307
  suffix: str | None = None,
@@ -245,7 +309,7 @@ def TemporaryDirectory(
245
309
  dir: StrPath | None = None,
246
310
  loop: AbstractEventLoop | None = None,
247
311
  executor: Incomplete | None = None,
248
- ) -> AiofilesContextManagerTempDir[None, None, AsyncTemporaryDirectory]: ...
312
+ ) -> AiofilesContextManagerTempDir: ...
249
313
  @overload
250
314
  def TemporaryDirectory(
251
315
  suffix: bytes | None = None,
@@ -253,7 +317,7 @@ def TemporaryDirectory(
253
317
  dir: BytesPath | None = None,
254
318
  loop: AbstractEventLoop | None = None,
255
319
  executor: Incomplete | None = None,
256
- ) -> AiofilesContextManagerTempDir[None, None, AsyncTemporaryDirectory]: ...
320
+ ) -> AiofilesContextManagerTempDir: ...
257
321
 
258
- class AiofilesContextManagerTempDir(AiofilesContextManager[_T_co, _T_contra, _V_co]):
322
+ class AiofilesContextManagerTempDir(AiofilesContextManager[AsyncTemporaryDirectory]):
259
323
  async def __aenter__(self) -> str: ... # type: ignore[override]
@@ -32,7 +32,7 @@ def open(
32
32
  *,
33
33
  loop: AbstractEventLoop | None = None,
34
34
  executor: Incomplete | None = None,
35
- ) -> AiofilesContextManager[None, None, AsyncTextIOWrapper]: ...
35
+ ) -> AiofilesContextManager[AsyncTextIOWrapper]: ...
36
36
 
37
37
  # Unbuffered binary: returns a FileIO
38
38
  @overload
@@ -48,7 +48,7 @@ def open(
48
48
  *,
49
49
  loop: AbstractEventLoop | None = None,
50
50
  executor: Incomplete | None = None,
51
- ) -> AiofilesContextManager[None, None, AsyncFileIO]: ...
51
+ ) -> AiofilesContextManager[AsyncFileIO]: ...
52
52
 
53
53
  # Buffered binary reading/updating: AsyncBufferedReader
54
54
  @overload
@@ -64,7 +64,7 @@ def open(
64
64
  *,
65
65
  loop: AbstractEventLoop | None = None,
66
66
  executor: Incomplete | None = None,
67
- ) -> AiofilesContextManager[None, None, AsyncBufferedReader]: ...
67
+ ) -> AiofilesContextManager[AsyncBufferedReader]: ...
68
68
 
69
69
  # Buffered binary writing: AsyncBufferedIOBase
70
70
  @overload
@@ -80,7 +80,7 @@ def open(
80
80
  *,
81
81
  loop: AbstractEventLoop | None = None,
82
82
  executor: Incomplete | None = None,
83
- ) -> AiofilesContextManager[None, None, AsyncBufferedIOBase]: ...
83
+ ) -> AiofilesContextManager[AsyncBufferedIOBase]: ...
84
84
 
85
85
  # Buffering cannot be determined: fall back to _UnknownAsyncBinaryIO
86
86
  @overload
@@ -96,7 +96,7 @@ def open(
96
96
  *,
97
97
  loop: AbstractEventLoop | None = None,
98
98
  executor: Incomplete | None = None,
99
- ) -> AiofilesContextManager[None, None, _UnknownAsyncBinaryIO]: ...
99
+ ) -> AiofilesContextManager[_UnknownAsyncBinaryIO]: ...
100
100
 
101
101
  stdin: AsyncTextIndirectIOWrapper
102
102
  stdout: AsyncTextIndirectIOWrapper
@@ -1,7 +1,13 @@
1
+ from collections.abc import Callable, Iterable as _Iterable, Mapping
1
2
  from typing import Any
2
3
  from typing_extensions import Self
3
4
 
4
5
  __tracebackhide__: bool
5
6
 
6
7
  class ExtractingMixin:
7
- def extracting(self, *names: Any, **kwargs: dict[str, Any]) -> Self: ...
8
+ def extracting(
9
+ self,
10
+ *names: str,
11
+ filter: str | Mapping[str, Any] | Callable[[Any], bool],
12
+ sort: str | _Iterable[str] | Callable[[Any], Any],
13
+ ) -> Self: ...
@@ -0,0 +1,8 @@
1
+ # Internal-use module for types shared by multiple modules.
2
+ # This does not match a module in docker-py.
3
+
4
+ from typing_extensions import TypeAlias
5
+
6
+ # Type alias for JSON, explained at:
7
+ # https://github.com/python/typing/issues/182#issuecomment-1320974824.
8
+ JSON: TypeAlias = dict[str, JSON] | list[JSON] | str | int | float | bool | None
@@ -154,10 +154,10 @@ class ContainerApiMixin:
154
154
  def rename(self, container: _Container, name: str) -> None: ...
155
155
  def resize(self, container: _Container, height: int, width: int) -> None: ...
156
156
  def restart(self, container: _Container, timeout: int = 10) -> None: ...
157
- def start(self, container: _Container, *args, **kwargs) -> None: ...
157
+ def start(self, container: _Container) -> None: ...
158
158
  def stats(self, container: _Container, decode: bool | None = None, stream: bool = True, one_shot: bool | None = None): ...
159
159
  def stop(self, container: _Container, timeout: int | None = None) -> None: ...
160
- def top(self, container: _Container, ps_args: str | None = None): ...
160
+ def top(self, container: _Container, ps_args: str | None = None) -> str: ...
161
161
  def unpause(self, container: _Container) -> None: ...
162
162
  def update_container(
163
163
  self,
@@ -1,4 +1,5 @@
1
1
  from _typeshed import Incomplete
2
+ from typing import Any
2
3
 
3
4
  log: Incomplete
4
5
 
@@ -39,9 +40,9 @@ class ImageApiMixin:
39
40
  repository: str,
40
41
  tag: str | None = None,
41
42
  stream: bool = False,
42
- auth_config: Incomplete | None = None,
43
+ auth_config: dict[str, Any] | None = None,
43
44
  decode: bool = False,
44
- platform: Incomplete | None = None,
45
+ platform: str | None = None,
45
46
  all_tags: bool = False,
46
47
  ): ...
47
48
  def push(
@@ -1,28 +1,45 @@
1
1
  from _typeshed import Incomplete
2
+ from typing import Any, Literal, TypedDict, type_check_only
3
+ from typing_extensions import TypeAlias
4
+
5
+ from docker.types import IPAMConfig
6
+
7
+ @type_check_only
8
+ class _HasId(TypedDict):
9
+ Id: str
10
+
11
+ @type_check_only
12
+ class _HasID(TypedDict):
13
+ ID: str
14
+
15
+ _Network: TypeAlias = _HasId | _HasID | str
16
+ _Container: TypeAlias = _HasId | _HasID | str
2
17
 
3
18
  class NetworkApiMixin:
4
19
  def networks(self, names: Incomplete | None = None, ids: Incomplete | None = None, filters: Incomplete | None = None): ...
5
20
  def create_network(
6
21
  self,
7
- name,
8
- driver: Incomplete | None = None,
9
- options: Incomplete | None = None,
10
- ipam: Incomplete | None = None,
11
- check_duplicate: Incomplete | None = None,
22
+ name: str,
23
+ driver: str | None = None,
24
+ options: dict[str, Any] | None = None,
25
+ ipam: IPAMConfig | None = None,
26
+ check_duplicate: bool | None = None,
12
27
  internal: bool = False,
13
- labels: Incomplete | None = None,
28
+ labels: dict[str, Any] | None = None,
14
29
  enable_ipv6: bool = False,
15
- attachable: Incomplete | None = None,
16
- scope: Incomplete | None = None,
17
- ingress: Incomplete | None = None,
18
- ): ...
30
+ attachable: bool | None = None,
31
+ scope: Literal["local", "global", "swarm"] | None = None,
32
+ ingress: bool | None = None,
33
+ ) -> dict[str, str]: ...
19
34
  def prune_networks(self, filters: Incomplete | None = None): ...
20
- def remove_network(self, net_id) -> None: ...
21
- def inspect_network(self, net_id, verbose: Incomplete | None = None, scope: Incomplete | None = None): ...
35
+ def remove_network(self, net_id: _Network) -> None: ...
36
+ def inspect_network(
37
+ self, net_id: _Network, verbose: bool | None = None, scope: Literal["local", "global", "swarm"] | None = None
38
+ ): ...
22
39
  def connect_container_to_network(
23
40
  self,
24
- container,
25
- net_id,
41
+ container: _Container,
42
+ net_id: str,
26
43
  ipv4_address: Incomplete | None = None,
27
44
  ipv6_address: Incomplete | None = None,
28
45
  aliases: Incomplete | None = None,
@@ -31,4 +48,4 @@ class NetworkApiMixin:
31
48
  driver_opt: Incomplete | None = None,
32
49
  mac_address: Incomplete | None = None,
33
50
  ) -> None: ...
34
- def disconnect_container_from_network(self, container, net_id, force: bool = False) -> None: ...
51
+ def disconnect_container_from_network(self, container: _Container, net_id: str, force: bool = False) -> None: ...
@@ -71,22 +71,37 @@ class Container(Model):
71
71
  follow: bool | None = None,
72
72
  until: datetime.datetime | float | None = None,
73
73
  ) -> bytes: ...
74
- def pause(self): ...
74
+ def pause(self) -> None: ...
75
75
  def put_archive(self, path: str, data) -> bool: ...
76
- def remove(self, **kwargs) -> None: ...
76
+ def remove(self, *, v: bool = False, link: bool = False, force: bool = False) -> None: ...
77
77
  def rename(self, name: str): ...
78
78
  def resize(self, height: int, width: int): ...
79
- def restart(self, **kwargs): ...
80
- def start(self, **kwargs) -> None: ...
79
+ def restart(self, *, timeout: float | None = 10): ...
80
+ def start(self) -> None: ...
81
81
  def stats(self, **kwargs): ...
82
82
  def stop(self, *, timeout: float | None = None) -> None: ...
83
- def top(self, **kwargs): ...
83
+ def top(self, *, ps_args: str | None = None) -> str: ...
84
84
  def unpause(self): ...
85
- def update(self, **kwargs): ...
85
+ def update(
86
+ self,
87
+ *,
88
+ blkio_weight: int | None = None,
89
+ cpu_period: int | None = None,
90
+ cpu_quota: int | None = None,
91
+ cpu_shares: int | None = None,
92
+ cpuset_cpus: str | None = None,
93
+ cpuset_mems: str | None = None,
94
+ mem_limit: float | str | None = None,
95
+ mem_reservation: float | str | None = None,
96
+ memswap_limit: int | str | None = None,
97
+ kernel_memory: int | str | None = None,
98
+ restart_policy: Incomplete | None = None,
99
+ ): ...
86
100
  def wait(self, *, timeout: float | None = None, condition: Literal["not-running", "next-exit", "removed"] | None = None): ...
87
101
 
88
102
  class ContainerCollection(Collection[Container]):
89
103
  model: type[Container]
104
+ @overload
90
105
  def run(
91
106
  self,
92
107
  image: str | Image,
@@ -94,8 +109,22 @@ class ContainerCollection(Collection[Container]):
94
109
  stdout: bool = True,
95
110
  stderr: bool = False,
96
111
  remove: bool = False,
112
+ *,
113
+ detach: Literal[False] = False,
97
114
  **kwargs,
98
- ): ...
115
+ ) -> bytes: ...
116
+ @overload
117
+ def run(
118
+ self,
119
+ image: str | Image,
120
+ command: str | list[str] | None = None,
121
+ stdout: bool = True,
122
+ stderr: bool = False,
123
+ remove: bool = False,
124
+ *,
125
+ detach: Literal[True],
126
+ **kwargs,
127
+ ) -> Container: ...
99
128
  def create(self, image: str, command: str | list[str] | None = None, **kwargs) -> Container: ... # type:ignore[override]
100
129
  def get(self, container_id: str) -> Container: ...
101
130
  def list(
@@ -1,11 +1,21 @@
1
1
  from collections.abc import Iterator
2
- from typing import Any, Literal, overload
2
+ from io import StringIO
3
+ from typing import IO, Any, Literal, TypedDict, overload, type_check_only
3
4
  from typing_extensions import TypeAlias
4
5
 
6
+ from docker._types import JSON
7
+
5
8
  from .resource import Collection, Model
6
9
 
7
10
  _ImageList: TypeAlias = list[Image] # To resolve conflicts with a method called "list"
8
11
 
12
+ @type_check_only
13
+ class _ContainerLimits(TypedDict, total=False):
14
+ memory: int
15
+ memswap: int
16
+ cpushares: int
17
+ cpusetcpus: str
18
+
9
19
  class Image(Model):
10
20
  @property
11
21
  def labels(self) -> dict[str, Any]: ...
@@ -31,17 +41,69 @@ class RegistryData(Model):
31
41
 
32
42
  class ImageCollection(Collection[Image]):
33
43
  model: type[Image]
34
- def build(self, **kwargs) -> tuple[Image, Iterator[Any]]: ...
44
+ def build(
45
+ self,
46
+ *,
47
+ path: str | None = None,
48
+ fileobj: StringIO | IO[bytes] | None = None,
49
+ tag: str | None = None,
50
+ quiet: bool = False,
51
+ nocache: bool = False,
52
+ rm: bool = False,
53
+ timeout: int | None = None,
54
+ custom_context: bool = False,
55
+ encoding: str | None = None,
56
+ pull: bool = False,
57
+ forcerm: bool = False,
58
+ dockerfile: str | None = None,
59
+ buildargs: dict[str, Any] | None = None,
60
+ container_limits: _ContainerLimits | None = None,
61
+ shmsize: int | None = None,
62
+ labels: dict[str, Any] | None = None,
63
+ # need to use list, because the type must be json serializable
64
+ cache_from: list[str] | None = None,
65
+ target: str | None = None,
66
+ network_mode: str | None = None,
67
+ squash: bool | None = None,
68
+ extra_hosts: list[str] | dict[str, str] | None = None,
69
+ platform: str | None = None,
70
+ isolation: str | None = None,
71
+ use_config_proxy: bool = True,
72
+ ) -> tuple[Image, Iterator[JSON]]: ...
35
73
  def get(self, name: str) -> Image: ...
36
74
  def get_registry_data(self, name, auth_config: dict[str, Any] | None = None) -> RegistryData: ...
37
75
  def list(self, name: str | None = None, all: bool = False, filters: dict[str, Any] | None = None) -> _ImageList: ...
38
76
  def load(self, data: bytes) -> _ImageList: ...
39
77
  @overload
40
- def pull(self, repository: str, tag: str | None = None, all_tags: Literal[False] = False, **kwargs) -> Image: ...
78
+ def pull(
79
+ self,
80
+ repository: str,
81
+ tag: str | None = None,
82
+ all_tags: Literal[False] = False,
83
+ *,
84
+ platform: str | None = None,
85
+ auth_config: dict[str, Any] | None = None,
86
+ ) -> Image: ...
41
87
  @overload
42
- def pull(self, repository: str, tag: str | None = None, *, all_tags: Literal[True], **kwargs) -> _ImageList: ...
88
+ def pull(
89
+ self,
90
+ repository: str,
91
+ tag: str | None = None,
92
+ *,
93
+ all_tags: Literal[True],
94
+ auth_config: dict[str, Any] | None = None,
95
+ platform: str | None = None,
96
+ ) -> _ImageList: ...
43
97
  @overload
44
- def pull(self, repository: str, tag: str | None, all_tags: Literal[True], **kwargs) -> _ImageList: ...
98
+ def pull(
99
+ self,
100
+ repository: str,
101
+ tag: str | None,
102
+ all_tags: Literal[True],
103
+ *,
104
+ auth_config: dict[str, Any] | None = None,
105
+ platform: str | None = None,
106
+ ) -> _ImageList: ...
45
107
  def push(self, repository: str, tag: str | None = None, **kwargs): ...
46
108
  def remove(self, *args, **kwargs) -> None: ...
47
109
  def search(self, *args, **kwargs): ...
@@ -1,4 +1,6 @@
1
- from typing import Any
1
+ from typing import Any, Literal
2
+
3
+ from docker.types import IPAMConfig
2
4
 
3
5
  from .containers import Container
4
6
  from .resource import Collection, Model
@@ -14,7 +16,22 @@ class Network(Model):
14
16
 
15
17
  class NetworkCollection(Collection[Network]):
16
18
  model: type[Network]
17
- def create(self, name: str, *args, **kwargs) -> Network: ... # type:ignore[override]
18
- def get(self, network_id: str, *args, **kwargs) -> Network: ... # type:ignore[override]
19
+ def create( # type:ignore[override]
20
+ self,
21
+ name: str,
22
+ driver: str | None = None,
23
+ options: dict[str, Any] | None = None,
24
+ ipam: IPAMConfig | None = None,
25
+ check_duplicate: bool | None = None,
26
+ internal: bool = False,
27
+ labels: dict[str, Any] | None = None,
28
+ enable_ipv6: bool = False,
29
+ attachable: bool | None = None,
30
+ scope: Literal["local", "global", "swarm"] | None = None,
31
+ ingress: bool | None = None,
32
+ ) -> Network: ...
33
+ def get(
34
+ self, network_id: str, verbose: bool | None = None, scope: Literal["local", "global", "swarm"] | None = None
35
+ ) -> Network: ... # type:ignore[override]
19
36
  def list(self, *args, **kwargs) -> list[Network]: ...
20
37
  def prune(self, filters: dict[str, Any] | None = None) -> dict[str, Any]: ...