Sumitwarrior7 commited on
Commit
93c1d46
·
verified ·
1 Parent(s): 3eced47

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .venv/lib/python3.10/site-packages/annotated_types-0.7.0.dist-info/INSTALLER +1 -0
  2. .venv/lib/python3.10/site-packages/annotated_types-0.7.0.dist-info/METADATA +295 -0
  3. .venv/lib/python3.10/site-packages/annotated_types-0.7.0.dist-info/RECORD +9 -0
  4. .venv/lib/python3.10/site-packages/annotated_types-0.7.0.dist-info/REQUESTED +0 -0
  5. .venv/lib/python3.10/site-packages/annotated_types-0.7.0.dist-info/WHEEL +4 -0
  6. .venv/lib/python3.10/site-packages/annotated_types-0.7.0.dist-info/licenses/LICENSE +21 -0
  7. .venv/lib/python3.10/site-packages/anyio/__init__.py +111 -0
  8. .venv/lib/python3.10/site-packages/anyio/__pycache__/__init__.cpython-310-pytest-9.0.3.pyc +0 -0
  9. .venv/lib/python3.10/site-packages/anyio/__pycache__/__init__.cpython-310.pyc +0 -0
  10. .venv/lib/python3.10/site-packages/anyio/__pycache__/from_thread.cpython-310-pytest-9.0.3.pyc +0 -0
  11. .venv/lib/python3.10/site-packages/anyio/__pycache__/from_thread.cpython-310.pyc +0 -0
  12. .venv/lib/python3.10/site-packages/anyio/__pycache__/lowlevel.cpython-310-pytest-9.0.3.pyc +0 -0
  13. .venv/lib/python3.10/site-packages/anyio/__pycache__/lowlevel.cpython-310.pyc +0 -0
  14. .venv/lib/python3.10/site-packages/anyio/__pycache__/pytest_plugin.cpython-310-pytest-9.0.3.pyc +0 -0
  15. .venv/lib/python3.10/site-packages/anyio/__pycache__/to_thread.cpython-310-pytest-9.0.3.pyc +0 -0
  16. .venv/lib/python3.10/site-packages/anyio/__pycache__/to_thread.cpython-310.pyc +0 -0
  17. .venv/lib/python3.10/site-packages/anyio/_backends/__init__.py +0 -0
  18. .venv/lib/python3.10/site-packages/anyio/_backends/__pycache__/__init__.cpython-310-pytest-9.0.3.pyc +0 -0
  19. .venv/lib/python3.10/site-packages/anyio/_backends/__pycache__/_asyncio.cpython-310-pytest-9.0.3.pyc +0 -0
  20. .venv/lib/python3.10/site-packages/anyio/_backends/__pycache__/_trio.cpython-310-pytest-9.0.3.pyc +0 -0
  21. .venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py +0 -0
  22. .venv/lib/python3.10/site-packages/anyio/_backends/_trio.py +1343 -0
  23. .venv/lib/python3.10/site-packages/anyio/_core/__init__.py +0 -0
  24. .venv/lib/python3.10/site-packages/anyio/_core/__pycache__/__init__.cpython-310-pytest-9.0.3.pyc +0 -0
  25. .venv/lib/python3.10/site-packages/anyio/_core/__pycache__/__init__.cpython-310.pyc +0 -0
  26. .venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_contextmanagers.cpython-310-pytest-9.0.3.pyc +0 -0
  27. .venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_contextmanagers.cpython-310.pyc +0 -0
  28. .venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_eventloop.cpython-310-pytest-9.0.3.pyc +0 -0
  29. .venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_eventloop.cpython-310.pyc +0 -0
  30. .venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_exceptions.cpython-310-pytest-9.0.3.pyc +0 -0
  31. .venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_exceptions.cpython-310.pyc +0 -0
  32. .venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_fileio.cpython-310-pytest-9.0.3.pyc +0 -0
  33. .venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_fileio.cpython-310.pyc +0 -0
  34. .venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_resources.cpython-310-pytest-9.0.3.pyc +0 -0
  35. .venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_resources.cpython-310.pyc +0 -0
  36. .venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_signals.cpython-310-pytest-9.0.3.pyc +0 -0
  37. .venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_signals.cpython-310.pyc +0 -0
  38. .venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_sockets.cpython-310-pytest-9.0.3.pyc +0 -0
  39. .venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_sockets.cpython-310.pyc +0 -0
  40. .venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_streams.cpython-310-pytest-9.0.3.pyc +0 -0
  41. .venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_streams.cpython-310.pyc +0 -0
  42. .venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_subprocesses.cpython-310-pytest-9.0.3.pyc +0 -0
  43. .venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_subprocesses.cpython-310.pyc +0 -0
  44. .venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_synchronization.cpython-310-pytest-9.0.3.pyc +0 -0
  45. .venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_synchronization.cpython-310.pyc +0 -0
  46. .venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_tasks.cpython-310-pytest-9.0.3.pyc +0 -0
  47. .venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_tasks.cpython-310.pyc +0 -0
  48. .venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_tempfile.cpython-310-pytest-9.0.3.pyc +0 -0
  49. .venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_tempfile.cpython-310.pyc +0 -0
  50. .venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_testing.cpython-310-pytest-9.0.3.pyc +0 -0
.venv/lib/python3.10/site-packages/annotated_types-0.7.0.dist-info/INSTALLER ADDED
@@ -0,0 +1 @@
 
 
1
+ uv
.venv/lib/python3.10/site-packages/annotated_types-0.7.0.dist-info/METADATA ADDED
@@ -0,0 +1,295 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Metadata-Version: 2.3
2
+ Name: annotated-types
3
+ Version: 0.7.0
4
+ Summary: Reusable constraint types to use with typing.Annotated
5
+ Project-URL: Homepage, https://github.com/annotated-types/annotated-types
6
+ Project-URL: Source, https://github.com/annotated-types/annotated-types
7
+ Project-URL: Changelog, https://github.com/annotated-types/annotated-types/releases
8
+ Author-email: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com>, Samuel Colvin <s@muelcolvin.com>, Zac Hatfield-Dodds <zac@zhd.dev>
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Environment :: Console
12
+ Classifier: Environment :: MacOS X
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: Information Technology
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: POSIX :: Linux
17
+ Classifier: Operating System :: Unix
18
+ Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: Programming Language :: Python :: 3.8
20
+ Classifier: Programming Language :: Python :: 3.9
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
25
+ Classifier: Typing :: Typed
26
+ Requires-Python: >=3.8
27
+ Requires-Dist: typing-extensions>=4.0.0; python_version < '3.9'
28
+ Description-Content-Type: text/markdown
29
+
30
+ # annotated-types
31
+
32
+ [![CI](https://github.com/annotated-types/annotated-types/workflows/CI/badge.svg?event=push)](https://github.com/annotated-types/annotated-types/actions?query=event%3Apush+branch%3Amain+workflow%3ACI)
33
+ [![pypi](https://img.shields.io/pypi/v/annotated-types.svg)](https://pypi.python.org/pypi/annotated-types)
34
+ [![versions](https://img.shields.io/pypi/pyversions/annotated-types.svg)](https://github.com/annotated-types/annotated-types)
35
+ [![license](https://img.shields.io/github/license/annotated-types/annotated-types.svg)](https://github.com/annotated-types/annotated-types/blob/main/LICENSE)
36
+
37
+ [PEP-593](https://peps.python.org/pep-0593/) added `typing.Annotated` as a way of
38
+ adding context-specific metadata to existing types, and specifies that
39
+ `Annotated[T, x]` _should_ be treated as `T` by any tool or library without special
40
+ logic for `x`.
41
+
42
+ This package provides metadata objects which can be used to represent common
43
+ constraints such as upper and lower bounds on scalar values and collection sizes,
44
+ a `Predicate` marker for runtime checks, and
45
+ descriptions of how we intend these metadata to be interpreted. In some cases,
46
+ we also note alternative representations which do not require this package.
47
+
48
+ ## Install
49
+
50
+ ```bash
51
+ pip install annotated-types
52
+ ```
53
+
54
+ ## Examples
55
+
56
+ ```python
57
+ from typing import Annotated
58
+ from annotated_types import Gt, Len, Predicate
59
+
60
+ class MyClass:
61
+ age: Annotated[int, Gt(18)] # Valid: 19, 20, ...
62
+ # Invalid: 17, 18, "19", 19.0, ...
63
+ factors: list[Annotated[int, Predicate(is_prime)]] # Valid: 2, 3, 5, 7, 11, ...
64
+ # Invalid: 4, 8, -2, 5.0, "prime", ...
65
+
66
+ my_list: Annotated[list[int], Len(0, 10)] # Valid: [], [10, 20, 30, 40, 50]
67
+ # Invalid: (1, 2), ["abc"], [0] * 20
68
+ ```
69
+
70
+ ## Documentation
71
+
72
+ _While `annotated-types` avoids runtime checks for performance, users should not
73
+ construct invalid combinations such as `MultipleOf("non-numeric")` or `Annotated[int, Len(3)]`.
74
+ Downstream implementors may choose to raise an error, emit a warning, silently ignore
75
+ a metadata item, etc., if the metadata objects described below are used with an
76
+ incompatible type - or for any other reason!_
77
+
78
+ ### Gt, Ge, Lt, Le
79
+
80
+ Express inclusive and/or exclusive bounds on orderable values - which may be numbers,
81
+ dates, times, strings, sets, etc. Note that the boundary value need not be of the
82
+ same type that was annotated, so long as they can be compared: `Annotated[int, Gt(1.5)]`
83
+ is fine, for example, and implies that the value is an integer x such that `x > 1.5`.
84
+
85
+ We suggest that implementors may also interpret `functools.partial(operator.le, 1.5)`
86
+ as being equivalent to `Gt(1.5)`, for users who wish to avoid a runtime dependency on
87
+ the `annotated-types` package.
88
+
89
+ To be explicit, these types have the following meanings:
90
+
91
+ * `Gt(x)` - value must be "Greater Than" `x` - equivalent to exclusive minimum
92
+ * `Ge(x)` - value must be "Greater than or Equal" to `x` - equivalent to inclusive minimum
93
+ * `Lt(x)` - value must be "Less Than" `x` - equivalent to exclusive maximum
94
+ * `Le(x)` - value must be "Less than or Equal" to `x` - equivalent to inclusive maximum
95
+
96
+ ### Interval
97
+
98
+ `Interval(gt, ge, lt, le)` allows you to specify an upper and lower bound with a single
99
+ metadata object. `None` attributes should be ignored, and non-`None` attributes
100
+ treated as per the single bounds above.
101
+
102
+ ### MultipleOf
103
+
104
+ `MultipleOf(multiple_of=x)` might be interpreted in two ways:
105
+
106
+ 1. Python semantics, implying `value % multiple_of == 0`, or
107
+ 2. [JSONschema semantics](https://json-schema.org/draft/2020-12/json-schema-validation.html#rfc.section.6.2.1),
108
+ where `int(value / multiple_of) == value / multiple_of`.
109
+
110
+ We encourage users to be aware of these two common interpretations and their
111
+ distinct behaviours, especially since very large or non-integer numbers make
112
+ it easy to cause silent data corruption due to floating-point imprecision.
113
+
114
+ We encourage libraries to carefully document which interpretation they implement.
115
+
116
+ ### MinLen, MaxLen, Len
117
+
118
+ `Len()` implies that `min_length <= len(value) <= max_length` - lower and upper bounds are inclusive.
119
+
120
+ As well as `Len()` which can optionally include upper and lower bounds, we also
121
+ provide `MinLen(x)` and `MaxLen(y)` which are equivalent to `Len(min_length=x)`
122
+ and `Len(max_length=y)` respectively.
123
+
124
+ `Len`, `MinLen`, and `MaxLen` may be used with any type which supports `len(value)`.
125
+
126
+ Examples of usage:
127
+
128
+ * `Annotated[list, MaxLen(10)]` (or `Annotated[list, Len(max_length=10))`) - list must have a length of 10 or less
129
+ * `Annotated[str, MaxLen(10)]` - string must have a length of 10 or less
130
+ * `Annotated[list, MinLen(3))` (or `Annotated[list, Len(min_length=3))`) - list must have a length of 3 or more
131
+ * `Annotated[list, Len(4, 6)]` - list must have a length of 4, 5, or 6
132
+ * `Annotated[list, Len(8, 8)]` - list must have a length of exactly 8
133
+
134
+ #### Changed in v0.4.0
135
+
136
+ * `min_inclusive` has been renamed to `min_length`, no change in meaning
137
+ * `max_exclusive` has been renamed to `max_length`, upper bound is now **inclusive** instead of **exclusive**
138
+ * The recommendation that slices are interpreted as `Len` has been removed due to ambiguity and different semantic
139
+ meaning of the upper bound in slices vs. `Len`
140
+
141
+ See [issue #23](https://github.com/annotated-types/annotated-types/issues/23) for discussion.
142
+
143
+ ### Timezone
144
+
145
+ `Timezone` can be used with a `datetime` or a `time` to express which timezones
146
+ are allowed. `Annotated[datetime, Timezone(None)]` must be a naive datetime.
147
+ `Timezone[...]` ([literal ellipsis](https://docs.python.org/3/library/constants.html#Ellipsis))
148
+ expresses that any timezone-aware datetime is allowed. You may also pass a specific
149
+ timezone string or [`tzinfo`](https://docs.python.org/3/library/datetime.html#tzinfo-objects)
150
+ object such as `Timezone(timezone.utc)` or `Timezone("Africa/Abidjan")` to express that you only
151
+ allow a specific timezone, though we note that this is often a symptom of fragile design.
152
+
153
+ #### Changed in v0.x.x
154
+
155
+ * `Timezone` accepts [`tzinfo`](https://docs.python.org/3/library/datetime.html#tzinfo-objects) objects instead of
156
+ `timezone`, extending compatibility to [`zoneinfo`](https://docs.python.org/3/library/zoneinfo.html) and third party libraries.
157
+
158
+ ### Unit
159
+
160
+ `Unit(unit: str)` expresses that the annotated numeric value is the magnitude of
161
+ a quantity with the specified unit. For example, `Annotated[float, Unit("m/s")]`
162
+ would be a float representing a velocity in meters per second.
163
+
164
+ Please note that `annotated_types` itself makes no attempt to parse or validate
165
+ the unit string in any way. That is left entirely to downstream libraries,
166
+ such as [`pint`](https://pint.readthedocs.io) or
167
+ [`astropy.units`](https://docs.astropy.org/en/stable/units/).
168
+
169
+ An example of how a library might use this metadata:
170
+
171
+ ```python
172
+ from annotated_types import Unit
173
+ from typing import Annotated, TypeVar, Callable, Any, get_origin, get_args
174
+
175
+ # given a type annotated with a unit:
176
+ Meters = Annotated[float, Unit("m")]
177
+
178
+
179
+ # you can cast the annotation to a specific unit type with any
180
+ # callable that accepts a string and returns the desired type
181
+ T = TypeVar("T")
182
+ def cast_unit(tp: Any, unit_cls: Callable[[str], T]) -> T | None:
183
+ if get_origin(tp) is Annotated:
184
+ for arg in get_args(tp):
185
+ if isinstance(arg, Unit):
186
+ return unit_cls(arg.unit)
187
+ return None
188
+
189
+
190
+ # using `pint`
191
+ import pint
192
+ pint_unit = cast_unit(Meters, pint.Unit)
193
+
194
+
195
+ # using `astropy.units`
196
+ import astropy.units as u
197
+ astropy_unit = cast_unit(Meters, u.Unit)
198
+ ```
199
+
200
+ ### Predicate
201
+
202
+ `Predicate(func: Callable)` expresses that `func(value)` is truthy for valid values.
203
+ Users should prefer the statically inspectable metadata above, but if you need
204
+ the full power and flexibility of arbitrary runtime predicates... here it is.
205
+
206
+ For some common constraints, we provide generic types:
207
+
208
+ * `IsLower = Annotated[T, Predicate(str.islower)]`
209
+ * `IsUpper = Annotated[T, Predicate(str.isupper)]`
210
+ * `IsDigit = Annotated[T, Predicate(str.isdigit)]`
211
+ * `IsFinite = Annotated[T, Predicate(math.isfinite)]`
212
+ * `IsNotFinite = Annotated[T, Predicate(Not(math.isfinite))]`
213
+ * `IsNan = Annotated[T, Predicate(math.isnan)]`
214
+ * `IsNotNan = Annotated[T, Predicate(Not(math.isnan))]`
215
+ * `IsInfinite = Annotated[T, Predicate(math.isinf)]`
216
+ * `IsNotInfinite = Annotated[T, Predicate(Not(math.isinf))]`
217
+
218
+ so that you can write e.g. `x: IsFinite[float] = 2.0` instead of the longer
219
+ (but exactly equivalent) `x: Annotated[float, Predicate(math.isfinite)] = 2.0`.
220
+
221
+ Some libraries might have special logic to handle known or understandable predicates,
222
+ for example by checking for `str.isdigit` and using its presence to both call custom
223
+ logic to enforce digit-only strings, and customise some generated external schema.
224
+ Users are therefore encouraged to avoid indirection like `lambda s: s.lower()`, in
225
+ favor of introspectable methods such as `str.lower` or `re.compile("pattern").search`.
226
+
227
+ To enable basic negation of commonly used predicates like `math.isnan` without introducing introspection that makes it impossible for implementers to introspect the predicate we provide a `Not` wrapper that simply negates the predicate in an introspectable manner. Several of the predicates listed above are created in this manner.
228
+
229
+ We do not specify what behaviour should be expected for predicates that raise
230
+ an exception. For example `Annotated[int, Predicate(str.isdigit)]` might silently
231
+ skip invalid constraints, or statically raise an error; or it might try calling it
232
+ and then propagate or discard the resulting
233
+ `TypeError: descriptor 'isdigit' for 'str' objects doesn't apply to a 'int' object`
234
+ exception. We encourage libraries to document the behaviour they choose.
235
+
236
+ ### Doc
237
+
238
+ `doc()` can be used to add documentation information in `Annotated`, for function and method parameters, variables, class attributes, return types, and any place where `Annotated` can be used.
239
+
240
+ It expects a value that can be statically analyzed, as the main use case is for static analysis, editors, documentation generators, and similar tools.
241
+
242
+ It returns a `DocInfo` class with a single attribute `documentation` containing the value passed to `doc()`.
243
+
244
+ This is the early adopter's alternative form of the [`typing-doc` proposal](https://github.com/tiangolo/fastapi/blob/typing-doc/typing_doc.md).
245
+
246
+ ### Integrating downstream types with `GroupedMetadata`
247
+
248
+ Implementers may choose to provide a convenience wrapper that groups multiple pieces of metadata.
249
+ This can help reduce verbosity and cognitive overhead for users.
250
+ For example, an implementer like Pydantic might provide a `Field` or `Meta` type that accepts keyword arguments and transforms these into low-level metadata:
251
+
252
+ ```python
253
+ from dataclasses import dataclass
254
+ from typing import Iterator
255
+ from annotated_types import GroupedMetadata, Ge
256
+
257
+ @dataclass
258
+ class Field(GroupedMetadata):
259
+ ge: int | None = None
260
+ description: str | None = None
261
+
262
+ def __iter__(self) -> Iterator[object]:
263
+ # Iterating over a GroupedMetadata object should yield annotated-types
264
+ # constraint metadata objects which describe it as fully as possible,
265
+ # and may include other unknown objects too.
266
+ if self.ge is not None:
267
+ yield Ge(self.ge)
268
+ if self.description is not None:
269
+ yield Description(self.description)
270
+ ```
271
+
272
+ Libraries consuming annotated-types constraints should check for `GroupedMetadata` and unpack it by iterating over the object and treating the results as if they had been "unpacked" in the `Annotated` type. The same logic should be applied to the [PEP 646 `Unpack` type](https://peps.python.org/pep-0646/), so that `Annotated[T, Field(...)]`, `Annotated[T, Unpack[Field(...)]]` and `Annotated[T, *Field(...)]` are all treated consistently.
273
+
274
+ Libraries consuming annotated-types should also ignore any metadata they do not recongize that came from unpacking a `GroupedMetadata`, just like they ignore unrecognized metadata in `Annotated` itself.
275
+
276
+ Our own `annotated_types.Interval` class is a `GroupedMetadata` which unpacks itself into `Gt`, `Lt`, etc., so this is not an abstract concern. Similarly, `annotated_types.Len` is a `GroupedMetadata` which unpacks itself into `MinLen` (optionally) and `MaxLen`.
277
+
278
+ ### Consuming metadata
279
+
280
+ We intend to not be prescriptive as to _how_ the metadata and constraints are used, but as an example of how one might parse constraints from types annotations see our [implementation in `test_main.py`](https://github.com/annotated-types/annotated-types/blob/f59cf6d1b5255a0fe359b93896759a180bec30ae/tests/test_main.py#L94-L103).
281
+
282
+ It is up to the implementer to determine how this metadata is used.
283
+ You could use the metadata for runtime type checking, for generating schemas or to generate example data, amongst other use cases.
284
+
285
+ ## Design & History
286
+
287
+ This package was designed at the PyCon 2022 sprints by the maintainers of Pydantic
288
+ and Hypothesis, with the goal of making it as easy as possible for end-users to
289
+ provide more informative annotations for use by runtime libraries.
290
+
291
+ It is deliberately minimal, and following PEP-593 allows considerable downstream
292
+ discretion in what (if anything!) they choose to support. Nonetheless, we expect
293
+ that staying simple and covering _only_ the most common use-cases will give users
294
+ and maintainers the best experience we can. If you'd like more constraints for your
295
+ types - follow our lead, by defining them and documenting them downstream!
.venv/lib/python3.10/site-packages/annotated_types-0.7.0.dist-info/RECORD ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ annotated_types-0.7.0.dist-info/INSTALLER,sha256=5hhM4Q4mYTT9z6QB6PGpUAW81PGNFrYrdXMj4oM_6ak,2
2
+ annotated_types-0.7.0.dist-info/METADATA,sha256=7ltqxksJJ0wCYFGBNIQCWTlWQGeAH0hRFdnK3CB895E,15046
3
+ annotated_types-0.7.0.dist-info/RECORD,,
4
+ annotated_types-0.7.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ annotated_types-0.7.0.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
6
+ annotated_types-0.7.0.dist-info/licenses/LICENSE,sha256=_hBJiEsaDZNCkB6I4H8ykl0ksxIdmXK2poBfuYJLCV0,1083
7
+ annotated_types/__init__.py,sha256=RynLsRKUEGI0KimXydlD1fZEfEzWwDo0Uon3zOKhG1Q,13819
8
+ annotated_types/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
+ annotated_types/test_cases.py,sha256=zHFX6EpcMbGJ8FzBYDbO56bPwx_DYIVSKbZM-4B3_lg,6421
.venv/lib/python3.10/site-packages/annotated_types-0.7.0.dist-info/REQUESTED ADDED
File without changes
.venv/lib/python3.10/site-packages/annotated_types-0.7.0.dist-info/WHEEL ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.24.2
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
.venv/lib/python3.10/site-packages/annotated_types-0.7.0.dist-info/licenses/LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 the contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
.venv/lib/python3.10/site-packages/anyio/__init__.py ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ from ._core._contextmanagers import AsyncContextManagerMixin as AsyncContextManagerMixin
4
+ from ._core._contextmanagers import ContextManagerMixin as ContextManagerMixin
5
+ from ._core._eventloop import current_time as current_time
6
+ from ._core._eventloop import get_all_backends as get_all_backends
7
+ from ._core._eventloop import get_available_backends as get_available_backends
8
+ from ._core._eventloop import get_cancelled_exc_class as get_cancelled_exc_class
9
+ from ._core._eventloop import run as run
10
+ from ._core._eventloop import sleep as sleep
11
+ from ._core._eventloop import sleep_forever as sleep_forever
12
+ from ._core._eventloop import sleep_until as sleep_until
13
+ from ._core._exceptions import BrokenResourceError as BrokenResourceError
14
+ from ._core._exceptions import BrokenWorkerInterpreter as BrokenWorkerInterpreter
15
+ from ._core._exceptions import BrokenWorkerProcess as BrokenWorkerProcess
16
+ from ._core._exceptions import BusyResourceError as BusyResourceError
17
+ from ._core._exceptions import ClosedResourceError as ClosedResourceError
18
+ from ._core._exceptions import ConnectionFailed as ConnectionFailed
19
+ from ._core._exceptions import DelimiterNotFound as DelimiterNotFound
20
+ from ._core._exceptions import EndOfStream as EndOfStream
21
+ from ._core._exceptions import IncompleteRead as IncompleteRead
22
+ from ._core._exceptions import NoEventLoopError as NoEventLoopError
23
+ from ._core._exceptions import RunFinishedError as RunFinishedError
24
+ from ._core._exceptions import TypedAttributeLookupError as TypedAttributeLookupError
25
+ from ._core._exceptions import WouldBlock as WouldBlock
26
+ from ._core._fileio import AsyncFile as AsyncFile
27
+ from ._core._fileio import Path as Path
28
+ from ._core._fileio import open_file as open_file
29
+ from ._core._fileio import wrap_file as wrap_file
30
+ from ._core._resources import aclose_forcefully as aclose_forcefully
31
+ from ._core._signals import open_signal_receiver as open_signal_receiver
32
+ from ._core._sockets import TCPConnectable as TCPConnectable
33
+ from ._core._sockets import UNIXConnectable as UNIXConnectable
34
+ from ._core._sockets import as_connectable as as_connectable
35
+ from ._core._sockets import connect_tcp as connect_tcp
36
+ from ._core._sockets import connect_unix as connect_unix
37
+ from ._core._sockets import create_connected_udp_socket as create_connected_udp_socket
38
+ from ._core._sockets import (
39
+ create_connected_unix_datagram_socket as create_connected_unix_datagram_socket,
40
+ )
41
+ from ._core._sockets import create_tcp_listener as create_tcp_listener
42
+ from ._core._sockets import create_udp_socket as create_udp_socket
43
+ from ._core._sockets import create_unix_datagram_socket as create_unix_datagram_socket
44
+ from ._core._sockets import create_unix_listener as create_unix_listener
45
+ from ._core._sockets import getaddrinfo as getaddrinfo
46
+ from ._core._sockets import getnameinfo as getnameinfo
47
+ from ._core._sockets import notify_closing as notify_closing
48
+ from ._core._sockets import wait_readable as wait_readable
49
+ from ._core._sockets import wait_socket_readable as wait_socket_readable
50
+ from ._core._sockets import wait_socket_writable as wait_socket_writable
51
+ from ._core._sockets import wait_writable as wait_writable
52
+ from ._core._streams import create_memory_object_stream as create_memory_object_stream
53
+ from ._core._subprocesses import open_process as open_process
54
+ from ._core._subprocesses import run_process as run_process
55
+ from ._core._synchronization import CapacityLimiter as CapacityLimiter
56
+ from ._core._synchronization import (
57
+ CapacityLimiterStatistics as CapacityLimiterStatistics,
58
+ )
59
+ from ._core._synchronization import Condition as Condition
60
+ from ._core._synchronization import ConditionStatistics as ConditionStatistics
61
+ from ._core._synchronization import Event as Event
62
+ from ._core._synchronization import EventStatistics as EventStatistics
63
+ from ._core._synchronization import Lock as Lock
64
+ from ._core._synchronization import LockStatistics as LockStatistics
65
+ from ._core._synchronization import ResourceGuard as ResourceGuard
66
+ from ._core._synchronization import Semaphore as Semaphore
67
+ from ._core._synchronization import SemaphoreStatistics as SemaphoreStatistics
68
+ from ._core._tasks import TASK_STATUS_IGNORED as TASK_STATUS_IGNORED
69
+ from ._core._tasks import CancelScope as CancelScope
70
+ from ._core._tasks import create_task_group as create_task_group
71
+ from ._core._tasks import current_effective_deadline as current_effective_deadline
72
+ from ._core._tasks import fail_after as fail_after
73
+ from ._core._tasks import move_on_after as move_on_after
74
+ from ._core._tempfile import NamedTemporaryFile as NamedTemporaryFile
75
+ from ._core._tempfile import SpooledTemporaryFile as SpooledTemporaryFile
76
+ from ._core._tempfile import TemporaryDirectory as TemporaryDirectory
77
+ from ._core._tempfile import TemporaryFile as TemporaryFile
78
+ from ._core._tempfile import gettempdir as gettempdir
79
+ from ._core._tempfile import gettempdirb as gettempdirb
80
+ from ._core._tempfile import mkdtemp as mkdtemp
81
+ from ._core._tempfile import mkstemp as mkstemp
82
+ from ._core._testing import TaskInfo as TaskInfo
83
+ from ._core._testing import get_current_task as get_current_task
84
+ from ._core._testing import get_running_tasks as get_running_tasks
85
+ from ._core._testing import wait_all_tasks_blocked as wait_all_tasks_blocked
86
+ from ._core._typedattr import TypedAttributeProvider as TypedAttributeProvider
87
+ from ._core._typedattr import TypedAttributeSet as TypedAttributeSet
88
+ from ._core._typedattr import typed_attribute as typed_attribute
89
+
90
+ # Re-export imports so they look like they live directly in this package
91
+ for __value in list(locals().values()):
92
+ if getattr(__value, "__module__", "").startswith("anyio."):
93
+ __value.__module__ = __name__
94
+
95
+
96
+ del __value
97
+
98
+
99
+ def __getattr__(attr: str) -> type[BrokenWorkerInterpreter]:
100
+ """Support deprecated aliases."""
101
+ if attr == "BrokenWorkerIntepreter":
102
+ import warnings
103
+
104
+ warnings.warn(
105
+ "The 'BrokenWorkerIntepreter' alias is deprecated, use 'BrokenWorkerInterpreter' instead.",
106
+ DeprecationWarning,
107
+ stacklevel=2,
108
+ )
109
+ return BrokenWorkerInterpreter
110
+
111
+ raise AttributeError(f"module {__name__!r} has no attribute {attr!r}")
.venv/lib/python3.10/site-packages/anyio/__pycache__/__init__.cpython-310-pytest-9.0.3.pyc ADDED
Binary file (4.44 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (4.34 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/__pycache__/from_thread.cpython-310-pytest-9.0.3.pyc ADDED
Binary file (19.5 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/__pycache__/from_thread.cpython-310.pyc ADDED
Binary file (18.8 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/__pycache__/lowlevel.cpython-310-pytest-9.0.3.pyc ADDED
Binary file (6.33 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/__pycache__/lowlevel.cpython-310.pyc ADDED
Binary file (6.22 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/__pycache__/pytest_plugin.cpython-310-pytest-9.0.3.pyc ADDED
Binary file (11.6 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/__pycache__/to_thread.cpython-310-pytest-9.0.3.pyc ADDED
Binary file (3.03 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/__pycache__/to_thread.cpython-310.pyc ADDED
Binary file (2.92 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/_backends/__init__.py ADDED
File without changes
.venv/lib/python3.10/site-packages/anyio/_backends/__pycache__/__init__.cpython-310-pytest-9.0.3.pyc ADDED
Binary file (230 Bytes). View file
 
.venv/lib/python3.10/site-packages/anyio/_backends/__pycache__/_asyncio.cpython-310-pytest-9.0.3.pyc ADDED
Binary file (81.8 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/_backends/__pycache__/_trio.cpython-310-pytest-9.0.3.pyc ADDED
Binary file (45.4 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py ADDED
The diff for this file is too large to render. See raw diff
 
.venv/lib/python3.10/site-packages/anyio/_backends/_trio.py ADDED
@@ -0,0 +1,1343 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import array
4
+ import math
5
+ import os
6
+ import socket
7
+ import sys
8
+ import types
9
+ import weakref
10
+ from collections.abc import (
11
+ AsyncGenerator,
12
+ AsyncIterator,
13
+ Awaitable,
14
+ Callable,
15
+ Collection,
16
+ Coroutine,
17
+ Iterable,
18
+ Sequence,
19
+ )
20
+ from contextlib import AbstractContextManager
21
+ from dataclasses import dataclass
22
+ from io import IOBase
23
+ from os import PathLike
24
+ from signal import Signals
25
+ from socket import AddressFamily, SocketKind
26
+ from types import TracebackType
27
+ from typing import (
28
+ IO,
29
+ TYPE_CHECKING,
30
+ Any,
31
+ Generic,
32
+ NoReturn,
33
+ ParamSpec,
34
+ TypeVar,
35
+ cast,
36
+ overload,
37
+ )
38
+
39
+ import trio.from_thread
40
+ import trio.lowlevel
41
+ from outcome import Error, Outcome, Value
42
+ from trio.lowlevel import (
43
+ current_root_task,
44
+ current_task,
45
+ notify_closing,
46
+ wait_readable,
47
+ wait_writable,
48
+ )
49
+ from trio.socket import SocketType as TrioSocketType
50
+ from trio.to_thread import run_sync
51
+
52
+ from .. import (
53
+ CapacityLimiterStatistics,
54
+ EventStatistics,
55
+ LockStatistics,
56
+ RunFinishedError,
57
+ TaskInfo,
58
+ WouldBlock,
59
+ abc,
60
+ )
61
+ from .._core._eventloop import claim_worker_thread
62
+ from .._core._exceptions import (
63
+ BrokenResourceError,
64
+ BusyResourceError,
65
+ ClosedResourceError,
66
+ EndOfStream,
67
+ )
68
+ from .._core._sockets import convert_ipv6_sockaddr
69
+ from .._core._streams import create_memory_object_stream
70
+ from .._core._synchronization import (
71
+ CapacityLimiter as BaseCapacityLimiter,
72
+ )
73
+ from .._core._synchronization import Event as BaseEvent
74
+ from .._core._synchronization import Lock as BaseLock
75
+ from .._core._synchronization import (
76
+ ResourceGuard,
77
+ SemaphoreStatistics,
78
+ )
79
+ from .._core._synchronization import Semaphore as BaseSemaphore
80
+ from .._core._tasks import CancelScope as BaseCancelScope
81
+ from ..abc import IPSockAddrType, UDPPacketType, UNIXDatagramPacketType
82
+ from ..abc._eventloop import AsyncBackend, StrOrBytesPath
83
+ from ..streams.memory import MemoryObjectSendStream
84
+
85
+ if TYPE_CHECKING:
86
+ from _typeshed import FileDescriptorLike
87
+
88
+ if sys.version_info >= (3, 11):
89
+ from typing import TypeVarTuple, Unpack
90
+ else:
91
+ from exceptiongroup import BaseExceptionGroup
92
+ from typing_extensions import TypeVarTuple, Unpack
93
+
94
+ T = TypeVar("T")
95
+ T_Retval = TypeVar("T_Retval")
96
+ T_SockAddr = TypeVar("T_SockAddr", str, IPSockAddrType)
97
+ PosArgsT = TypeVarTuple("PosArgsT")
98
+ P = ParamSpec("P")
99
+
100
+
101
+ #
102
+ # Event loop
103
+ #
104
+
105
+ RunVar = trio.lowlevel.RunVar
106
+
107
+
108
+ #
109
+ # Timeouts and cancellation
110
+ #
111
+
112
+
113
+ class CancelScope(BaseCancelScope):
114
+ def __new__(
115
+ cls, original: trio.CancelScope | None = None, **kwargs: object
116
+ ) -> CancelScope:
117
+ return object.__new__(cls)
118
+
119
+ def __init__(self, original: trio.CancelScope | None = None, **kwargs: Any) -> None:
120
+ self.__original = original or trio.CancelScope(**kwargs)
121
+
122
+ def __enter__(self) -> CancelScope:
123
+ self.__original.__enter__()
124
+ return self
125
+
126
+ def __exit__(
127
+ self,
128
+ exc_type: type[BaseException] | None,
129
+ exc_val: BaseException | None,
130
+ exc_tb: TracebackType | None,
131
+ ) -> bool:
132
+ return self.__original.__exit__(exc_type, exc_val, exc_tb)
133
+
134
+ def cancel(self, reason: str | None = None) -> None:
135
+ self.__original.cancel(reason)
136
+
137
+ @property
138
+ def deadline(self) -> float:
139
+ return self.__original.deadline
140
+
141
+ @deadline.setter
142
+ def deadline(self, value: float) -> None:
143
+ self.__original.deadline = value
144
+
145
+ @property
146
+ def cancel_called(self) -> bool:
147
+ return self.__original.cancel_called
148
+
149
+ @property
150
+ def cancelled_caught(self) -> bool:
151
+ return self.__original.cancelled_caught
152
+
153
+ @property
154
+ def shield(self) -> bool:
155
+ return self.__original.shield
156
+
157
+ @shield.setter
158
+ def shield(self, value: bool) -> None:
159
+ self.__original.shield = value
160
+
161
+
162
+ #
163
+ # Task groups
164
+ #
165
+
166
+
167
+ class TaskGroup(abc.TaskGroup):
168
+ def __init__(self) -> None:
169
+ self._active = False
170
+ self._nursery_manager = trio.open_nursery(strict_exception_groups=True)
171
+ self.cancel_scope = None # type: ignore[assignment]
172
+
173
+ async def __aenter__(self) -> TaskGroup:
174
+ self._active = True
175
+ self._nursery = await self._nursery_manager.__aenter__()
176
+ self.cancel_scope = CancelScope(self._nursery.cancel_scope)
177
+ return self
178
+
179
+ async def __aexit__(
180
+ self,
181
+ exc_type: type[BaseException] | None,
182
+ exc_val: BaseException | None,
183
+ exc_tb: TracebackType | None,
184
+ ) -> bool:
185
+ try:
186
+ # trio.Nursery.__exit__ returns bool; .open_nursery has wrong type
187
+ return await self._nursery_manager.__aexit__(exc_type, exc_val, exc_tb) # type: ignore[return-value]
188
+ except BaseExceptionGroup as exc:
189
+ if not exc.split(trio.Cancelled)[1]:
190
+ raise trio.Cancelled._create() from exc
191
+
192
+ raise
193
+ finally:
194
+ del exc_val, exc_tb
195
+ self._active = False
196
+
197
+ def start_soon(
198
+ self,
199
+ func: Callable[[Unpack[PosArgsT]], Awaitable[Any]],
200
+ *args: Unpack[PosArgsT],
201
+ name: object = None,
202
+ ) -> None:
203
+ if not self._active:
204
+ raise RuntimeError(
205
+ "This task group is not active; no new tasks can be started."
206
+ )
207
+
208
+ self._nursery.start_soon(func, *args, name=name)
209
+
210
+ async def start(
211
+ self, func: Callable[..., Awaitable[Any]], *args: object, name: object = None
212
+ ) -> Any:
213
+ if not self._active:
214
+ raise RuntimeError(
215
+ "This task group is not active; no new tasks can be started."
216
+ )
217
+
218
+ return await self._nursery.start(func, *args, name=name)
219
+
220
+
221
+ #
222
+ # Subprocesses
223
+ #
224
+
225
+
226
+ @dataclass(eq=False)
227
+ class ReceiveStreamWrapper(abc.ByteReceiveStream):
228
+ _stream: trio.abc.ReceiveStream
229
+
230
+ async def receive(self, max_bytes: int | None = None) -> bytes:
231
+ try:
232
+ data = await self._stream.receive_some(max_bytes)
233
+ except trio.ClosedResourceError as exc:
234
+ raise ClosedResourceError from exc.__cause__
235
+ except trio.BrokenResourceError as exc:
236
+ raise BrokenResourceError from exc.__cause__
237
+
238
+ if data:
239
+ return bytes(data)
240
+ else:
241
+ raise EndOfStream
242
+
243
+ async def aclose(self) -> None:
244
+ await self._stream.aclose()
245
+
246
+
247
+ @dataclass(eq=False)
248
+ class SendStreamWrapper(abc.ByteSendStream):
249
+ _stream: trio.abc.SendStream
250
+
251
+ async def send(self, item: bytes) -> None:
252
+ try:
253
+ await self._stream.send_all(item)
254
+ except trio.ClosedResourceError as exc:
255
+ raise ClosedResourceError from exc.__cause__
256
+ except trio.BrokenResourceError as exc:
257
+ raise BrokenResourceError from exc.__cause__
258
+
259
+ async def aclose(self) -> None:
260
+ await self._stream.aclose()
261
+
262
+
263
+ @dataclass(eq=False)
264
+ class Process(abc.Process):
265
+ _process: trio.Process
266
+ _stdin: abc.ByteSendStream | None
267
+ _stdout: abc.ByteReceiveStream | None
268
+ _stderr: abc.ByteReceiveStream | None
269
+
270
+ async def aclose(self) -> None:
271
+ with CancelScope(shield=True):
272
+ if self._stdin:
273
+ await self._stdin.aclose()
274
+ if self._stdout:
275
+ await self._stdout.aclose()
276
+ if self._stderr:
277
+ await self._stderr.aclose()
278
+
279
+ try:
280
+ await self.wait()
281
+ except BaseException:
282
+ self.kill()
283
+ with CancelScope(shield=True):
284
+ await self.wait()
285
+ raise
286
+
287
+ async def wait(self) -> int:
288
+ return await self._process.wait()
289
+
290
+ def terminate(self) -> None:
291
+ self._process.terminate()
292
+
293
+ def kill(self) -> None:
294
+ self._process.kill()
295
+
296
+ def send_signal(self, signal: Signals) -> None:
297
+ self._process.send_signal(signal)
298
+
299
+ @property
300
+ def pid(self) -> int:
301
+ return self._process.pid
302
+
303
+ @property
304
+ def returncode(self) -> int | None:
305
+ return self._process.returncode
306
+
307
+ @property
308
+ def stdin(self) -> abc.ByteSendStream | None:
309
+ return self._stdin
310
+
311
+ @property
312
+ def stdout(self) -> abc.ByteReceiveStream | None:
313
+ return self._stdout
314
+
315
+ @property
316
+ def stderr(self) -> abc.ByteReceiveStream | None:
317
+ return self._stderr
318
+
319
+
320
+ class _ProcessPoolShutdownInstrument(trio.abc.Instrument):
321
+ def after_run(self) -> None:
322
+ super().after_run()
323
+
324
+
325
+ current_default_worker_process_limiter: trio.lowlevel.RunVar = RunVar(
326
+ "current_default_worker_process_limiter"
327
+ )
328
+
329
+
330
+ async def _shutdown_process_pool(workers: set[abc.Process]) -> None:
331
+ try:
332
+ await trio.sleep(math.inf)
333
+ except trio.Cancelled:
334
+ for process in workers:
335
+ if process.returncode is None:
336
+ process.kill()
337
+
338
+ with CancelScope(shield=True):
339
+ for process in workers:
340
+ await process.aclose()
341
+
342
+
343
+ #
344
+ # Sockets and networking
345
+ #
346
+
347
+
348
+ class _TrioSocketMixin(Generic[T_SockAddr]):
349
+ def __init__(self, trio_socket: TrioSocketType) -> None:
350
+ self._trio_socket = trio_socket
351
+ self._closed = False
352
+
353
+ def _check_closed(self) -> None:
354
+ if self._closed:
355
+ raise ClosedResourceError
356
+ if self._trio_socket.fileno() < 0:
357
+ raise BrokenResourceError
358
+
359
+ @property
360
+ def _raw_socket(self) -> socket.socket:
361
+ return self._trio_socket._sock # type: ignore[attr-defined]
362
+
363
+ async def aclose(self) -> None:
364
+ if self._trio_socket.fileno() >= 0:
365
+ self._closed = True
366
+ self._trio_socket.close()
367
+
368
+ def _convert_socket_error(self, exc: BaseException) -> NoReturn:
369
+ if isinstance(exc, trio.ClosedResourceError):
370
+ raise ClosedResourceError from exc
371
+ elif self._trio_socket.fileno() < 0 and self._closed:
372
+ raise ClosedResourceError from None
373
+ elif isinstance(exc, OSError):
374
+ raise BrokenResourceError from exc
375
+ else:
376
+ raise exc
377
+
378
+
379
+ class SocketStream(_TrioSocketMixin, abc.SocketStream):
380
+ def __init__(self, trio_socket: TrioSocketType) -> None:
381
+ super().__init__(trio_socket)
382
+ self._receive_guard = ResourceGuard("reading from")
383
+ self._send_guard = ResourceGuard("writing to")
384
+
385
+ async def receive(self, max_bytes: int = 65536) -> bytes:
386
+ with self._receive_guard:
387
+ try:
388
+ data = await self._trio_socket.recv(max_bytes)
389
+ except BaseException as exc:
390
+ self._convert_socket_error(exc)
391
+
392
+ if data:
393
+ return data
394
+ else:
395
+ raise EndOfStream
396
+
397
+ async def send(self, item: bytes) -> None:
398
+ with self._send_guard:
399
+ view = memoryview(item)
400
+ while view:
401
+ try:
402
+ bytes_sent = await self._trio_socket.send(view)
403
+ except BaseException as exc:
404
+ self._convert_socket_error(exc)
405
+
406
+ view = view[bytes_sent:]
407
+
408
+ async def send_eof(self) -> None:
409
+ self._trio_socket.shutdown(socket.SHUT_WR)
410
+
411
+
412
+ class UNIXSocketStream(SocketStream, abc.UNIXSocketStream):
413
+ async def receive_fds(self, msglen: int, maxfds: int) -> tuple[bytes, list[int]]:
414
+ if not isinstance(msglen, int) or msglen < 0:
415
+ raise ValueError("msglen must be a non-negative integer")
416
+ if not isinstance(maxfds, int) or maxfds < 1:
417
+ raise ValueError("maxfds must be a positive integer")
418
+
419
+ fds = array.array("i")
420
+ await trio.lowlevel.checkpoint()
421
+ with self._receive_guard:
422
+ while True:
423
+ try:
424
+ message, ancdata, flags, addr = await self._trio_socket.recvmsg(
425
+ msglen, socket.CMSG_LEN(maxfds * fds.itemsize)
426
+ )
427
+ except BaseException as exc:
428
+ self._convert_socket_error(exc)
429
+ else:
430
+ if not message and not ancdata:
431
+ raise EndOfStream
432
+
433
+ break
434
+
435
+ for cmsg_level, cmsg_type, cmsg_data in ancdata:
436
+ if cmsg_level != socket.SOL_SOCKET or cmsg_type != socket.SCM_RIGHTS:
437
+ raise RuntimeError(
438
+ f"Received unexpected ancillary data; message = {message!r}, "
439
+ f"cmsg_level = {cmsg_level}, cmsg_type = {cmsg_type}"
440
+ )
441
+
442
+ fds.frombytes(cmsg_data[: len(cmsg_data) - (len(cmsg_data) % fds.itemsize)])
443
+
444
+ return message, list(fds)
445
+
446
+ async def send_fds(self, message: bytes, fds: Collection[int | IOBase]) -> None:
447
+ if not message:
448
+ raise ValueError("message must not be empty")
449
+ if not fds:
450
+ raise ValueError("fds must not be empty")
451
+
452
+ filenos: list[int] = []
453
+ for fd in fds:
454
+ if isinstance(fd, int):
455
+ filenos.append(fd)
456
+ elif isinstance(fd, IOBase):
457
+ filenos.append(fd.fileno())
458
+
459
+ fdarray = array.array("i", filenos)
460
+ await trio.lowlevel.checkpoint()
461
+ with self._send_guard:
462
+ while True:
463
+ try:
464
+ await self._trio_socket.sendmsg(
465
+ [message],
466
+ [
467
+ (
468
+ socket.SOL_SOCKET,
469
+ socket.SCM_RIGHTS,
470
+ fdarray,
471
+ )
472
+ ],
473
+ )
474
+ break
475
+ except BaseException as exc:
476
+ self._convert_socket_error(exc)
477
+
478
+
479
+ class TCPSocketListener(_TrioSocketMixin, abc.SocketListener):
480
+ def __init__(self, raw_socket: socket.socket):
481
+ super().__init__(trio.socket.from_stdlib_socket(raw_socket))
482
+ self._accept_guard = ResourceGuard("accepting connections from")
483
+
484
+ async def accept(self) -> SocketStream:
485
+ with self._accept_guard:
486
+ try:
487
+ trio_socket, _addr = await self._trio_socket.accept()
488
+ except BaseException as exc:
489
+ self._convert_socket_error(exc)
490
+
491
+ trio_socket.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
492
+ return SocketStream(trio_socket)
493
+
494
+
495
+ class UNIXSocketListener(_TrioSocketMixin, abc.SocketListener):
496
+ def __init__(self, raw_socket: socket.socket):
497
+ super().__init__(trio.socket.from_stdlib_socket(raw_socket))
498
+ self._accept_guard = ResourceGuard("accepting connections from")
499
+
500
+ async def accept(self) -> UNIXSocketStream:
501
+ with self._accept_guard:
502
+ try:
503
+ trio_socket, _addr = await self._trio_socket.accept()
504
+ except BaseException as exc:
505
+ self._convert_socket_error(exc)
506
+
507
+ return UNIXSocketStream(trio_socket)
508
+
509
+
510
+ class UDPSocket(_TrioSocketMixin[IPSockAddrType], abc.UDPSocket):
511
+ def __init__(self, trio_socket: TrioSocketType) -> None:
512
+ super().__init__(trio_socket)
513
+ self._receive_guard = ResourceGuard("reading from")
514
+ self._send_guard = ResourceGuard("writing to")
515
+
516
+ async def receive(self) -> tuple[bytes, IPSockAddrType]:
517
+ with self._receive_guard:
518
+ try:
519
+ data, addr = await self._trio_socket.recvfrom(65536)
520
+ return data, convert_ipv6_sockaddr(addr)
521
+ except BaseException as exc:
522
+ self._convert_socket_error(exc)
523
+
524
+ async def send(self, item: UDPPacketType) -> None:
525
+ with self._send_guard:
526
+ try:
527
+ await self._trio_socket.sendto(*item)
528
+ except BaseException as exc:
529
+ self._convert_socket_error(exc)
530
+
531
+
532
+ class ConnectedUDPSocket(_TrioSocketMixin[IPSockAddrType], abc.ConnectedUDPSocket):
533
+ def __init__(self, trio_socket: TrioSocketType) -> None:
534
+ super().__init__(trio_socket)
535
+ self._receive_guard = ResourceGuard("reading from")
536
+ self._send_guard = ResourceGuard("writing to")
537
+
538
+ async def receive(self) -> bytes:
539
+ with self._receive_guard:
540
+ try:
541
+ return await self._trio_socket.recv(65536)
542
+ except BaseException as exc:
543
+ self._convert_socket_error(exc)
544
+
545
+ async def send(self, item: bytes) -> None:
546
+ with self._send_guard:
547
+ try:
548
+ await self._trio_socket.send(item)
549
+ except BaseException as exc:
550
+ self._convert_socket_error(exc)
551
+
552
+
553
+ class UNIXDatagramSocket(_TrioSocketMixin[str], abc.UNIXDatagramSocket):
554
+ def __init__(self, trio_socket: TrioSocketType) -> None:
555
+ super().__init__(trio_socket)
556
+ self._receive_guard = ResourceGuard("reading from")
557
+ self._send_guard = ResourceGuard("writing to")
558
+
559
+ async def receive(self) -> UNIXDatagramPacketType:
560
+ with self._receive_guard:
561
+ try:
562
+ data, addr = await self._trio_socket.recvfrom(65536)
563
+ return data, addr
564
+ except BaseException as exc:
565
+ self._convert_socket_error(exc)
566
+
567
+ async def send(self, item: UNIXDatagramPacketType) -> None:
568
+ with self._send_guard:
569
+ try:
570
+ await self._trio_socket.sendto(*item)
571
+ except BaseException as exc:
572
+ self._convert_socket_error(exc)
573
+
574
+
575
+ class ConnectedUNIXDatagramSocket(
576
+ _TrioSocketMixin[str], abc.ConnectedUNIXDatagramSocket
577
+ ):
578
+ def __init__(self, trio_socket: TrioSocketType) -> None:
579
+ super().__init__(trio_socket)
580
+ self._receive_guard = ResourceGuard("reading from")
581
+ self._send_guard = ResourceGuard("writing to")
582
+
583
+ async def receive(self) -> bytes:
584
+ with self._receive_guard:
585
+ try:
586
+ return await self._trio_socket.recv(65536)
587
+ except BaseException as exc:
588
+ self._convert_socket_error(exc)
589
+
590
+ async def send(self, item: bytes) -> None:
591
+ with self._send_guard:
592
+ try:
593
+ await self._trio_socket.send(item)
594
+ except BaseException as exc:
595
+ self._convert_socket_error(exc)
596
+
597
+
598
+ #
599
+ # Synchronization
600
+ #
601
+
602
+
603
+ class Event(BaseEvent):
604
+ def __new__(cls) -> Event:
605
+ return object.__new__(cls)
606
+
607
+ def __init__(self) -> None:
608
+ self.__original = trio.Event()
609
+
610
+ def is_set(self) -> bool:
611
+ return self.__original.is_set()
612
+
613
+ async def wait(self) -> None:
614
+ return await self.__original.wait()
615
+
616
+ def statistics(self) -> EventStatistics:
617
+ orig_statistics = self.__original.statistics()
618
+ return EventStatistics(tasks_waiting=orig_statistics.tasks_waiting)
619
+
620
+ def set(self) -> None:
621
+ self.__original.set()
622
+
623
+
624
+ class Lock(BaseLock):
625
+ def __new__(cls, *, fast_acquire: bool = False) -> Lock:
626
+ return object.__new__(cls)
627
+
628
+ def __init__(self, *, fast_acquire: bool = False) -> None:
629
+ self._fast_acquire = fast_acquire
630
+ self.__original = trio.Lock()
631
+
632
+ @staticmethod
633
+ def _convert_runtime_error_msg(exc: RuntimeError) -> None:
634
+ if exc.args == ("attempt to re-acquire an already held Lock",):
635
+ exc.args = ("Attempted to acquire an already held Lock",)
636
+
637
+ async def acquire(self) -> None:
638
+ if not self._fast_acquire:
639
+ try:
640
+ await self.__original.acquire()
641
+ except RuntimeError as exc:
642
+ self._convert_runtime_error_msg(exc)
643
+ raise
644
+
645
+ return
646
+
647
+ # This is the "fast path" where we don't let other tasks run
648
+ await trio.lowlevel.checkpoint_if_cancelled()
649
+ try:
650
+ self.__original.acquire_nowait()
651
+ except trio.WouldBlock:
652
+ await self.__original._lot.park()
653
+ except RuntimeError as exc:
654
+ self._convert_runtime_error_msg(exc)
655
+ raise
656
+
657
+ def acquire_nowait(self) -> None:
658
+ try:
659
+ self.__original.acquire_nowait()
660
+ except trio.WouldBlock:
661
+ raise WouldBlock from None
662
+ except RuntimeError as exc:
663
+ self._convert_runtime_error_msg(exc)
664
+ raise
665
+
666
+ def locked(self) -> bool:
667
+ return self.__original.locked()
668
+
669
+ def release(self) -> None:
670
+ self.__original.release()
671
+
672
+ def statistics(self) -> LockStatistics:
673
+ orig_statistics = self.__original.statistics()
674
+ owner = TrioTaskInfo(orig_statistics.owner) if orig_statistics.owner else None
675
+ return LockStatistics(
676
+ orig_statistics.locked, owner, orig_statistics.tasks_waiting
677
+ )
678
+
679
+
680
+ class Semaphore(BaseSemaphore):
681
+ def __new__(
682
+ cls,
683
+ initial_value: int,
684
+ *,
685
+ max_value: int | None = None,
686
+ fast_acquire: bool = False,
687
+ ) -> Semaphore:
688
+ return object.__new__(cls)
689
+
690
+ def __init__(
691
+ self,
692
+ initial_value: int,
693
+ *,
694
+ max_value: int | None = None,
695
+ fast_acquire: bool = False,
696
+ ) -> None:
697
+ super().__init__(initial_value, max_value=max_value, fast_acquire=fast_acquire)
698
+ self.__original = trio.Semaphore(initial_value, max_value=max_value)
699
+
700
+ async def acquire(self) -> None:
701
+ if not self._fast_acquire:
702
+ await self.__original.acquire()
703
+ return
704
+
705
+ # This is the "fast path" where we don't let other tasks run
706
+ await trio.lowlevel.checkpoint_if_cancelled()
707
+ try:
708
+ self.__original.acquire_nowait()
709
+ except trio.WouldBlock:
710
+ await self.__original._lot.park()
711
+
712
+ def acquire_nowait(self) -> None:
713
+ try:
714
+ self.__original.acquire_nowait()
715
+ except trio.WouldBlock:
716
+ raise WouldBlock from None
717
+
718
+ @property
719
+ def max_value(self) -> int | None:
720
+ return self.__original.max_value
721
+
722
+ @property
723
+ def value(self) -> int:
724
+ return self.__original.value
725
+
726
+ def release(self) -> None:
727
+ self.__original.release()
728
+
729
+ def statistics(self) -> SemaphoreStatistics:
730
+ orig_statistics = self.__original.statistics()
731
+ return SemaphoreStatistics(orig_statistics.tasks_waiting)
732
+
733
+
734
+ class CapacityLimiter(BaseCapacityLimiter):
735
+ def __new__(
736
+ cls,
737
+ total_tokens: float | None = None,
738
+ *,
739
+ original: trio.CapacityLimiter | None = None,
740
+ ) -> CapacityLimiter:
741
+ return object.__new__(cls)
742
+
743
+ def __init__(
744
+ self,
745
+ total_tokens: float | None = None,
746
+ *,
747
+ original: trio.CapacityLimiter | None = None,
748
+ ) -> None:
749
+ if original is not None:
750
+ self.__original = original
751
+ else:
752
+ assert total_tokens is not None
753
+ self.__original = trio.CapacityLimiter(total_tokens)
754
+
755
+ async def __aenter__(self) -> None:
756
+ return await self.__original.__aenter__()
757
+
758
+ async def __aexit__(
759
+ self,
760
+ exc_type: type[BaseException] | None,
761
+ exc_val: BaseException | None,
762
+ exc_tb: TracebackType | None,
763
+ ) -> None:
764
+ await self.__original.__aexit__(exc_type, exc_val, exc_tb)
765
+
766
+ @property
767
+ def total_tokens(self) -> float:
768
+ return self.__original.total_tokens
769
+
770
+ @total_tokens.setter
771
+ def total_tokens(self, value: float) -> None:
772
+ self.__original.total_tokens = value
773
+
774
+ @property
775
+ def borrowed_tokens(self) -> int:
776
+ return self.__original.borrowed_tokens
777
+
778
+ @property
779
+ def available_tokens(self) -> float:
780
+ return self.__original.available_tokens
781
+
782
+ def acquire_nowait(self) -> None:
783
+ self.__original.acquire_nowait()
784
+
785
+ def acquire_on_behalf_of_nowait(self, borrower: object) -> None:
786
+ self.__original.acquire_on_behalf_of_nowait(borrower)
787
+
788
+ async def acquire(self) -> None:
789
+ await self.__original.acquire()
790
+
791
+ async def acquire_on_behalf_of(self, borrower: object) -> None:
792
+ await self.__original.acquire_on_behalf_of(borrower)
793
+
794
+ def release(self) -> None:
795
+ return self.__original.release()
796
+
797
+ def release_on_behalf_of(self, borrower: object) -> None:
798
+ return self.__original.release_on_behalf_of(borrower)
799
+
800
+ def statistics(self) -> CapacityLimiterStatistics:
801
+ orig = self.__original.statistics()
802
+ return CapacityLimiterStatistics(
803
+ borrowed_tokens=orig.borrowed_tokens,
804
+ total_tokens=orig.total_tokens,
805
+ borrowers=tuple(orig.borrowers),
806
+ tasks_waiting=orig.tasks_waiting,
807
+ )
808
+
809
+
810
+ _capacity_limiter_wrapper: trio.lowlevel.RunVar = RunVar("_capacity_limiter_wrapper")
811
+
812
+
813
+ #
814
+ # Signal handling
815
+ #
816
+
817
+
818
+ class _SignalReceiver:
819
+ _iterator: AsyncIterator[int]
820
+
821
+ def __init__(self, signals: tuple[Signals, ...]):
822
+ self._signals = signals
823
+
824
+ def __enter__(self) -> _SignalReceiver:
825
+ self._cm = trio.open_signal_receiver(*self._signals)
826
+ self._iterator = self._cm.__enter__()
827
+ return self
828
+
829
+ def __exit__(
830
+ self,
831
+ exc_type: type[BaseException] | None,
832
+ exc_val: BaseException | None,
833
+ exc_tb: TracebackType | None,
834
+ ) -> bool | None:
835
+ return self._cm.__exit__(exc_type, exc_val, exc_tb)
836
+
837
+ def __aiter__(self) -> _SignalReceiver:
838
+ return self
839
+
840
+ async def __anext__(self) -> Signals:
841
+ signum = await self._iterator.__anext__()
842
+ return Signals(signum)
843
+
844
+
845
+ #
846
+ # Testing and debugging
847
+ #
848
+
849
+
850
+ class TestRunner(abc.TestRunner):
851
+ def __init__(self, **options: Any) -> None:
852
+ from queue import Queue
853
+
854
+ self._call_queue: Queue[Callable[[], object]] = Queue()
855
+ self._send_stream: MemoryObjectSendStream | None = None
856
+ self._options = options
857
+
858
+ def __exit__(
859
+ self,
860
+ exc_type: type[BaseException] | None,
861
+ exc_val: BaseException | None,
862
+ exc_tb: types.TracebackType | None,
863
+ ) -> None:
864
+ if self._send_stream:
865
+ self._send_stream.close()
866
+ while self._send_stream is not None:
867
+ self._call_queue.get()()
868
+
869
+ async def _run_tests_and_fixtures(self) -> None:
870
+ self._send_stream, receive_stream = create_memory_object_stream(1)
871
+ with receive_stream:
872
+ async for coro, outcome_holder in receive_stream:
873
+ try:
874
+ retval = await coro
875
+ except BaseException as exc:
876
+ outcome_holder.append(Error(exc))
877
+ else:
878
+ outcome_holder.append(Value(retval))
879
+
880
+ def _main_task_finished(self, outcome: object) -> None:
881
+ self._send_stream = None
882
+
883
+ def _call_in_runner_task(
884
+ self,
885
+ func: Callable[P, Awaitable[T_Retval]],
886
+ /,
887
+ *args: P.args,
888
+ **kwargs: P.kwargs,
889
+ ) -> T_Retval:
890
+ if self._send_stream is None:
891
+ trio.lowlevel.start_guest_run(
892
+ self._run_tests_and_fixtures,
893
+ run_sync_soon_threadsafe=self._call_queue.put,
894
+ done_callback=self._main_task_finished,
895
+ **self._options,
896
+ )
897
+ while self._send_stream is None:
898
+ self._call_queue.get()()
899
+
900
+ outcome_holder: list[Outcome] = []
901
+ self._send_stream.send_nowait((func(*args, **kwargs), outcome_holder))
902
+ while not outcome_holder:
903
+ self._call_queue.get()()
904
+
905
+ return outcome_holder[0].unwrap()
906
+
907
+ def run_asyncgen_fixture(
908
+ self,
909
+ fixture_func: Callable[..., AsyncGenerator[T_Retval, Any]],
910
+ kwargs: dict[str, Any],
911
+ ) -> Iterable[T_Retval]:
912
+ asyncgen = fixture_func(**kwargs)
913
+ fixturevalue: T_Retval = self._call_in_runner_task(asyncgen.asend, None)
914
+
915
+ yield fixturevalue
916
+
917
+ try:
918
+ self._call_in_runner_task(asyncgen.asend, None)
919
+ except StopAsyncIteration:
920
+ pass
921
+ else:
922
+ self._call_in_runner_task(asyncgen.aclose)
923
+ raise RuntimeError("Async generator fixture did not stop")
924
+
925
+ def run_fixture(
926
+ self,
927
+ fixture_func: Callable[..., Coroutine[Any, Any, T_Retval]],
928
+ kwargs: dict[str, Any],
929
+ ) -> T_Retval:
930
+ return self._call_in_runner_task(fixture_func, **kwargs)
931
+
932
+ def run_test(
933
+ self, test_func: Callable[..., Coroutine[Any, Any, Any]], kwargs: dict[str, Any]
934
+ ) -> None:
935
+ self._call_in_runner_task(test_func, **kwargs)
936
+
937
+
938
+ class TrioTaskInfo(TaskInfo):
939
+ def __init__(self, task: trio.lowlevel.Task):
940
+ parent_id = None
941
+ if task.parent_nursery and task.parent_nursery.parent_task:
942
+ parent_id = id(task.parent_nursery.parent_task)
943
+
944
+ super().__init__(id(task), parent_id, task.name, task.coro)
945
+ self._task = weakref.proxy(task)
946
+
947
+ def has_pending_cancellation(self) -> bool:
948
+ try:
949
+ return self._task._cancel_status.effectively_cancelled
950
+ except ReferenceError:
951
+ # If the task is no longer around, it surely doesn't have a cancellation
952
+ # pending
953
+ return False
954
+
955
+
956
+ class TrioBackend(AsyncBackend):
957
+ @classmethod
958
+ def run(
959
+ cls,
960
+ func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]],
961
+ args: tuple[Unpack[PosArgsT]],
962
+ kwargs: dict[str, Any],
963
+ options: dict[str, Any],
964
+ ) -> T_Retval:
965
+ return trio.run(func, *args)
966
+
967
+ @classmethod
968
+ def current_token(cls) -> object:
969
+ return trio.lowlevel.current_trio_token()
970
+
971
+ @classmethod
972
+ def current_time(cls) -> float:
973
+ return trio.current_time()
974
+
975
+ @classmethod
976
+ def cancelled_exception_class(cls) -> type[BaseException]:
977
+ return trio.Cancelled
978
+
979
+ @classmethod
980
+ async def checkpoint(cls) -> None:
981
+ await trio.lowlevel.checkpoint()
982
+
983
+ @classmethod
984
+ async def checkpoint_if_cancelled(cls) -> None:
985
+ await trio.lowlevel.checkpoint_if_cancelled()
986
+
987
+ @classmethod
988
+ async def cancel_shielded_checkpoint(cls) -> None:
989
+ await trio.lowlevel.cancel_shielded_checkpoint()
990
+
991
+ @classmethod
992
+ async def sleep(cls, delay: float) -> None:
993
+ await trio.sleep(delay)
994
+
995
+ @classmethod
996
+ def create_cancel_scope(
997
+ cls, *, deadline: float = math.inf, shield: bool = False
998
+ ) -> abc.CancelScope:
999
+ return CancelScope(deadline=deadline, shield=shield)
1000
+
1001
+ @classmethod
1002
+ def current_effective_deadline(cls) -> float:
1003
+ return trio.current_effective_deadline()
1004
+
1005
+ @classmethod
1006
+ def create_task_group(cls) -> abc.TaskGroup:
1007
+ return TaskGroup()
1008
+
1009
+ @classmethod
1010
+ def create_event(cls) -> abc.Event:
1011
+ return Event()
1012
+
1013
+ @classmethod
1014
+ def create_lock(cls, *, fast_acquire: bool) -> Lock:
1015
+ return Lock(fast_acquire=fast_acquire)
1016
+
1017
+ @classmethod
1018
+ def create_semaphore(
1019
+ cls,
1020
+ initial_value: int,
1021
+ *,
1022
+ max_value: int | None = None,
1023
+ fast_acquire: bool = False,
1024
+ ) -> abc.Semaphore:
1025
+ return Semaphore(initial_value, max_value=max_value, fast_acquire=fast_acquire)
1026
+
1027
+ @classmethod
1028
+ def create_capacity_limiter(cls, total_tokens: float) -> CapacityLimiter:
1029
+ return CapacityLimiter(total_tokens)
1030
+
1031
+ @classmethod
1032
+ async def run_sync_in_worker_thread(
1033
+ cls,
1034
+ func: Callable[[Unpack[PosArgsT]], T_Retval],
1035
+ args: tuple[Unpack[PosArgsT]],
1036
+ abandon_on_cancel: bool = False,
1037
+ limiter: abc.CapacityLimiter | None = None,
1038
+ ) -> T_Retval:
1039
+ def wrapper() -> T_Retval:
1040
+ with claim_worker_thread(TrioBackend, token):
1041
+ return func(*args)
1042
+
1043
+ token = TrioBackend.current_token()
1044
+ return await run_sync(
1045
+ wrapper,
1046
+ abandon_on_cancel=abandon_on_cancel,
1047
+ limiter=cast(trio.CapacityLimiter, limiter),
1048
+ )
1049
+
1050
+ @classmethod
1051
+ def check_cancelled(cls) -> None:
1052
+ trio.from_thread.check_cancelled()
1053
+
1054
+ @classmethod
1055
+ def run_async_from_thread(
1056
+ cls,
1057
+ func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]],
1058
+ args: tuple[Unpack[PosArgsT]],
1059
+ token: object,
1060
+ ) -> T_Retval:
1061
+ trio_token = cast("trio.lowlevel.TrioToken | None", token)
1062
+ try:
1063
+ return trio.from_thread.run(func, *args, trio_token=trio_token)
1064
+ except trio.RunFinishedError:
1065
+ raise RunFinishedError from None
1066
+
1067
+ @classmethod
1068
+ def run_sync_from_thread(
1069
+ cls,
1070
+ func: Callable[[Unpack[PosArgsT]], T_Retval],
1071
+ args: tuple[Unpack[PosArgsT]],
1072
+ token: object,
1073
+ ) -> T_Retval:
1074
+ trio_token = cast("trio.lowlevel.TrioToken | None", token)
1075
+ try:
1076
+ return trio.from_thread.run_sync(func, *args, trio_token=trio_token)
1077
+ except trio.RunFinishedError:
1078
+ raise RunFinishedError from None
1079
+
1080
+ @classmethod
1081
+ async def open_process(
1082
+ cls,
1083
+ command: StrOrBytesPath | Sequence[StrOrBytesPath],
1084
+ *,
1085
+ stdin: int | IO[Any] | None,
1086
+ stdout: int | IO[Any] | None,
1087
+ stderr: int | IO[Any] | None,
1088
+ **kwargs: Any,
1089
+ ) -> Process:
1090
+ def convert_item(item: StrOrBytesPath) -> str:
1091
+ str_or_bytes = os.fspath(item)
1092
+ if isinstance(str_or_bytes, str):
1093
+ return str_or_bytes
1094
+ else:
1095
+ return os.fsdecode(str_or_bytes)
1096
+
1097
+ if isinstance(command, (str, bytes, PathLike)):
1098
+ process = await trio.lowlevel.open_process(
1099
+ convert_item(command),
1100
+ stdin=stdin,
1101
+ stdout=stdout,
1102
+ stderr=stderr,
1103
+ shell=True,
1104
+ **kwargs,
1105
+ )
1106
+ else:
1107
+ process = await trio.lowlevel.open_process(
1108
+ [convert_item(item) for item in command],
1109
+ stdin=stdin,
1110
+ stdout=stdout,
1111
+ stderr=stderr,
1112
+ shell=False,
1113
+ **kwargs,
1114
+ )
1115
+
1116
+ stdin_stream = SendStreamWrapper(process.stdin) if process.stdin else None
1117
+ stdout_stream = ReceiveStreamWrapper(process.stdout) if process.stdout else None
1118
+ stderr_stream = ReceiveStreamWrapper(process.stderr) if process.stderr else None
1119
+ return Process(process, stdin_stream, stdout_stream, stderr_stream)
1120
+
1121
+ @classmethod
1122
+ def setup_process_pool_exit_at_shutdown(cls, workers: set[abc.Process]) -> None:
1123
+ trio.lowlevel.spawn_system_task(_shutdown_process_pool, workers)
1124
+
1125
+ @classmethod
1126
+ async def connect_tcp(
1127
+ cls, host: str, port: int, local_address: IPSockAddrType | None = None
1128
+ ) -> SocketStream:
1129
+ family = socket.AF_INET6 if ":" in host else socket.AF_INET
1130
+ trio_socket = trio.socket.socket(family)
1131
+ trio_socket.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
1132
+ if local_address:
1133
+ await trio_socket.bind(local_address)
1134
+
1135
+ try:
1136
+ await trio_socket.connect((host, port))
1137
+ except BaseException:
1138
+ trio_socket.close()
1139
+ raise
1140
+
1141
+ return SocketStream(trio_socket)
1142
+
1143
+ @classmethod
1144
+ async def connect_unix(cls, path: str | bytes) -> abc.UNIXSocketStream:
1145
+ trio_socket = trio.socket.socket(socket.AF_UNIX)
1146
+ try:
1147
+ await trio_socket.connect(path)
1148
+ except BaseException:
1149
+ trio_socket.close()
1150
+ raise
1151
+
1152
+ return UNIXSocketStream(trio_socket)
1153
+
1154
+ @classmethod
1155
+ def create_tcp_listener(cls, sock: socket.socket) -> abc.SocketListener:
1156
+ return TCPSocketListener(sock)
1157
+
1158
+ @classmethod
1159
+ def create_unix_listener(cls, sock: socket.socket) -> abc.SocketListener:
1160
+ return UNIXSocketListener(sock)
1161
+
1162
+ @classmethod
1163
+ async def create_udp_socket(
1164
+ cls,
1165
+ family: socket.AddressFamily,
1166
+ local_address: IPSockAddrType | None,
1167
+ remote_address: IPSockAddrType | None,
1168
+ reuse_port: bool,
1169
+ ) -> UDPSocket | ConnectedUDPSocket:
1170
+ trio_socket = trio.socket.socket(family=family, type=socket.SOCK_DGRAM)
1171
+
1172
+ if reuse_port:
1173
+ trio_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
1174
+
1175
+ if local_address:
1176
+ await trio_socket.bind(local_address)
1177
+
1178
+ if remote_address:
1179
+ await trio_socket.connect(remote_address)
1180
+ return ConnectedUDPSocket(trio_socket)
1181
+ else:
1182
+ return UDPSocket(trio_socket)
1183
+
1184
+ @classmethod
1185
+ @overload
1186
+ async def create_unix_datagram_socket(
1187
+ cls, raw_socket: socket.socket, remote_path: None
1188
+ ) -> abc.UNIXDatagramSocket: ...
1189
+
1190
+ @classmethod
1191
+ @overload
1192
+ async def create_unix_datagram_socket(
1193
+ cls, raw_socket: socket.socket, remote_path: str | bytes
1194
+ ) -> abc.ConnectedUNIXDatagramSocket: ...
1195
+
1196
+ @classmethod
1197
+ async def create_unix_datagram_socket(
1198
+ cls, raw_socket: socket.socket, remote_path: str | bytes | None
1199
+ ) -> abc.UNIXDatagramSocket | abc.ConnectedUNIXDatagramSocket:
1200
+ trio_socket = trio.socket.from_stdlib_socket(raw_socket)
1201
+
1202
+ if remote_path:
1203
+ await trio_socket.connect(remote_path)
1204
+ return ConnectedUNIXDatagramSocket(trio_socket)
1205
+ else:
1206
+ return UNIXDatagramSocket(trio_socket)
1207
+
1208
+ @classmethod
1209
+ async def getaddrinfo(
1210
+ cls,
1211
+ host: bytes | str | None,
1212
+ port: str | int | None,
1213
+ *,
1214
+ family: int | AddressFamily = 0,
1215
+ type: int | SocketKind = 0,
1216
+ proto: int = 0,
1217
+ flags: int = 0,
1218
+ ) -> Sequence[
1219
+ tuple[
1220
+ AddressFamily,
1221
+ SocketKind,
1222
+ int,
1223
+ str,
1224
+ tuple[str, int] | tuple[str, int, int, int] | tuple[int, bytes],
1225
+ ]
1226
+ ]:
1227
+ return await trio.socket.getaddrinfo(host, port, family, type, proto, flags)
1228
+
1229
+ @classmethod
1230
+ async def getnameinfo(
1231
+ cls, sockaddr: IPSockAddrType, flags: int = 0
1232
+ ) -> tuple[str, str]:
1233
+ return await trio.socket.getnameinfo(sockaddr, flags)
1234
+
1235
+ @classmethod
1236
+ async def wait_readable(cls, obj: FileDescriptorLike) -> None:
1237
+ try:
1238
+ await wait_readable(obj)
1239
+ except trio.ClosedResourceError as exc:
1240
+ raise ClosedResourceError().with_traceback(exc.__traceback__) from None
1241
+ except trio.BusyResourceError:
1242
+ raise BusyResourceError("reading from") from None
1243
+
1244
+ @classmethod
1245
+ async def wait_writable(cls, obj: FileDescriptorLike) -> None:
1246
+ try:
1247
+ await wait_writable(obj)
1248
+ except trio.ClosedResourceError as exc:
1249
+ raise ClosedResourceError().with_traceback(exc.__traceback__) from None
1250
+ except trio.BusyResourceError:
1251
+ raise BusyResourceError("writing to") from None
1252
+
1253
+ @classmethod
1254
+ def notify_closing(cls, obj: FileDescriptorLike) -> None:
1255
+ notify_closing(obj)
1256
+
1257
+ @classmethod
1258
+ async def wrap_listener_socket(cls, sock: socket.socket) -> abc.SocketListener:
1259
+ return TCPSocketListener(sock)
1260
+
1261
+ @classmethod
1262
+ async def wrap_stream_socket(cls, sock: socket.socket) -> SocketStream:
1263
+ trio_sock = trio.socket.from_stdlib_socket(sock)
1264
+ return SocketStream(trio_sock)
1265
+
1266
+ @classmethod
1267
+ async def wrap_unix_stream_socket(cls, sock: socket.socket) -> UNIXSocketStream:
1268
+ trio_sock = trio.socket.from_stdlib_socket(sock)
1269
+ return UNIXSocketStream(trio_sock)
1270
+
1271
+ @classmethod
1272
+ async def wrap_udp_socket(cls, sock: socket.socket) -> UDPSocket:
1273
+ trio_sock = trio.socket.from_stdlib_socket(sock)
1274
+ return UDPSocket(trio_sock)
1275
+
1276
+ @classmethod
1277
+ async def wrap_connected_udp_socket(cls, sock: socket.socket) -> ConnectedUDPSocket:
1278
+ trio_sock = trio.socket.from_stdlib_socket(sock)
1279
+ return ConnectedUDPSocket(trio_sock)
1280
+
1281
+ @classmethod
1282
+ async def wrap_unix_datagram_socket(cls, sock: socket.socket) -> UNIXDatagramSocket:
1283
+ trio_sock = trio.socket.from_stdlib_socket(sock)
1284
+ return UNIXDatagramSocket(trio_sock)
1285
+
1286
+ @classmethod
1287
+ async def wrap_connected_unix_datagram_socket(
1288
+ cls, sock: socket.socket
1289
+ ) -> ConnectedUNIXDatagramSocket:
1290
+ trio_sock = trio.socket.from_stdlib_socket(sock)
1291
+ return ConnectedUNIXDatagramSocket(trio_sock)
1292
+
1293
+ @classmethod
1294
+ def current_default_thread_limiter(cls) -> CapacityLimiter:
1295
+ try:
1296
+ return _capacity_limiter_wrapper.get()
1297
+ except LookupError:
1298
+ limiter = CapacityLimiter(
1299
+ original=trio.to_thread.current_default_thread_limiter()
1300
+ )
1301
+ _capacity_limiter_wrapper.set(limiter)
1302
+ return limiter
1303
+
1304
+ @classmethod
1305
+ def open_signal_receiver(
1306
+ cls, *signals: Signals
1307
+ ) -> AbstractContextManager[AsyncIterator[Signals]]:
1308
+ return _SignalReceiver(signals)
1309
+
1310
+ @classmethod
1311
+ def get_current_task(cls) -> TaskInfo:
1312
+ task = current_task()
1313
+ return TrioTaskInfo(task)
1314
+
1315
+ @classmethod
1316
+ def get_running_tasks(cls) -> Sequence[TaskInfo]:
1317
+ root_task = current_root_task()
1318
+ assert root_task
1319
+ task_infos = [TrioTaskInfo(root_task)]
1320
+ nurseries = root_task.child_nurseries
1321
+ while nurseries:
1322
+ new_nurseries: list[trio.Nursery] = []
1323
+ for nursery in nurseries:
1324
+ for task in nursery.child_tasks:
1325
+ task_infos.append(TrioTaskInfo(task))
1326
+ new_nurseries.extend(task.child_nurseries)
1327
+
1328
+ nurseries = new_nurseries
1329
+
1330
+ return task_infos
1331
+
1332
+ @classmethod
1333
+ async def wait_all_tasks_blocked(cls) -> None:
1334
+ from trio.testing import wait_all_tasks_blocked
1335
+
1336
+ await wait_all_tasks_blocked()
1337
+
1338
+ @classmethod
1339
+ def create_test_runner(cls, options: dict[str, Any]) -> TestRunner:
1340
+ return TestRunner(**options)
1341
+
1342
+
1343
+ backend_class = TrioBackend
.venv/lib/python3.10/site-packages/anyio/_core/__init__.py ADDED
File without changes
.venv/lib/python3.10/site-packages/anyio/_core/__pycache__/__init__.cpython-310-pytest-9.0.3.pyc ADDED
Binary file (226 Bytes). View file
 
.venv/lib/python3.10/site-packages/anyio/_core/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (226 Bytes). View file
 
.venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_contextmanagers.cpython-310-pytest-9.0.3.pyc ADDED
Binary file (8.1 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_contextmanagers.cpython-310.pyc ADDED
Binary file (7.03 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_eventloop.cpython-310-pytest-9.0.3.pyc ADDED
Binary file (6.5 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_eventloop.cpython-310.pyc ADDED
Binary file (6.39 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_exceptions.cpython-310-pytest-9.0.3.pyc ADDED
Binary file (6.2 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_exceptions.cpython-310.pyc ADDED
Binary file (6.09 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_fileio.cpython-310-pytest-9.0.3.pyc ADDED
Binary file (27.8 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_fileio.cpython-310.pyc ADDED
Binary file (27.7 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_resources.cpython-310-pytest-9.0.3.pyc ADDED
Binary file (914 Bytes). View file
 
.venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_resources.cpython-310.pyc ADDED
Binary file (805 Bytes). View file
 
.venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_signals.cpython-310-pytest-9.0.3.pyc ADDED
Binary file (1.46 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_signals.cpython-310.pyc ADDED
Binary file (1.35 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_sockets.cpython-310-pytest-9.0.3.pyc ADDED
Binary file (29.8 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_sockets.cpython-310.pyc ADDED
Binary file (29.6 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_streams.cpython-310-pytest-9.0.3.pyc ADDED
Binary file (2.15 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_streams.cpython-310.pyc ADDED
Binary file (2.04 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_subprocesses.cpython-310-pytest-9.0.3.pyc ADDED
Binary file (7.67 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_subprocesses.cpython-310.pyc ADDED
Binary file (7.56 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_synchronization.cpython-310-pytest-9.0.3.pyc ADDED
Binary file (24.7 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_synchronization.cpython-310.pyc ADDED
Binary file (24.6 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_tasks.cpython-310-pytest-9.0.3.pyc ADDED
Binary file (6.69 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_tasks.cpython-310.pyc ADDED
Binary file (6.58 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_tempfile.cpython-310-pytest-9.0.3.pyc ADDED
Binary file (19.5 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_tempfile.cpython-310.pyc ADDED
Binary file (19.4 kB). View file
 
.venv/lib/python3.10/site-packages/anyio/_core/__pycache__/_testing.cpython-310-pytest-9.0.3.pyc ADDED
Binary file (3.29 kB). View file