modal 1.6.2.dev8__tar.gz → 1.6.2.dev10__tar.gz

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 (246) hide show
  1. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/PKG-INFO +1 -1
  2. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_workspace.py +180 -1
  3. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/import_refs.py +36 -7
  4. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/run.py +51 -1
  5. modal-1.6.2.dev10/modal/cli/workspace.py +633 -0
  6. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/client.pyi +2 -2
  7. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/types.py +37 -0
  8. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/workspace.py +3 -0
  9. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/workspace.pyi +236 -0
  10. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal.egg-info/PKG-INFO +1 -1
  11. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal_version/__init__.py +1 -1
  12. modal-1.6.2.dev8/modal/cli/workspace.py +0 -269
  13. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/LICENSE +0 -0
  14. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/README.md +0 -0
  15. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/__init__.py +0 -0
  16. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/__main__.py +0 -0
  17. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_billing.py +0 -0
  18. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_cluster.py +0 -0
  19. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_cluster.pyi +0 -0
  20. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_container_entrypoint.py +0 -0
  21. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_environments.py +0 -0
  22. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_function_variants.py +0 -0
  23. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_functions.py +0 -0
  24. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_grpc_client.py +0 -0
  25. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_image.py +0 -0
  26. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_ipython.py +0 -0
  27. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_load_context.py +0 -0
  28. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_location.py +0 -0
  29. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_logs.py +0 -0
  30. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_logs_manager.py +0 -0
  31. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_logs_manager.pyi +0 -0
  32. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_metrics.py +0 -0
  33. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_metrics.pyi +0 -0
  34. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_object.py +0 -0
  35. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_outbound_policy.py +0 -0
  36. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_outbound_policy.pyi +0 -0
  37. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_output/__init__.py +0 -0
  38. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_output/manager.py +0 -0
  39. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_output/pty.py +0 -0
  40. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_output/rich.py +0 -0
  41. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_output/status.py +0 -0
  42. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_partial_function.py +0 -0
  43. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_resolver.py +0 -0
  44. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_resources.py +0 -0
  45. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_runtime/__init__.py +0 -0
  46. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_runtime/asgi.py +0 -0
  47. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_runtime/container_io_manager.py +0 -0
  48. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_runtime/container_io_manager.pyi +0 -0
  49. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_runtime/execution_context.py +0 -0
  50. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_runtime/execution_context.pyi +0 -0
  51. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_runtime/gpu_memory_snapshot.py +0 -0
  52. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_runtime/task_lifecycle_manager.py +0 -0
  53. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_runtime/task_lifecycle_manager.pyi +0 -0
  54. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_runtime/telemetry.py +0 -0
  55. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_runtime/user_code_event_loop.py +0 -0
  56. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_runtime/user_code_imports.py +0 -0
  57. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_serialization.py +0 -0
  58. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_server.py +0 -0
  59. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_server.pyi +0 -0
  60. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_supports_logs.py +0 -0
  61. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_traceback.py +0 -0
  62. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_tunnel.py +0 -0
  63. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_tunnel.pyi +0 -0
  64. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_type_manager.py +0 -0
  65. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/__init__.py +0 -0
  66. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/app_utils.py +0 -0
  67. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/async_utils.py +0 -0
  68. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/auth_token_manager.py +0 -0
  69. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/blob_utils.py +0 -0
  70. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/browser_utils.py +0 -0
  71. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/bytes_io_segment_payload.py +0 -0
  72. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/curl_utils.py +0 -0
  73. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/deprecation.py +0 -0
  74. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/display_utils.py +0 -0
  75. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/docker_utils.py +0 -0
  76. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/function_utils.py +0 -0
  77. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/git_utils.py +0 -0
  78. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/grpc_testing.py +0 -0
  79. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/grpc_utils.py +0 -0
  80. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/hash_utils.py +0 -0
  81. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/http_utils.py +0 -0
  82. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/idle_countdown.py +0 -0
  83. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/jwt_utils.py +0 -0
  84. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/logger.py +0 -0
  85. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/mount_utils.py +0 -0
  86. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/name_utils.py +0 -0
  87. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/package_utils.py +0 -0
  88. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/pattern_utils.py +0 -0
  89. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/proxy_support.py +0 -0
  90. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/rand_pb_testing.py +0 -0
  91. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/sandbox_fs_utils.py +0 -0
  92. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/shell_utils.py +0 -0
  93. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_utils/time_utils.py +0 -0
  94. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_vendor/__init__.py +0 -0
  95. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_vendor/a2wsgi_wsgi.py +0 -0
  96. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_vendor/cloudpickle.py +0 -0
  97. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_vendor/tblib.py +0 -0
  98. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_vendor/version.py +0 -0
  99. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/_watcher.py +0 -0
  100. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/app.py +0 -0
  101. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/app.pyi +0 -0
  102. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/billing.py +0 -0
  103. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/billing.pyi +0 -0
  104. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/builder/2023.12.312.txt +0 -0
  105. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/builder/2023.12.txt +0 -0
  106. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/builder/2024.04.txt +0 -0
  107. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/builder/2024.10.txt +0 -0
  108. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/builder/2025.06.txt +0 -0
  109. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/builder/PREVIEW.txt +0 -0
  110. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/builder/README.md +0 -0
  111. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/builder/base-images.json +0 -0
  112. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/call_graph.py +0 -0
  113. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/__init__.py +0 -0
  114. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/_download.py +0 -0
  115. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/_help.py +0 -0
  116. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/_logs.py +0 -0
  117. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/_stats.py +0 -0
  118. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/_traceback.py +0 -0
  119. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/app.py +0 -0
  120. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/billing.py +0 -0
  121. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/changelog.py +0 -0
  122. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/config.py +0 -0
  123. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/container.py +0 -0
  124. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/curl.py +0 -0
  125. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/dashboard.py +0 -0
  126. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/dict.py +0 -0
  127. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/endpoint.py +0 -0
  128. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/entry_point.py +0 -0
  129. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/environment.py +0 -0
  130. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/function.py +0 -0
  131. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/image.py +0 -0
  132. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/logo.py +0 -0
  133. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/network_file_system.py +0 -0
  134. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/profile.py +0 -0
  135. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/queues.py +0 -0
  136. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/secret.py +0 -0
  137. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/selector.py +0 -0
  138. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/server.py +0 -0
  139. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/shell.py +0 -0
  140. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/skills.py +0 -0
  141. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/token.py +0 -0
  142. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/utils.py +0 -0
  143. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cli/volume.py +0 -0
  144. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/client.py +0 -0
  145. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cloud_bucket_mount.py +0 -0
  146. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cloud_bucket_mount.pyi +0 -0
  147. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cls.py +0 -0
  148. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cls.pyi +0 -0
  149. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cluster.py +0 -0
  150. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/cluster.pyi +0 -0
  151. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/config.py +0 -0
  152. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/container_process.py +0 -0
  153. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/container_process.pyi +0 -0
  154. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/dict.py +0 -0
  155. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/dict.pyi +0 -0
  156. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/environments.py +0 -0
  157. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/environments.pyi +0 -0
  158. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/exception.py +0 -0
  159. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/experimental/__init__.py +0 -0
  160. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/experimental/_flash_container_entry.py +0 -0
  161. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/experimental/flash.py +0 -0
  162. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/experimental/flash.pyi +0 -0
  163. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/experimental/flash_server.py +0 -0
  164. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/experimental/flash_server.pyi +0 -0
  165. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/experimental/ipython.py +0 -0
  166. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/file_pattern_matcher.py +0 -0
  167. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/functions.py +0 -0
  168. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/functions.pyi +0 -0
  169. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/image.py +0 -0
  170. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/image.pyi +0 -0
  171. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/io_streams.py +0 -0
  172. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/io_streams.pyi +0 -0
  173. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/mount.py +0 -0
  174. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/mount.pyi +0 -0
  175. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/network_file_system.py +0 -0
  176. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/network_file_system.pyi +0 -0
  177. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/object.py +0 -0
  178. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/object.pyi +0 -0
  179. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/output.py +0 -0
  180. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/parallel_map.py +0 -0
  181. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/parallel_map.pyi +0 -0
  182. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/partial_function.py +0 -0
  183. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/partial_function.pyi +0 -0
  184. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/proxy.py +0 -0
  185. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/proxy.pyi +0 -0
  186. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/py.typed +0 -0
  187. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/queue.py +0 -0
  188. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/queue.pyi +0 -0
  189. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/retries.py +0 -0
  190. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/runner.py +0 -0
  191. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/runner.pyi +0 -0
  192. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/running_app.py +0 -0
  193. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/sandbox/__init__.py +0 -0
  194. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/sandbox/_common.py +0 -0
  195. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/sandbox/_filesystem.py +0 -0
  196. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/sandbox/_sandbox.py +0 -0
  197. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/sandbox/_sidecar.py +0 -0
  198. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/sandbox/_snapshot.py +0 -0
  199. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/sandbox/_task_command_router_client.py +0 -0
  200. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/sandbox/sandbox.py +0 -0
  201. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/sandbox/sandbox.pyi +0 -0
  202. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/schedule.py +0 -0
  203. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/scheduler_placement.py +0 -0
  204. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/secret.py +0 -0
  205. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/secret.pyi +0 -0
  206. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/server.py +0 -0
  207. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/server.pyi +0 -0
  208. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/serving.py +0 -0
  209. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/serving.pyi +0 -0
  210. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/skills/modal/SKILL.md +0 -0
  211. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/stream_type.py +0 -0
  212. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/token_flow.py +0 -0
  213. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/token_flow.pyi +0 -0
  214. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/volume.py +0 -0
  215. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal/volume.pyi +0 -0
  216. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal.egg-info/SOURCES.txt +0 -0
  217. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal.egg-info/dependency_links.txt +0 -0
  218. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal.egg-info/entry_points.txt +0 -0
  219. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal.egg-info/requires.txt +0 -0
  220. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal.egg-info/top_level.txt +0 -0
  221. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal_docs/__init__.py +0 -0
  222. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal_docs/gen_cli_docs.py +0 -0
  223. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal_docs/gen_cli_docs_main.py +0 -0
  224. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal_docs/gen_reference_docs.py +0 -0
  225. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal_docs/gen_reference_docs_main.py +0 -0
  226. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal_docs/mdmd/__init__.py +0 -0
  227. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal_docs/mdmd/mdmd.py +0 -0
  228. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal_docs/mdmd/signatures.py +0 -0
  229. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal_docs/mdmd/types.py +0 -0
  230. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal_docs/reference_intro.md +0 -0
  231. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal_proto/__init__.py +0 -0
  232. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal_proto/api_grpc.py +0 -0
  233. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal_proto/api_pb2.py +0 -0
  234. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal_proto/api_pb2.pyi +0 -0
  235. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal_proto/api_pb2_grpc.py +0 -0
  236. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal_proto/api_pb2_grpc.pyi +0 -0
  237. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal_proto/modal_api_grpc.py +0 -0
  238. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal_proto/py.typed +0 -0
  239. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal_proto/task_command_router_grpc.py +0 -0
  240. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal_proto/task_command_router_pb2.py +0 -0
  241. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal_proto/task_command_router_pb2.pyi +0 -0
  242. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal_proto/task_command_router_pb2_grpc.py +0 -0
  243. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal_proto/task_command_router_pb2_grpc.pyi +0 -0
  244. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/modal_version/__main__.py +0 -0
  245. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/pyproject.toml +0 -0
  246. {modal-1.6.2.dev8 → modal-1.6.2.dev10}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: modal
3
- Version: 1.6.2.dev8
3
+ Version: 1.6.2.dev10
4
4
  Summary: Python client library for Modal
5
5
  Author-email: Modal Labs <support@modal.com>
6
6
  License-Expression: Apache-2.0
@@ -8,7 +8,8 @@ from typing import Optional
8
8
 
9
9
  from google.protobuf.empty_pb2 import Empty
10
10
 
11
- from modal.exception import DeprecationError, InvalidError
11
+ from modal.exception import DeprecationError, InvalidError, NotFoundError
12
+ from modal.types import ServiceUserInfo
12
13
  from modal_proto import api_pb2
13
14
 
14
15
  from ._load_context import LoadContext
@@ -129,6 +130,15 @@ class _Workspace(_Object, type_prefix="ac"):
129
130
  """Namespace for Workspace settings APIs."""
130
131
  return _WorkspaceSettingsManager(self)
131
132
 
133
+ @property
134
+ def service_users(self) -> "_WorkspaceServiceUserManager":
135
+ """Namespace for managing Service Users in a Workspace.
136
+
137
+ See [the guide](https://modal.com/docs/guide/service-users) for more information about Service
138
+ Users.
139
+ """
140
+ return _WorkspaceServiceUserManager(self)
141
+
132
142
 
133
143
  class _WorkspaceProxyTokenManager:
134
144
  """mdmd:namespace"""
@@ -556,3 +566,172 @@ class _WorkspaceSettingsManager:
556
566
  await self._set_default_environment(value)
557
567
  case _:
558
568
  raise ValueError(f"Unknown setting {name!r}. Valid settings: {', '.join(self._valid_settings())}")
569
+
570
+
571
+ class _WorkspaceServiceUserManager:
572
+ """mdmd:namespace"""
573
+
574
+ def __init__(self, workspace: _Workspace):
575
+ """mdmd:hidden"""
576
+ self._workspace = workspace
577
+
578
+ async def create(self, name: str, *, expires_in: int | None) -> TokenData:
579
+ """Create a new Service User in the current workspace.
580
+
581
+ To call this function, you are required to have Manager permissions in the Workspace.
582
+
583
+ Args:
584
+ name: The name of the new Service User. Must consistent only of alphanumeric, '-', or '_'
585
+ characters.
586
+ expires_in: An expiration time, in seconds, after which the token will stop working. If
587
+ `None`, the token will never expire.
588
+
589
+ Returns:
590
+ A `TokenData` dataclass containing the credentials for the Service User. Note that this
591
+ is the only time you will be able to view these credentials.
592
+
593
+ Examples:
594
+
595
+ ```python notest
596
+ ws = modal.Workspace.from_context()
597
+
598
+ # Creates a Service User named "test-service-user", whose credentials expire after one year.
599
+ service_user_token_data = ws.service_users.create(
600
+ "test-service-user",
601
+ expires_in=datetime.timedelta(days=365).total_seconds(),
602
+ )
603
+ ```
604
+ """
605
+ if not self._workspace._is_hydrated:
606
+ await self._workspace.hydrate()
607
+
608
+ if expires_in is None:
609
+ req = api_pb2.ServiceUserCreateRequest(name=name)
610
+ else:
611
+ req = api_pb2.ServiceUserCreateRequest(name=name, expires_in_seconds=expires_in)
612
+
613
+ resp = await self._workspace.client._stub.ServiceUserCreate(req)
614
+
615
+ return TokenData(token_id=resp.token_id, token_secret=resp.token_secret)
616
+
617
+ async def set_role(
618
+ self,
619
+ service_user_name: str,
620
+ environment_name: str,
621
+ *,
622
+ role: str,
623
+ ) -> None:
624
+ """Set the role of a specified Service User within an Environment.
625
+
626
+ To call this function, you are required to have Manager permissions in the Workspace.
627
+
628
+ Args:
629
+ service_user_name: The name of the Service User.
630
+ environment_name: The name of the Environment to which the Service User's new role will
631
+ apply.
632
+ role: The access level to grant this Service User.
633
+
634
+ Examples:
635
+
636
+ ```python notest
637
+ ws = modal.Workspace.from_context()
638
+ # Grants Service User "test-service-user" the Viewer role in Environment "production"
639
+ ws.service_users.set_role("test-service-user", "production", role="viewer")
640
+
641
+ # Revokes access to "production" from Service User "test-service-user"
642
+ ws.service_users.set_role("test-service-user", "production", role="no-access")
643
+ ```
644
+ """
645
+
646
+ if not role:
647
+ raise InvalidError("Invalid argument: `role` must not be empty.")
648
+
649
+ if not self._workspace._is_hydrated:
650
+ await self._workspace.hydrate()
651
+
652
+ from ._environments import _Environment
653
+
654
+ env = _Environment.from_name(environment_name, client=self._workspace.client)
655
+ await env.hydrate()
656
+
657
+ await self._workspace.client._stub.EnvironmentRoleSet(
658
+ api_pb2.EnvironmentRoleSetRequest(
659
+ service_user_name=service_user_name,
660
+ environment_id=env.object_id,
661
+ role_str=role,
662
+ )
663
+ )
664
+
665
+ async def info(self, name: str) -> ServiceUserInfo:
666
+ """Get information about a specific Service User.
667
+
668
+ Args:
669
+ name: The name of the Service User to introspect.
670
+
671
+ Returns:
672
+ A `ServiceUserInfo` dataclass containing information about the Service User.
673
+
674
+ Examples:
675
+
676
+ ```python notest
677
+ ws = modal.Workspace.from_context()
678
+ service_user = ws.service_users.info("test-service-user")
679
+ ```
680
+ """
681
+
682
+ if not self._workspace._is_hydrated:
683
+ await self._workspace.hydrate()
684
+
685
+ resp = await self._workspace.client._stub.ServiceUserInfo(
686
+ api_pb2.ServiceUserInfoRequest(service_user_name=name)
687
+ )
688
+
689
+ return ServiceUserInfo._from_proto(resp.service_user)
690
+
691
+ async def list(self) -> list[ServiceUserInfo]:
692
+ """List all Service Users in the current workspace.
693
+
694
+ Returns:
695
+ A list of `ServiceUserInfo` dataclasses.
696
+
697
+ Examples:
698
+
699
+ ```python notest
700
+ ws = modal.Workspace.from_context()
701
+ for service_user in ws.service_users.list():
702
+ print(service_user.name)
703
+ ```
704
+ """
705
+
706
+ if not self._workspace._is_hydrated:
707
+ await self._workspace.hydrate()
708
+
709
+ resp = await self._workspace.client._stub.ServiceUserList(Empty())
710
+
711
+ return [ServiceUserInfo._from_proto(su) for su in resp.service_users]
712
+
713
+ async def delete(self, name: str, *, allow_missing: bool = False) -> None:
714
+ """Permanently delete a Service User.
715
+
716
+ Args:
717
+ name: The name of the Service User to delete.
718
+ allow_missing: If `True`, do not throw an exception if the Service User does not exist.
719
+
720
+ Examples:
721
+
722
+ ```python notest
723
+ ws = modal.Workspace.from_context()
724
+ ws.service_users.delete("test-service-user")
725
+ ```
726
+ """
727
+
728
+ if not self._workspace._is_hydrated:
729
+ await self._workspace.hydrate()
730
+
731
+ try:
732
+ await self._workspace.client._stub.ServiceUserDelete(
733
+ api_pb2.ServiceUserDeleteRequest(service_user_name=name)
734
+ )
735
+ except NotFoundError:
736
+ if not allow_missing:
737
+ raise
@@ -7,11 +7,14 @@ or the app lookup of `modal deploy some_file.py`.
7
7
  These functions are only called by the Modal CLI, not in tasks.
8
8
  """
9
9
 
10
+ import atexit
10
11
  import dataclasses
11
12
  import importlib
12
13
  import importlib.util
13
14
  import inspect
15
+ import shutil
14
16
  import sys
17
+ import tempfile
15
18
  import typing
16
19
  from collections import defaultdict
17
20
  from dataclasses import dataclass
@@ -60,15 +63,40 @@ def parse_import_ref(object_ref: str, use_module_mode: bool = False, command: st
60
63
 
61
64
  DEFAULT_APP_NAME = "app"
62
65
 
66
+ STDIN_REF = "-"
67
+ STDIN_MODULE_NAME = "modal_stdin_app"
63
68
 
64
- def import_file_or_module(import_ref: ImportRef, base_cmd: str = ""):
69
+
70
+ def _write_stdin_script() -> str:
71
+ if sys.stdin is None or sys.stdin.isatty():
72
+ raise InvalidError("No script was piped on stdin. Usage: `cat my_app.py | modal run -`")
73
+ source = sys.stdin.read()
74
+ # The file must outlive the import: the entrypoint mount is built from it when the App runs.
75
+ tmp_dir = tempfile.mkdtemp(prefix="modal-stdin-")
76
+ atexit.register(shutil.rmtree, tmp_dir, ignore_errors=True)
77
+ script_path = Path(tmp_dir) / f"{STDIN_MODULE_NAME}.py"
78
+ script_path.write_text(source)
79
+ return str(script_path)
80
+
81
+
82
+ def import_file_or_module(import_ref: ImportRef, base_cmd: str = "", allow_stdin: bool = False):
65
83
  if "" not in sys.path:
66
84
  # When running from a CLI like `modal run`
67
85
  # the current working directory isn't added to sys.path
68
86
  # so we add it in order to make module path specification possible
69
87
  sys.path.insert(0, "") # "" means the current working directory
70
88
 
71
- if not import_ref.file_or_module.endswith(".py") or import_ref.use_module_mode:
89
+ from_stdin = import_ref.file_or_module == STDIN_REF
90
+ if from_stdin:
91
+ if not allow_stdin:
92
+ raise InvalidError(f"`{base_cmd}` does not support reading a script from stdin.")
93
+ if import_ref.use_module_mode:
94
+ raise InvalidError("Reading a script from stdin (`-`) can't be combined with the -m flag.")
95
+ script_path = _write_stdin_script()
96
+ else:
97
+ script_path = import_ref.file_or_module
98
+
99
+ if not script_path.endswith(".py") or import_ref.use_module_mode:
72
100
  if not import_ref.use_module_mode:
73
101
  raise InvalidError(
74
102
  "Python module paths must be specified with the -m flag. "
@@ -82,7 +110,7 @@ def import_file_or_module(import_ref: ImportRef, base_cmd: str = ""):
82
110
  else:
83
111
  # when using a script path, that scripts directory should also be on the path as it is
84
112
  # with `python some/script.py`
85
- full_path = Path(import_ref.file_or_module).resolve()
113
+ full_path = Path(script_path).resolve()
86
114
  if "." in full_path.name.removesuffix(".py"):
87
115
  raise InvalidError(
88
116
  f"Invalid Modal source filename: {full_path.name!r}."
@@ -90,10 +118,10 @@ def import_file_or_module(import_ref: ImportRef, base_cmd: str = ""):
90
118
  )
91
119
  sys.path.insert(0, str(full_path.parent))
92
120
 
93
- module_name = inspect.getmodulename(import_ref.file_or_module)
121
+ module_name = inspect.getmodulename(script_path)
94
122
  assert module_name is not None
95
123
  # Import the module - see https://docs.python.org/3/library/importlib.html#importing-a-source-file-directly
96
- spec = importlib.util.spec_from_file_location(module_name, import_ref.file_or_module)
124
+ spec = importlib.util.spec_from_file_location(module_name, script_path)
97
125
  assert spec is not None
98
126
  module = importlib.util.module_from_spec(spec)
99
127
  sys.modules[module_name] = module
@@ -103,7 +131,7 @@ def import_file_or_module(import_ref: ImportRef, base_cmd: str = ""):
103
131
  spec.loader.exec_module(module)
104
132
  except Exception as exc:
105
133
  if isinstance(exc, ImportError) and "attempted relative import with no known parent package" in str(exc):
106
- if import_ref.file_or_module and import_ref.command and not import_ref.use_module_mode:
134
+ if import_ref.command and not import_ref.use_module_mode and not from_stdin:
107
135
  file_path = Path(import_ref.file_or_module)
108
136
  suggested_module_path = ".".join(file_path.parts).removesuffix(".py").lstrip(".")
109
137
  suffix = f"::{import_ref.object_path}" if import_ref.object_path else ""
@@ -356,6 +384,7 @@ def import_and_filter(
356
384
  accept_local_entrypoint=True,
357
385
  accept_webhook=False,
358
386
  accept_service_functions=False,
387
+ allow_stdin=False,
359
388
  ) -> tuple[Runnable | None, list[CLICommand]]:
360
389
  """Takes a function ref string and returns a single determined "runnable" to use, and a list of all available
361
390
  runnables.
@@ -371,7 +400,7 @@ def import_and_filter(
371
400
  3. if there is a single method (within a class) that one is used
372
401
  """
373
402
  # all commands:
374
- module = import_file_or_module(import_ref, base_cmd)
403
+ module = import_file_or_module(import_ref, base_cmd, allow_stdin=allow_stdin)
375
404
  cli_commands = list_cli_commands(
376
405
  dict(inspect.getmembers(module)),
377
406
  include_service_functions=accept_service_functions,
@@ -2,7 +2,9 @@
2
2
  import asyncio
3
3
  import functools
4
4
  import inspect
5
+ import os
5
6
  import re
7
+ import stat
6
8
  import sys
7
9
  import time
8
10
  import typing
@@ -25,6 +27,7 @@ from ..runner import DEPLOYMENT_STRATEGY_TYPE, deploy_app, run_app
25
27
  from ..serving import serve_app
26
28
  from ._help import ModalCommand, ModalGroup, _consume_global_options, _global_option_token_length
27
29
  from .import_refs import (
30
+ STDIN_REF,
28
31
  CLICommand,
29
32
  MethodReference,
30
33
  _get_runnable_app,
@@ -399,6 +402,14 @@ def _get_click_command_for_local_entrypoint(app: App, entrypoint: LocalEntrypoin
399
402
  return click.command(cls=ModalCommand)(with_click_options)
400
403
 
401
404
 
405
+ def _stdin_is_piped() -> bool:
406
+ try:
407
+ mode = os.fstat(sys.stdin.fileno()).st_mode
408
+ except (AttributeError, OSError, ValueError):
409
+ return False
410
+ return stat.S_ISFIFO(mode) or stat.S_ISREG(mode)
411
+
412
+
402
413
  def _get_runnable_list(all_usable_commands: list[CLICommand]) -> str:
403
414
  usable_command_lines = []
404
415
  for cmd in all_usable_commands:
@@ -428,6 +439,8 @@ class RunGroup(ModalGroup):
428
439
  elif arg == "--":
429
440
  func_ref_index += 1
430
441
  break
442
+ elif arg == STDIN_REF:
443
+ break
431
444
  elif param := option_params.get(arg.split("=", 1)[0]):
432
445
  func_ref_index += 1 if "=" in arg or param.is_flag else param.nargs + 1
433
446
  elif arg.startswith("-"):
@@ -435,6 +448,14 @@ class RunGroup(ModalGroup):
435
448
  else:
436
449
  break
437
450
 
451
+ missing_func_ref = func_ref_index >= len(args)
452
+ requests_help = any(arg in ctx.help_option_names for arg in args)
453
+ if missing_func_ref and not requests_help and not ctx.resilient_parsing and _stdin_is_piped():
454
+ raise click.UsageError(
455
+ f"Missing FUNC_REF. To read the script from stdin, pass `{STDIN_REF}`: `cat my_app.py | modal run -`",
456
+ ctx,
457
+ )
458
+
438
459
  args[:] = _consume_global_options(ctx, args[:func_ref_index]) + args[func_ref_index:]
439
460
  return click.Group.parse_args(self, ctx, args)
440
461
 
@@ -448,9 +469,23 @@ class RunGroup(ModalGroup):
448
469
  func_ref = cmd_name
449
470
 
450
471
  import_ref = parse_import_ref(func_ref, use_module_mode=ctx.params["m"], command="modal run")
472
+ from_stdin = import_ref.file_or_module == STDIN_REF
473
+ if from_stdin and ctx.params["interactive"]:
474
+ raise ClickException("Interactive mode can't be used when reading a script from stdin.")
451
475
  runnable, all_usable_commands = import_and_filter(
452
- import_ref, base_cmd="modal run", accept_local_entrypoint=True, accept_webhook=False
476
+ import_ref, base_cmd="modal run", accept_local_entrypoint=True, accept_webhook=False, allow_stdin=True
453
477
  )
478
+ if not runnable and from_stdin:
479
+ help_header = (
480
+ "Couldn't determine what to run from the script on stdin. Define a single "
481
+ "`@app.local_entrypoint()`, or save the script to a file and pass `my_app.py::my_function`."
482
+ )
483
+ if all_usable_commands:
484
+ help_footer = "The script has the following functions and local entrypoints:\n"
485
+ help_footer += _get_runnable_list(all_usable_commands)
486
+ else:
487
+ help_footer = "The script has no functions or local entrypoints."
488
+ raise ClickException(f"{help_header}\n\n{help_footer}")
454
489
  if not runnable:
455
490
  help_header = (
456
491
  "Specify a Modal Function or local entrypoint to run. E.g.\n"
@@ -535,6 +570,21 @@ def run(
535
570
  ```
536
571
  modal run -m my_project.my_app
537
572
  ```
573
+
574
+ Pass `-` to read the script from stdin. The script must have a single local
575
+ entrypoint (or a single function):
576
+
577
+ ```
578
+ modal run - <<'EOF'
579
+ import modal
580
+
581
+ app = modal.App()
582
+
583
+ @app.function()
584
+ def hello():
585
+ print("hello from Modal")
586
+ EOF
587
+ ```
538
588
  """
539
589
  ctx.ensure_object(dict)
540
590
  ctx.obj["name"] = name