prefect-client 2.16.1__tar.gz → 2.16.3__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 (272) hide show
  1. {prefect-client-2.16.1/src/prefect_client.egg-info → prefect-client-2.16.3}/PKG-INFO +51 -49
  2. prefect-client-2.16.3/README.md +109 -0
  3. {prefect-client-2.16.1 → prefect-client-2.16.3}/requirements-client.txt +1 -0
  4. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_internal/concurrency/services.py +5 -0
  5. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_internal/concurrency/threads.py +3 -0
  6. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/client/orchestration.py +18 -0
  7. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/deployments/__init__.py +6 -1
  8. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/deployments/deployments.py +48 -8
  9. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/deployments/runner.py +72 -54
  10. prefect-client-2.16.3/src/prefect/deployments/schedules.py +37 -0
  11. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/engine.py +62 -23
  12. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/events/schemas.py +253 -43
  13. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/flows.py +71 -20
  14. prefect-client-2.16.3/src/prefect/logging/filters.py +41 -0
  15. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/results.py +78 -2
  16. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/runner/runner.py +10 -2
  17. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/server/api/collections_data/views/aggregate-worker-metadata.json +9 -2
  18. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/settings.py +63 -10
  19. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/task_engine.py +17 -9
  20. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/task_server.py +2 -1
  21. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/tasks.py +39 -4
  22. prefect-client-2.16.3/src/prefect/utilities/schema_tools/__init__.py +0 -0
  23. prefect-client-2.16.3/src/prefect/utilities/schema_tools/hydration.py +218 -0
  24. prefect-client-2.16.3/src/prefect/utilities/schema_tools/validation.py +240 -0
  25. {prefect-client-2.16.1 → prefect-client-2.16.3/src/prefect_client.egg-info}/PKG-INFO +51 -49
  26. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect_client.egg-info/SOURCES.txt +4 -0
  27. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect_client.egg-info/requires.txt +1 -0
  28. prefect-client-2.16.1/README.md +0 -107
  29. prefect-client-2.16.1/src/prefect/logging/filters.py +0 -19
  30. {prefect-client-2.16.1 → prefect-client-2.16.3}/LICENSE +0 -0
  31. {prefect-client-2.16.1 → prefect-client-2.16.3}/MANIFEST.in +0 -0
  32. {prefect-client-2.16.1 → prefect-client-2.16.3}/requirements-dev.txt +0 -0
  33. {prefect-client-2.16.1 → prefect-client-2.16.3}/requirements.txt +0 -0
  34. {prefect-client-2.16.1 → prefect-client-2.16.3}/setup.cfg +0 -0
  35. {prefect-client-2.16.1 → prefect-client-2.16.3}/setup.py +0 -0
  36. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/.prefectignore +0 -0
  37. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/__init__.py +0 -0
  38. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_internal/__init__.py +0 -0
  39. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_internal/_logging.py +0 -0
  40. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_internal/compatibility/__init__.py +0 -0
  41. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_internal/compatibility/deprecated.py +0 -0
  42. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_internal/compatibility/experimental.py +0 -0
  43. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_internal/concurrency/__init__.py +0 -0
  44. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_internal/concurrency/api.py +0 -0
  45. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_internal/concurrency/calls.py +0 -0
  46. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_internal/concurrency/cancellation.py +0 -0
  47. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_internal/concurrency/event_loop.py +0 -0
  48. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_internal/concurrency/inspection.py +0 -0
  49. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_internal/concurrency/primitives.py +0 -0
  50. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_internal/concurrency/waiters.py +0 -0
  51. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_internal/pydantic/__init__.py +0 -0
  52. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_internal/pydantic/annotations/__init__.py +0 -0
  53. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_internal/pydantic/annotations/pendulum.py +0 -0
  54. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_internal/pydantic/schemas.py +0 -0
  55. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_internal/pydantic/v2_schema.py +0 -0
  56. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_internal/pydantic/v2_validated_func.py +0 -0
  57. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_internal/pytz.py +0 -0
  58. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_internal/schemas/__init__.py +0 -0
  59. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_internal/schemas/bases.py +0 -0
  60. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_internal/schemas/fields.py +0 -0
  61. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_internal/schemas/serializers.py +0 -0
  62. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_internal/schemas/transformations.py +0 -0
  63. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_internal/schemas/validators.py +0 -0
  64. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/__init__.py +0 -0
  65. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/__init__.py +0 -0
  66. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/applications.py +0 -0
  67. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/background.py +0 -0
  68. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/concurrency.py +0 -0
  69. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/datastructures.py +0 -0
  70. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/dependencies/__init__.py +0 -0
  71. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/dependencies/models.py +0 -0
  72. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/dependencies/utils.py +0 -0
  73. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/encoders.py +0 -0
  74. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/exception_handlers.py +0 -0
  75. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/exceptions.py +0 -0
  76. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/logger.py +0 -0
  77. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/middleware/__init__.py +0 -0
  78. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/middleware/asyncexitstack.py +0 -0
  79. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/middleware/cors.py +0 -0
  80. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/middleware/gzip.py +0 -0
  81. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/middleware/httpsredirect.py +0 -0
  82. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/middleware/trustedhost.py +0 -0
  83. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/middleware/wsgi.py +0 -0
  84. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/openapi/__init__.py +0 -0
  85. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/openapi/constants.py +0 -0
  86. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/openapi/docs.py +0 -0
  87. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/openapi/models.py +0 -0
  88. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/openapi/utils.py +0 -0
  89. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/param_functions.py +0 -0
  90. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/params.py +0 -0
  91. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/requests.py +0 -0
  92. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/responses.py +0 -0
  93. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/routing.py +0 -0
  94. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/security/__init__.py +0 -0
  95. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/security/api_key.py +0 -0
  96. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/security/base.py +0 -0
  97. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/security/http.py +0 -0
  98. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/security/oauth2.py +0 -0
  99. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/security/open_id_connect_url.py +0 -0
  100. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/security/utils.py +0 -0
  101. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/staticfiles.py +0 -0
  102. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/templating.py +0 -0
  103. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/testclient.py +0 -0
  104. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/types.py +0 -0
  105. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/utils.py +0 -0
  106. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/websockets.py +0 -0
  107. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/__init__.py +0 -0
  108. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/_compat.py +0 -0
  109. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/_exception_handler.py +0 -0
  110. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/_utils.py +0 -0
  111. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/applications.py +0 -0
  112. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/authentication.py +0 -0
  113. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/background.py +0 -0
  114. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/concurrency.py +0 -0
  115. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/config.py +0 -0
  116. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/convertors.py +0 -0
  117. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/datastructures.py +0 -0
  118. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/endpoints.py +0 -0
  119. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/exceptions.py +0 -0
  120. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/formparsers.py +0 -0
  121. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/middleware/__init__.py +0 -0
  122. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/middleware/authentication.py +0 -0
  123. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/middleware/base.py +0 -0
  124. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/middleware/cors.py +0 -0
  125. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/middleware/errors.py +0 -0
  126. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/middleware/exceptions.py +0 -0
  127. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/middleware/gzip.py +0 -0
  128. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/middleware/httpsredirect.py +0 -0
  129. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/middleware/sessions.py +0 -0
  130. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/middleware/trustedhost.py +0 -0
  131. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/middleware/wsgi.py +0 -0
  132. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/requests.py +0 -0
  133. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/responses.py +0 -0
  134. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/routing.py +0 -0
  135. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/schemas.py +0 -0
  136. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/staticfiles.py +0 -0
  137. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/status.py +0 -0
  138. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/templating.py +0 -0
  139. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/testclient.py +0 -0
  140. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/types.py +0 -0
  141. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/websockets.py +0 -0
  142. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/_version.py +0 -0
  143. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/agent.py +0 -0
  144. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/blocks/__init__.py +0 -0
  145. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/blocks/abstract.py +0 -0
  146. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/blocks/core.py +0 -0
  147. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/blocks/fields.py +0 -0
  148. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/blocks/kubernetes.py +0 -0
  149. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/blocks/notifications.py +0 -0
  150. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/blocks/system.py +0 -0
  151. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/blocks/webhook.py +0 -0
  152. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/client/__init__.py +0 -0
  153. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/client/base.py +0 -0
  154. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/client/cloud.py +0 -0
  155. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/client/collections.py +0 -0
  156. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/client/constants.py +0 -0
  157. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/client/schemas/__init__.py +0 -0
  158. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/client/schemas/actions.py +0 -0
  159. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/client/schemas/filters.py +0 -0
  160. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/client/schemas/objects.py +0 -0
  161. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/client/schemas/responses.py +0 -0
  162. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/client/schemas/schedules.py +0 -0
  163. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/client/schemas/sorting.py +0 -0
  164. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/client/subscriptions.py +0 -0
  165. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/client/utilities.py +0 -0
  166. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/concurrency/__init__.py +0 -0
  167. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/concurrency/asyncio.py +0 -0
  168. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/concurrency/common.py +0 -0
  169. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/concurrency/events.py +0 -0
  170. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/concurrency/services.py +0 -0
  171. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/concurrency/sync.py +0 -0
  172. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/context.py +0 -0
  173. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/deployments/base.py +0 -0
  174. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/deployments/steps/__init__.py +0 -0
  175. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/deployments/steps/core.py +0 -0
  176. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/deployments/steps/pull.py +0 -0
  177. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/deployments/steps/utility.py +0 -0
  178. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/deprecated/__init__.py +0 -0
  179. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/deprecated/data_documents.py +0 -0
  180. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/events/__init__.py +0 -0
  181. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/events/actions.py +0 -0
  182. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/events/clients.py +0 -0
  183. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/events/filters.py +0 -0
  184. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/events/instrument.py +0 -0
  185. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/events/related.py +0 -0
  186. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/events/utilities.py +0 -0
  187. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/events/worker.py +0 -0
  188. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/exceptions.py +0 -0
  189. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/filesystems.py +0 -0
  190. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/flow_runs.py +0 -0
  191. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/futures.py +0 -0
  192. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/infrastructure/__init__.py +0 -0
  193. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/infrastructure/base.py +0 -0
  194. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/infrastructure/container.py +0 -0
  195. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/infrastructure/kubernetes.py +0 -0
  196. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/infrastructure/process.py +0 -0
  197. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/infrastructure/provisioners/__init__.py +0 -0
  198. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/infrastructure/provisioners/cloud_run.py +0 -0
  199. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/infrastructure/provisioners/container_instance.py +0 -0
  200. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/infrastructure/provisioners/ecs.py +0 -0
  201. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/infrastructure/provisioners/modal.py +0 -0
  202. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/input/__init__.py +0 -0
  203. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/input/actions.py +0 -0
  204. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/input/run_input.py +0 -0
  205. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/logging/__init__.py +0 -0
  206. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/logging/configuration.py +0 -0
  207. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/logging/formatters.py +0 -0
  208. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/logging/handlers.py +0 -0
  209. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/logging/highlighters.py +0 -0
  210. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/logging/loggers.py +0 -0
  211. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/logging/logging.yml +0 -0
  212. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/manifests.py +0 -0
  213. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/packaging/__init__.py +0 -0
  214. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/packaging/base.py +0 -0
  215. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/packaging/docker.py +0 -0
  216. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/packaging/file.py +0 -0
  217. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/packaging/orion.py +0 -0
  218. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/packaging/serializers.py +0 -0
  219. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/plugins.py +0 -0
  220. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/profiles.toml +0 -0
  221. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/py.typed +0 -0
  222. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/runner/__init__.py +0 -0
  223. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/runner/server.py +0 -0
  224. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/runner/storage.py +0 -0
  225. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/runner/submit.py +0 -0
  226. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/runner/utils.py +0 -0
  227. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/runtime/__init__.py +0 -0
  228. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/runtime/deployment.py +0 -0
  229. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/runtime/flow_run.py +0 -0
  230. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/runtime/task_run.py +0 -0
  231. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/serializers.py +0 -0
  232. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/server/api/static/prefect-logo-mark-gradient.png +0 -0
  233. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/software/__init__.py +0 -0
  234. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/software/base.py +0 -0
  235. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/software/conda.py +0 -0
  236. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/software/pip.py +0 -0
  237. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/software/python.py +0 -0
  238. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/states.py +0 -0
  239. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/task_runners.py +0 -0
  240. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/utilities/__init__.py +0 -0
  241. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/utilities/annotations.py +0 -0
  242. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/utilities/asyncutils.py +0 -0
  243. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/utilities/callables.py +0 -0
  244. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/utilities/collections.py +0 -0
  245. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/utilities/compat.py +0 -0
  246. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/utilities/context.py +0 -0
  247. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/utilities/dispatch.py +0 -0
  248. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/utilities/dockerutils.py +0 -0
  249. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/utilities/filesystem.py +0 -0
  250. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/utilities/hashing.py +0 -0
  251. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/utilities/importtools.py +0 -0
  252. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/utilities/math.py +0 -0
  253. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/utilities/names.py +0 -0
  254. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/utilities/processutils.py +0 -0
  255. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/utilities/pydantic.py +0 -0
  256. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/utilities/render_swagger.py +0 -0
  257. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/utilities/services.py +0 -0
  258. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/utilities/slugify.py +0 -0
  259. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/utilities/templating.py +0 -0
  260. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/utilities/text.py +0 -0
  261. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/utilities/validation.py +0 -0
  262. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/utilities/visualization.py +0 -0
  263. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/variables.py +0 -0
  264. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/workers/__init__.py +0 -0
  265. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/workers/base.py +0 -0
  266. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/workers/block.py +0 -0
  267. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/workers/process.py +0 -0
  268. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/workers/server.py +0 -0
  269. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect/workers/utilities.py +0 -0
  270. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect_client.egg-info/dependency_links.txt +0 -0
  271. {prefect-client-2.16.1 → prefect-client-2.16.3}/src/prefect_client.egg-info/top_level.txt +0 -0
  272. {prefect-client-2.16.1 → prefect-client-2.16.3}/versioneer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: prefect-client
3
- Version: 2.16.1
3
+ Version: 2.16.3
4
4
  Summary: Workflow orchestration and management.
5
5
  Home-page: https://www.prefect.io
6
6
  Author: Prefect Technologies, Inc.
@@ -13,12 +13,12 @@ Project-URL: Tracker, https://github.com/PrefectHQ/prefect/issues
13
13
  Description: <p align="center"><img src="https://github.com/PrefectHQ/prefect/assets/3407835/c654cbc6-63e8-4ada-a92a-efd2f8f24b85" width=1000></p>
14
14
 
15
15
  <p align="center">
16
- <a href="https://pypi.python.org/pypi/prefect/" alt="PyPI version">
17
- <img alt="PyPI" src="https://img.shields.io/pypi/v/prefect?color=0052FF&labelColor=090422"></a>
16
+ <a href="https://pypi.python.org/pypi/prefect-client/" alt="PyPI version">
17
+ <img alt="PyPI" src="https://img.shields.io/pypi/v/prefect-client?color=0052FF&labelColor=090422"></a>
18
18
  <a href="https://github.com/prefecthq/prefect/" alt="Stars">
19
19
  <img src="https://img.shields.io/github/stars/prefecthq/prefect?color=0052FF&labelColor=090422" /></a>
20
- <a href="https://pepy.tech/badge/prefect/" alt="Downloads">
21
- <img src="https://img.shields.io/pypi/dm/prefect?color=0052FF&labelColor=090422" /></a>
20
+ <a href="https://pepy.tech/badge/prefect-client/" alt="Downloads">
21
+ <img src="https://img.shields.io/pypi/dm/prefect-client?color=0052FF&labelColor=090422" /></a>
22
22
  <a href="https://github.com/prefecthq/prefect/pulse" alt="Activity">
23
23
  <img src="https://img.shields.io/github/commit-activity/m/prefecthq/prefect?color=0052FF&labelColor=090422" /></a>
24
24
  <br>
@@ -30,78 +30,80 @@ Description: <p align="center"><img src="https://github.com/PrefectHQ/prefect/as
30
30
  <img src="https://img.shields.io/badge/youtube-watch_videos-red.svg?color=0052FF&labelColor=090422&logo=youtube" /></a>
31
31
  </p>
32
32
 
33
- # Prefect
33
+ # prefect-client
34
34
 
35
- Prefect is an orchestration and observability platform for building, observing, and triaging workflows.
36
- It's the simplest way to transform Python code into an interactive workflow application.
35
+ The `prefect-client` package is a minimal-installation of `prefect` which is designed for interacting with Prefect Cloud
36
+ or remote any `prefect` server. It sheds some functionality and dependencies in exchange for a smaller installation size,
37
+ making it ideal for use in lightweight or ephemeral environments. These characteristics make it ideal for use in lambdas
38
+ or other resource-constrained environments.
37
39
 
38
- Prefect allows you to expose your workflows through an API so teams dependent on you can programmatically access your pipelines, business logic, and more.
39
- Prefect also allows you to standardize workflow development and deployment across your organization.
40
-
41
- With Prefect, you can build resilient, dynamic workflows that react to the world around them and recover from unexpected changes.
42
- With just a few decorators, Prefect supercharges your code with features like automatic retries, distributed execution, scheduling, caching, and much more.
43
-
44
- Every activity is tracked and can be monitored with a self-hosted [Prefect server](https://docs.prefect.io/latest/guides/host/) instance or managed [Prefect Cloud](https://www.prefect.io/cloud-vs-oss?utm_source=oss&utm_medium=oss&utm_campaign=oss_gh_repo&utm_term=none&utm_content=none) dashboard.
45
40
 
46
41
  ## Getting started
47
42
 
48
- Prefect requires Python 3.8 or later. To [install Prefect](https://docs.prefect.io/getting-started/installation/), run the following command:
43
+ `prefect-client` shares the same installation requirements as prefect. To install, make sure you are on Python 3.8 or
44
+ later and run the following command:
49
45
 
50
46
  ```bash
51
- pip install prefect
47
+ pip install prefect-client
52
48
  ```
53
49
 
54
- Then create and run a Python file that uses Prefect `flow` and `task` decorators to orchestrate and observe your workflow that fetches the number of GitHub stars from a repository.
50
+ Next, ensure that your `prefect-client` has access to a remote `prefect` server by exporting the `PREFECT_API_KEY`
51
+ (if using Prefect Cloud) and `PREFECT_API_URL` environment variables. Once those are set, use the package in your code as
52
+ you would normally use `prefect`!
53
+
54
+
55
+ For example, to remotely trigger a run a deployment:
55
56
 
56
57
  ```python
57
- from prefect import flow, task
58
- from typing import List
59
- import httpx
58
+ from prefect.deployments import run_deployment
60
59
 
61
60
 
62
- @task(log_prints=True)
63
- def get_stars(repo: str):
64
- url = f"https://api.github.com/repos/{repo}"
65
- count = httpx.get(url).json()["stargazers_count"]
66
- print(f"{repo} has {count} stars!")
61
+ def my_lambda(event):
62
+ ...
63
+ run_deployment(
64
+ name="my-flow/my-deployment",
65
+ parameters={"foo": "bar"},
66
+ timeout=0,
67
+ )
67
68
 
69
+ my_lambda({})
70
+ ```
68
71
 
69
- @flow(name="GitHub Stars")
70
- def github_stars(repos: List[str]):
71
- for repo in repos:
72
- get_stars(repo)
72
+ To emit events in an event driven system:
73
73
 
74
+ ```python
75
+ from prefect.events import emit_event
74
76
 
75
- # run the flow!
76
- if __name__=="__main__":
77
- github_stars(["PrefectHQ/Prefect"])
78
- ```
79
77
 
80
- Fire up the Prefect UI to see what happened:
78
+ def something_happened():
79
+ emit_event("my-event", resource={"prefect.resource.id": "foo.bar"})
81
80
 
82
- ```bash
83
- prefect server start
81
+ something_happened()
84
82
  ```
85
83
 
86
- ![Prefect UI dashboard](/docs/img/ui/cloud-dashboard.png)
87
-
88
- To run your workflow on a schedule, turn it into a deployment and schedule it to run every minute by changing the last line of your script to the following:
89
84
 
85
+ Or just interact with a `prefect` API:
90
86
  ```python
91
- github_stars.serve(name="first-deployment", cron="* * * * *")
92
- ```
87
+ from prefect.client.orchestration import get_client
93
88
 
94
- You now have a server running locally that is looking for scheduled deployments!
95
- Additionally you can run your workflow manually from the UI or CLI - and if you're using Prefect Cloud, you can even run deployments in response to [events](https://docs.prefect.io/latest/concepts/automations/).
96
89
 
97
- ## Prefect Cloud
90
+ async def query_api():
91
+ async with get_client() as client:
92
+ limits = await client.read_concurrency_limits(limit=10, offset=0)
93
+ print(limits)
94
+
95
+
96
+ query_api()
97
+ ```
98
98
 
99
- Stop worrying about your workflows.
100
- Prefect Cloud allows you to centrally deploy, monitor, and manage the data workflows you support. With managed orchestration, automations, and webhooks, all backed by enterprise-class security, build production-ready code quickly and reliably.
101
99
 
102
- Read more about Prefect Cloud [here](https://www.prefect.io/cloud-vs-oss?utm_source=oss&utm_medium=oss&utm_campaign=oss_gh_repo&utm_term=none&utm_content=none) or sign up to [try it for yourself](https://app.prefect.cloud?utm_source=oss&utm_medium=oss&utm_campaign=oss_gh_repo&utm_term=none&utm_content=none).
100
+ ## Known limitations
101
+ By design, `prefect-client` omits all CLI and server components. This means that the CLI is not available for use
102
+ and attempts to access server objects will fail. Furthermore, some classes, methods, and objects may be available
103
+ for import in `prefect-client` but may not be "runnable" if they tap into server-oriented functionality. If you
104
+ encounter such a limitation, feel free to [open an issue](https://github.com/PrefectHQ/prefect/issues/new/choose)
105
+ describing the functionality you are interested in using and we will do our best to make it available.
103
106
 
104
- ![Prefect Automations](/docs/img/ui/automations.png)
105
107
 
106
108
  ## Next steps
107
109
 
@@ -0,0 +1,109 @@
1
+ <p align="center"><img src="https://github.com/PrefectHQ/prefect/assets/3407835/c654cbc6-63e8-4ada-a92a-efd2f8f24b85" width=1000></p>
2
+
3
+ <p align="center">
4
+ <a href="https://pypi.python.org/pypi/prefect-client/" alt="PyPI version">
5
+ <img alt="PyPI" src="https://img.shields.io/pypi/v/prefect-client?color=0052FF&labelColor=090422"></a>
6
+ <a href="https://github.com/prefecthq/prefect/" alt="Stars">
7
+ <img src="https://img.shields.io/github/stars/prefecthq/prefect?color=0052FF&labelColor=090422" /></a>
8
+ <a href="https://pepy.tech/badge/prefect-client/" alt="Downloads">
9
+ <img src="https://img.shields.io/pypi/dm/prefect-client?color=0052FF&labelColor=090422" /></a>
10
+ <a href="https://github.com/prefecthq/prefect/pulse" alt="Activity">
11
+ <img src="https://img.shields.io/github/commit-activity/m/prefecthq/prefect?color=0052FF&labelColor=090422" /></a>
12
+ <br>
13
+ <a href="https://prefect.io/slack" alt="Slack">
14
+ <img src="https://img.shields.io/badge/slack-join_community-red.svg?color=0052FF&labelColor=090422&logo=slack" /></a>
15
+ <a href="https://discourse.prefect.io/" alt="Discourse">
16
+ <img src="https://img.shields.io/badge/discourse-browse_forum-red.svg?color=0052FF&labelColor=090422&logo=discourse" /></a>
17
+ <a href="https://www.youtube.com/c/PrefectIO/" alt="YouTube">
18
+ <img src="https://img.shields.io/badge/youtube-watch_videos-red.svg?color=0052FF&labelColor=090422&logo=youtube" /></a>
19
+ </p>
20
+
21
+ # prefect-client
22
+
23
+ The `prefect-client` package is a minimal-installation of `prefect` which is designed for interacting with Prefect Cloud
24
+ or remote any `prefect` server. It sheds some functionality and dependencies in exchange for a smaller installation size,
25
+ making it ideal for use in lightweight or ephemeral environments. These characteristics make it ideal for use in lambdas
26
+ or other resource-constrained environments.
27
+
28
+
29
+ ## Getting started
30
+
31
+ `prefect-client` shares the same installation requirements as prefect. To install, make sure you are on Python 3.8 or
32
+ later and run the following command:
33
+
34
+ ```bash
35
+ pip install prefect-client
36
+ ```
37
+
38
+ Next, ensure that your `prefect-client` has access to a remote `prefect` server by exporting the `PREFECT_API_KEY`
39
+ (if using Prefect Cloud) and `PREFECT_API_URL` environment variables. Once those are set, use the package in your code as
40
+ you would normally use `prefect`!
41
+
42
+
43
+ For example, to remotely trigger a run a deployment:
44
+
45
+ ```python
46
+ from prefect.deployments import run_deployment
47
+
48
+
49
+ def my_lambda(event):
50
+ ...
51
+ run_deployment(
52
+ name="my-flow/my-deployment",
53
+ parameters={"foo": "bar"},
54
+ timeout=0,
55
+ )
56
+
57
+ my_lambda({})
58
+ ```
59
+
60
+ To emit events in an event driven system:
61
+
62
+ ```python
63
+ from prefect.events import emit_event
64
+
65
+
66
+ def something_happened():
67
+ emit_event("my-event", resource={"prefect.resource.id": "foo.bar"})
68
+
69
+ something_happened()
70
+ ```
71
+
72
+
73
+ Or just interact with a `prefect` API:
74
+ ```python
75
+ from prefect.client.orchestration import get_client
76
+
77
+
78
+ async def query_api():
79
+ async with get_client() as client:
80
+ limits = await client.read_concurrency_limits(limit=10, offset=0)
81
+ print(limits)
82
+
83
+
84
+ query_api()
85
+ ```
86
+
87
+
88
+ ## Known limitations
89
+ By design, `prefect-client` omits all CLI and server components. This means that the CLI is not available for use
90
+ and attempts to access server objects will fail. Furthermore, some classes, methods, and objects may be available
91
+ for import in `prefect-client` but may not be "runnable" if they tap into server-oriented functionality. If you
92
+ encounter such a limitation, feel free to [open an issue](https://github.com/PrefectHQ/prefect/issues/new/choose)
93
+ describing the functionality you are interested in using and we will do our best to make it available.
94
+
95
+
96
+ ## Next steps
97
+
98
+ There's lots more you can do to orchestrate and observe your workflows with Prefect!
99
+ Start with our [friendly tutorial](https://docs.prefect.io/tutorials) or explore the [core concepts of Prefect workflows](https://docs.prefect.io/concepts/).
100
+
101
+ ## Join the community
102
+
103
+ Prefect is made possible by the fastest growing community of thousands of friendly data engineers. Join us in building a new kind of workflow system. The [Prefect Slack community](https://prefect.io/slack) is a fantastic place to learn more about Prefect, ask questions, or get help with workflow design. All community forums, including code contributions, issue discussions, and slack messages are subject to our [Code of Conduct](https://discourse.prefect.io/faq).
104
+
105
+ ## Contribute
106
+
107
+ See our [documentation on contributing to Prefect](https://docs.prefect.io/contributing/overview/).
108
+
109
+ Thanks for being part of the mission to build a new kind of workflow system and, of course, **happy engineering!**
@@ -23,6 +23,7 @@ pydantic[email]>=1.10.0,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0
23
23
  python_dateutil >= 2.8.2, < 3.0.0
24
24
  python-slugify >= 5.0, < 9.0
25
25
  pyyaml >= 5.4.1, < 7.0.0
26
+ rfc3339-validator >= 0.1.4, < 0.2.0
26
27
  rich >= 11.0, < 14.0
27
28
  ruamel.yaml >= 0.17.0
28
29
  sniffio >=1.3.0, < 2.0.0
@@ -91,6 +91,11 @@ class QueueService(abc.ABC, Generic[T]):
91
91
  self._remove_instance()
92
92
  self._stopped = True
93
93
 
94
+ # Allow asyncio task to be garbage-collected. Its context may contain
95
+ # references to all Prefect Task calls made during a flow run, through
96
+ # EngineContext. Issue #10338.
97
+ self._task = None
98
+
94
99
  # Signal completion to the loop
95
100
  self._queue.put_nowait(None)
96
101
 
@@ -214,6 +214,9 @@ class EventLoopThread(Portal):
214
214
  for call in self._on_shutdown:
215
215
  await self._run_call(call)
216
216
 
217
+ # Empty the list to allow calls to be garbage collected. Issue #10338.
218
+ self._on_shutdown = []
219
+
217
220
  async def _run_call(self, call: Call) -> None:
218
221
  task = call.run()
219
222
  if task is not None:
@@ -2215,6 +2215,24 @@ class PrefectClient:
2215
2215
  response = await self._client.post("/task_runs/filter", json=body)
2216
2216
  return pydantic.parse_obj_as(List[TaskRun], response.json())
2217
2217
 
2218
+ async def delete_task_run(self, task_run_id: UUID) -> None:
2219
+ """
2220
+ Delete a task run by id.
2221
+
2222
+ Args:
2223
+ task_run_id: the task run ID of interest
2224
+ Raises:
2225
+ prefect.exceptions.ObjectNotFound: If request returns 404
2226
+ httpx.RequestError: If requests fails
2227
+ """
2228
+ try:
2229
+ await self._client.delete(f"/task_runs/{task_run_id}")
2230
+ except httpx.HTTPStatusError as e:
2231
+ if e.response.status_code == 404:
2232
+ raise prefect.exceptions.ObjectNotFound(http_exc=e) from e
2233
+ else:
2234
+ raise
2235
+
2218
2236
  async def set_task_run_state(
2219
2237
  self,
2220
2238
  task_run_id: UUID,
@@ -12,4 +12,9 @@ from prefect.deployments.deployments import (
12
12
  load_deployments_from_yaml,
13
13
  Deployment,
14
14
  )
15
- from prefect.deployments.runner import RunnerDeployment, deploy, DeploymentImage
15
+ from prefect.deployments.runner import (
16
+ RunnerDeployment,
17
+ deploy,
18
+ DeploymentImage,
19
+ EntrypointType,
20
+ )
@@ -36,6 +36,10 @@ from prefect.client.schemas.objects import (
36
36
  from prefect.client.schemas.schedules import SCHEDULE_TYPES
37
37
  from prefect.client.utilities import inject_client
38
38
  from prefect.context import FlowRunContext, PrefectObjectRegistry, TaskRunContext
39
+ from prefect.deployments.schedules import (
40
+ FlexibleScheduleList,
41
+ normalize_to_minimal_deployment_schedules,
42
+ )
39
43
  from prefect.deployments.steps.core import run_steps
40
44
  from prefect.events.schemas import DeploymentTrigger
41
45
  from prefect.exceptions import (
@@ -222,12 +226,28 @@ async def load_flow_from_flow_run(
222
226
  is largely for testing, and assumes the flow is already available locally.
223
227
  """
224
228
  deployment = await client.read_deployment(flow_run.deployment_id)
229
+
230
+ if deployment.entrypoint is None:
231
+ raise ValueError(
232
+ f"Deployment {deployment.id} does not have an entrypoint and can not be run."
233
+ )
234
+
225
235
  run_logger = flow_run_logger(flow_run)
226
236
 
227
237
  runner_storage_base_path = storage_base_path or os.environ.get(
228
238
  "PREFECT__STORAGE_BASE_PATH"
229
239
  )
230
240
 
241
+ # If there's no colon, assume it's a module path
242
+ if ":" not in deployment.entrypoint:
243
+ run_logger.debug(
244
+ f"Importing flow code from module path {deployment.entrypoint}"
245
+ )
246
+ flow = await run_sync_in_worker_thread(
247
+ load_flow_from_entrypoint, deployment.entrypoint
248
+ )
249
+ return flow
250
+
231
251
  if not ignore_storage and not deployment.pull_steps:
232
252
  sys.path.insert(0, ".")
233
253
  if deployment.storage_document_id:
@@ -259,8 +279,6 @@ async def load_flow_from_flow_run(
259
279
  os.chdir(output["directory"])
260
280
 
261
281
  import_path = relative_path_to_current_platform(deployment.entrypoint)
262
- run_logger.debug(f"Importing flow code from '{import_path}'")
263
-
264
282
  # for backwards compat
265
283
  if deployment.manifest_path:
266
284
  with open(deployment.manifest_path, "r") as f:
@@ -268,7 +286,10 @@ async def load_flow_from_flow_run(
268
286
  import_path = (
269
287
  Path(deployment.manifest_path).parent / import_path
270
288
  ).absolute()
289
+ run_logger.debug(f"Importing flow code from '{import_path}'")
290
+
271
291
  flow = await run_sync_in_worker_thread(load_flow_from_entrypoint, str(import_path))
292
+
272
293
  return flow
273
294
 
274
295
 
@@ -632,11 +653,17 @@ class Deployment(BaseModel):
632
653
  cls._validate_schedule(value)
633
654
  return value
634
655
 
635
- @validator("schedules")
636
- def validate_schedules(cls, value):
637
- for schedule in value:
638
- cls._validate_schedule(schedule.schedule)
639
- return value
656
+ @root_validator(pre=True)
657
+ def validate_schedules(cls, values):
658
+ if "schedules" in values:
659
+ values["schedules"] = normalize_to_minimal_deployment_schedules(
660
+ values["schedules"]
661
+ )
662
+
663
+ for schedule in values["schedules"]:
664
+ cls._validate_schedule(schedule.schedule)
665
+
666
+ return values
640
667
 
641
668
  @classmethod
642
669
  @sync_compatible
@@ -919,6 +946,7 @@ class Deployment(BaseModel):
919
946
  ignore_file: str = ".prefectignore",
920
947
  apply: bool = False,
921
948
  load_existing: bool = True,
949
+ schedules: Optional[FlexibleScheduleList] = None,
922
950
  **kwargs,
923
951
  ) -> "Deployment":
924
952
  """
@@ -938,6 +966,14 @@ class Deployment(BaseModel):
938
966
  load_existing: if True, load any settings that may already be configured for
939
967
  the named deployment server-side (e.g., schedules, default parameter
940
968
  values, etc.)
969
+ schedules: An optional list of schedules. Each item in the list can be:
970
+ - An instance of `MinimalDeploymentSchedule`.
971
+ - A dictionary with a `schedule` key, and optionally, an
972
+ `active` key. The `schedule` key should correspond to a
973
+ schedule type, and `active` is a boolean indicating whether
974
+ the schedule is active or not.
975
+ - An instance of one of the predefined schedule types:
976
+ `IntervalSchedule`, `CronSchedule`, or `RRuleSchedule`.
941
977
  **kwargs: other keyword arguments to pass to the constructor for the
942
978
  `Deployment` class
943
979
  """
@@ -946,7 +982,11 @@ class Deployment(BaseModel):
946
982
 
947
983
  # note that `deployment.load` only updates settings that were *not*
948
984
  # provided at initialization
949
- deployment = cls(name=name, **kwargs)
985
+ deployment = cls(
986
+ name=name,
987
+ schedules=schedules,
988
+ **kwargs,
989
+ )
950
990
  deployment.flow_name = flow.name
951
991
  if not deployment.entrypoint:
952
992
  ## first see if an entrypoint can be determined