modal 0.67.33__py3-none-any.whl → 0.67.35__py3-none-any.whl

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.
modal/client.pyi CHANGED
@@ -26,7 +26,7 @@ class _Client:
26
26
  _stub: typing.Optional[modal_proto.api_grpc.ModalClientStub]
27
27
 
28
28
  def __init__(
29
- self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.67.33"
29
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.67.35"
30
30
  ): ...
31
31
  def is_closed(self) -> bool: ...
32
32
  @property
@@ -81,7 +81,7 @@ class Client:
81
81
  _stub: typing.Optional[modal_proto.api_grpc.ModalClientStub]
82
82
 
83
83
  def __init__(
84
- self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.67.33"
84
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.67.35"
85
85
  ): ...
86
86
  def is_closed(self) -> bool: ...
87
87
  @property
modal/io_streams.py CHANGED
@@ -184,7 +184,7 @@ class _StreamReader(Generic[T]):
184
184
 
185
185
  async for message in iterator:
186
186
  if self._stream_type == StreamType.STDOUT and message:
187
- print(message, end="")
187
+ print(message.decode("utf-8"), end="")
188
188
  elif self._stream_type == StreamType.PIPE:
189
189
  self._container_process_buffer.append(message)
190
190
  if message is None:
modal/queue.py CHANGED
@@ -27,38 +27,12 @@ class _Queue(_Object, type_prefix="qu"):
27
27
 
28
28
  By default, the `Queue` object acts as a single FIFO queue which supports puts and gets (blocking and non-blocking).
29
29
 
30
- **Queue partitions (beta)**
31
-
32
- Specifying partition keys gives access to other independent FIFO partitions within the same `Queue` object.
33
- Across any two partitions, puts and gets are completely independent.
34
- For example, a put in one partition does not affect a get in any other partition.
35
-
36
- When no partition key is specified (by default), puts and gets will operate on a default partition.
37
- This default partition is also isolated from all other partitions.
38
- Please see the Usage section below for an example using partitions.
39
-
40
- **Lifetime of a queue and its partitions**
41
-
42
- By default, each partition is cleared 24 hours after the last `put` operation.
43
- A lower TTL can be specified by the `partition_ttl` argument in the `put` or `put_many` methods.
44
- Each partition's expiry is handled independently.
45
-
46
- As such, `Queue`s are best used for communication between active functions and not relied on for persistent storage.
47
-
48
- On app completion or after stopping an app any associated `Queue` objects are cleaned up.
49
- All its partitions will be cleared.
50
-
51
- **Limits**
52
-
53
- A single `Queue` can contain up to 100,000 partitions, each with up to 5,000 items. Each item can be up to 256 KiB.
54
-
55
- Partition keys must be non-empty and must not exceed 64 bytes.
56
-
57
30
  **Usage**
58
31
 
59
32
  ```python
60
33
  from modal import Queue
61
34
 
35
+ # Create an ephemeral queue which is anonymous and garbage collected
62
36
  with Queue.ephemeral() as my_queue:
63
37
  # Putting values
64
38
  my_queue.put("some value")
@@ -82,9 +56,41 @@ class _Queue(_Object, type_prefix="qu"):
82
56
  # (beta feature) Iterate through items in place (read immutably)
83
57
  my_queue.put(1)
84
58
  assert [v for v in my_queue.iterate()] == [0, 1]
59
+
60
+ # You can also create persistent queues that can be used across apps
61
+ queue = Queue.from_name("my-persisted-queue", create_if_missing=True)
62
+ queue.put(42)
63
+ assert queue.get() == 42
85
64
  ```
86
65
 
87
66
  For more examples, see the [guide](/docs/guide/dicts-and-queues#modal-queues).
67
+
68
+ **Queue partitions (beta)**
69
+
70
+ Specifying partition keys gives access to other independent FIFO partitions within the same `Queue` object.
71
+ Across any two partitions, puts and gets are completely independent.
72
+ For example, a put in one partition does not affect a get in any other partition.
73
+
74
+ When no partition key is specified (by default), puts and gets will operate on a default partition.
75
+ This default partition is also isolated from all other partitions.
76
+ Please see the Usage section below for an example using partitions.
77
+
78
+ **Lifetime of a queue and its partitions**
79
+
80
+ By default, each partition is cleared 24 hours after the last `put` operation.
81
+ A lower TTL can be specified by the `partition_ttl` argument in the `put` or `put_many` methods.
82
+ Each partition's expiry is handled independently.
83
+
84
+ As such, `Queue`s are best used for communication between active functions and not relied on for persistent storage.
85
+
86
+ On app completion or after stopping an app any associated `Queue` objects are cleaned up.
87
+ All its partitions will be cleared.
88
+
89
+ **Limits**
90
+
91
+ A single `Queue` can contain up to 100,000 partitions, each with up to 5,000 items. Each item can be up to 256 KiB.
92
+
93
+ Partition keys must be non-empty and must not exceed 64 bytes.
88
94
  """
89
95
 
90
96
  @staticmethod
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: modal
3
- Version: 0.67.33
3
+ Version: 0.67.35
4
4
  Summary: Python client library for Modal
5
5
  Author: Modal Labs
6
6
  Author-email: support@modal.com
@@ -19,7 +19,7 @@ modal/app.py,sha256=EJ7FUN6rWnSwLJoYJh8nmKg_t-8hdN8_rt0OrkP7JvQ,46084
19
19
  modal/app.pyi,sha256=BE5SlR5tRECuc6-e2lUuOknDdov3zxgZ4N0AsLb5ZVQ,25270
20
20
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
21
21
  modal/client.py,sha256=VMg_aIuo_LOEe2ttxBHEND3PLhTp5lo-onH4wELhIyY,16375
22
- modal/client.pyi,sha256=Xu0iGZiUWQoXYK4tgi8QgxTK38UPWHz-rS3_oDFwFYQ,7354
22
+ modal/client.pyi,sha256=jvOfiy-GKM6tGPJM_Wt-IV5OJrDPt9Cppmbi85466lo,7354
23
23
  modal/cloud_bucket_mount.py,sha256=G7T7jWLD0QkmrfKR75mSTwdUZ2xNfj7pkVqb4ipmxmI,5735
24
24
  modal/cloud_bucket_mount.pyi,sha256=CEi7vrH3kDUF4LAy4qP6tfImy2UJuFRcRbsgRNM1wo8,1403
25
25
  modal/cls.py,sha256=OJqzj_V-n1g48BY_4Jg_BOTQdftEEl4kTWN0X4FOOdg,27378
@@ -38,7 +38,7 @@ modal/functions.pyi,sha256=3Jupx4QKaqQ9p9XQSG4zDjB3W-87EYkFg55w2QuSQ8M,24892
38
38
  modal/gpu.py,sha256=r4rL6uH3UJIQthzYvfWauXNyh01WqCPtKZCmmSX1fd4,6881
39
39
  modal/image.py,sha256=cQ6WP1xHXZT_nY8z3aEFiGwKzrTV0yxi3Ab8JzF91eo,79653
40
40
  modal/image.pyi,sha256=PIKH6JBA4L5TfdJrQu3pm2ykyIITmiP920TpP8cdyQA,24585
41
- modal/io_streams.py,sha256=YfKAlWQAxzPCHE0-wVlAlX5vldrpfKMdr9ggL0c5VJo,15063
41
+ modal/io_streams.py,sha256=QkQiizKRzd5bnbKQsap31LJgBYlAnj4-XkV_50xPYX0,15079
42
42
  modal/io_streams.pyi,sha256=bCCVSxkMcosYd8O3PQDDwJw7TQ8JEcnYonLJ5t27TQs,4804
43
43
  modal/mount.py,sha256=liaid5p42o0OKnzoocJJ_oCovDVderk3-JuCTa5pqtA,27656
44
44
  modal/mount.pyi,sha256=3e4nkXUeeVmUmOyK8Tiyk_EQlHeWruN3yGJVnmDUVrI,9761
@@ -54,7 +54,7 @@ modal/partial_function.pyi,sha256=EafGOzZdEq-yE5bYRoMfnMqw-o8Hk_So8MRPDSB99_0,89
54
54
  modal/proxy.py,sha256=ZrOsuQP7dSZFq1OrIxalNnt0Zvsnp1h86Th679sSL40,1417
55
55
  modal/proxy.pyi,sha256=UvygdOYneLTuoDY6hVaMNCyZ947Tmx93IdLjErUqkvM,368
56
56
  modal/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
57
- modal/queue.py,sha256=q0SDkrN2e2CNxsHjhs6xMwf03LZdvuUFYL7SZPZpKps,18390
57
+ modal/queue.py,sha256=fJYFfpdrlVj_doc3QxgvJvv7c8BGHjjja5q_9HCtSqs,18658
58
58
  modal/queue.pyi,sha256=di3ownBw4jc6d4X7ygXtbpjlUMOK69qyaD3lVsJbpoM,9900
59
59
  modal/retries.py,sha256=HKR2Q9aNPWkMjQ5nwobqYTuZaSuw0a8lI2zrtY5IW98,5230
60
60
  modal/runner.py,sha256=7obU-Gq1ocpBGCuR6pvn1T-D6ggg1T48qFo2TNUGWkU,24089
@@ -159,10 +159,10 @@ modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0y
159
159
  modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
160
160
  modal_version/__init__.py,sha256=3IY-AWLH55r35_mQXIaut0jrJvoPuf1NZJBQQfSbPuo,470
161
161
  modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
162
- modal_version/_version_generated.py,sha256=1ZSIr835IEHi57LCELaWz0cnuPoKmFPQ6RSNQ5d-jAI,149
163
- modal-0.67.33.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
164
- modal-0.67.33.dist-info/METADATA,sha256=_5CGgZs2lnu_9I4Q5SRSIA9FYgHkOoRBOO_uOxtLMmE,2329
165
- modal-0.67.33.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
166
- modal-0.67.33.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
167
- modal-0.67.33.dist-info/top_level.txt,sha256=1nvYbOSIKcmU50fNrpnQnrrOpj269ei3LzgB6j9xGqg,64
168
- modal-0.67.33.dist-info/RECORD,,
162
+ modal_version/_version_generated.py,sha256=TB2aU4j9kfcxSShaiYFWGAnrJHHvs4rebXvTjhJE--A,149
163
+ modal-0.67.35.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
164
+ modal-0.67.35.dist-info/METADATA,sha256=zsKsNwurhlj1Bame_jPz_NF0SAKiILTnnXmIIwk-c8I,2329
165
+ modal-0.67.35.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
166
+ modal-0.67.35.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
167
+ modal-0.67.35.dist-info/top_level.txt,sha256=1nvYbOSIKcmU50fNrpnQnrrOpj269ei3LzgB6j9xGqg,64
168
+ modal-0.67.35.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  # Copyright Modal Labs 2024
2
2
 
3
3
  # Note: Reset this value to -1 whenever you make a minor `0.X` release of the client.
4
- build_number = 33 # git: 14899d6
4
+ build_number = 35 # git: d815540