prefect-client 2.16.2__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 (271) hide show
  1. {prefect-client-2.16.2/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.2 → prefect-client-2.16.3}/requirements-client.txt +1 -0
  4. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_internal/concurrency/services.py +5 -0
  5. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_internal/concurrency/threads.py +3 -0
  6. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/deployments/deployments.py +29 -6
  7. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/deployments/runner.py +15 -33
  8. prefect-client-2.16.3/src/prefect/deployments/schedules.py +37 -0
  9. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/engine.py +59 -22
  10. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/events/schemas.py +253 -43
  11. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/flows.py +26 -2
  12. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/runner/runner.py +2 -2
  13. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/server/api/collections_data/views/aggregate-worker-metadata.json +9 -2
  14. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/settings.py +34 -9
  15. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/task_engine.py +16 -8
  16. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/tasks.py +39 -4
  17. prefect-client-2.16.3/src/prefect/utilities/schema_tools/__init__.py +0 -0
  18. prefect-client-2.16.3/src/prefect/utilities/schema_tools/hydration.py +218 -0
  19. prefect-client-2.16.3/src/prefect/utilities/schema_tools/validation.py +240 -0
  20. {prefect-client-2.16.2 → prefect-client-2.16.3/src/prefect_client.egg-info}/PKG-INFO +51 -49
  21. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect_client.egg-info/SOURCES.txt +4 -0
  22. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect_client.egg-info/requires.txt +1 -0
  23. prefect-client-2.16.2/README.md +0 -107
  24. {prefect-client-2.16.2 → prefect-client-2.16.3}/LICENSE +0 -0
  25. {prefect-client-2.16.2 → prefect-client-2.16.3}/MANIFEST.in +0 -0
  26. {prefect-client-2.16.2 → prefect-client-2.16.3}/requirements-dev.txt +0 -0
  27. {prefect-client-2.16.2 → prefect-client-2.16.3}/requirements.txt +0 -0
  28. {prefect-client-2.16.2 → prefect-client-2.16.3}/setup.cfg +0 -0
  29. {prefect-client-2.16.2 → prefect-client-2.16.3}/setup.py +0 -0
  30. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/.prefectignore +0 -0
  31. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/__init__.py +0 -0
  32. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_internal/__init__.py +0 -0
  33. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_internal/_logging.py +0 -0
  34. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_internal/compatibility/__init__.py +0 -0
  35. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_internal/compatibility/deprecated.py +0 -0
  36. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_internal/compatibility/experimental.py +0 -0
  37. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_internal/concurrency/__init__.py +0 -0
  38. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_internal/concurrency/api.py +0 -0
  39. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_internal/concurrency/calls.py +0 -0
  40. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_internal/concurrency/cancellation.py +0 -0
  41. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_internal/concurrency/event_loop.py +0 -0
  42. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_internal/concurrency/inspection.py +0 -0
  43. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_internal/concurrency/primitives.py +0 -0
  44. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_internal/concurrency/waiters.py +0 -0
  45. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_internal/pydantic/__init__.py +0 -0
  46. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_internal/pydantic/annotations/__init__.py +0 -0
  47. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_internal/pydantic/annotations/pendulum.py +0 -0
  48. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_internal/pydantic/schemas.py +0 -0
  49. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_internal/pydantic/v2_schema.py +0 -0
  50. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_internal/pydantic/v2_validated_func.py +0 -0
  51. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_internal/pytz.py +0 -0
  52. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_internal/schemas/__init__.py +0 -0
  53. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_internal/schemas/bases.py +0 -0
  54. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_internal/schemas/fields.py +0 -0
  55. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_internal/schemas/serializers.py +0 -0
  56. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_internal/schemas/transformations.py +0 -0
  57. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_internal/schemas/validators.py +0 -0
  58. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/__init__.py +0 -0
  59. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/__init__.py +0 -0
  60. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/applications.py +0 -0
  61. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/background.py +0 -0
  62. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/concurrency.py +0 -0
  63. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/datastructures.py +0 -0
  64. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/dependencies/__init__.py +0 -0
  65. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/dependencies/models.py +0 -0
  66. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/dependencies/utils.py +0 -0
  67. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/encoders.py +0 -0
  68. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/exception_handlers.py +0 -0
  69. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/exceptions.py +0 -0
  70. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/logger.py +0 -0
  71. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/middleware/__init__.py +0 -0
  72. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/middleware/asyncexitstack.py +0 -0
  73. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/middleware/cors.py +0 -0
  74. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/middleware/gzip.py +0 -0
  75. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/middleware/httpsredirect.py +0 -0
  76. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/middleware/trustedhost.py +0 -0
  77. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/middleware/wsgi.py +0 -0
  78. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/openapi/__init__.py +0 -0
  79. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/openapi/constants.py +0 -0
  80. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/openapi/docs.py +0 -0
  81. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/openapi/models.py +0 -0
  82. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/openapi/utils.py +0 -0
  83. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/param_functions.py +0 -0
  84. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/params.py +0 -0
  85. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/requests.py +0 -0
  86. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/responses.py +0 -0
  87. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/routing.py +0 -0
  88. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/security/__init__.py +0 -0
  89. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/security/api_key.py +0 -0
  90. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/security/base.py +0 -0
  91. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/security/http.py +0 -0
  92. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/security/oauth2.py +0 -0
  93. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/security/open_id_connect_url.py +0 -0
  94. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/security/utils.py +0 -0
  95. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/staticfiles.py +0 -0
  96. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/templating.py +0 -0
  97. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/testclient.py +0 -0
  98. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/types.py +0 -0
  99. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/utils.py +0 -0
  100. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/fastapi/websockets.py +0 -0
  101. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/__init__.py +0 -0
  102. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/_compat.py +0 -0
  103. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/_exception_handler.py +0 -0
  104. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/_utils.py +0 -0
  105. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/applications.py +0 -0
  106. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/authentication.py +0 -0
  107. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/background.py +0 -0
  108. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/concurrency.py +0 -0
  109. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/config.py +0 -0
  110. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/convertors.py +0 -0
  111. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/datastructures.py +0 -0
  112. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/endpoints.py +0 -0
  113. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/exceptions.py +0 -0
  114. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/formparsers.py +0 -0
  115. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/middleware/__init__.py +0 -0
  116. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/middleware/authentication.py +0 -0
  117. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/middleware/base.py +0 -0
  118. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/middleware/cors.py +0 -0
  119. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/middleware/errors.py +0 -0
  120. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/middleware/exceptions.py +0 -0
  121. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/middleware/gzip.py +0 -0
  122. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/middleware/httpsredirect.py +0 -0
  123. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/middleware/sessions.py +0 -0
  124. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/middleware/trustedhost.py +0 -0
  125. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/middleware/wsgi.py +0 -0
  126. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/requests.py +0 -0
  127. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/responses.py +0 -0
  128. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/routing.py +0 -0
  129. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/schemas.py +0 -0
  130. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/staticfiles.py +0 -0
  131. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/status.py +0 -0
  132. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/templating.py +0 -0
  133. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/testclient.py +0 -0
  134. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/types.py +0 -0
  135. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_vendor/starlette/websockets.py +0 -0
  136. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/_version.py +0 -0
  137. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/agent.py +0 -0
  138. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/blocks/__init__.py +0 -0
  139. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/blocks/abstract.py +0 -0
  140. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/blocks/core.py +0 -0
  141. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/blocks/fields.py +0 -0
  142. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/blocks/kubernetes.py +0 -0
  143. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/blocks/notifications.py +0 -0
  144. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/blocks/system.py +0 -0
  145. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/blocks/webhook.py +0 -0
  146. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/client/__init__.py +0 -0
  147. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/client/base.py +0 -0
  148. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/client/cloud.py +0 -0
  149. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/client/collections.py +0 -0
  150. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/client/constants.py +0 -0
  151. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/client/orchestration.py +0 -0
  152. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/client/schemas/__init__.py +0 -0
  153. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/client/schemas/actions.py +0 -0
  154. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/client/schemas/filters.py +0 -0
  155. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/client/schemas/objects.py +0 -0
  156. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/client/schemas/responses.py +0 -0
  157. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/client/schemas/schedules.py +0 -0
  158. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/client/schemas/sorting.py +0 -0
  159. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/client/subscriptions.py +0 -0
  160. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/client/utilities.py +0 -0
  161. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/concurrency/__init__.py +0 -0
  162. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/concurrency/asyncio.py +0 -0
  163. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/concurrency/common.py +0 -0
  164. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/concurrency/events.py +0 -0
  165. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/concurrency/services.py +0 -0
  166. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/concurrency/sync.py +0 -0
  167. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/context.py +0 -0
  168. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/deployments/__init__.py +0 -0
  169. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/deployments/base.py +0 -0
  170. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/deployments/steps/__init__.py +0 -0
  171. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/deployments/steps/core.py +0 -0
  172. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/deployments/steps/pull.py +0 -0
  173. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/deployments/steps/utility.py +0 -0
  174. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/deprecated/__init__.py +0 -0
  175. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/deprecated/data_documents.py +0 -0
  176. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/events/__init__.py +0 -0
  177. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/events/actions.py +0 -0
  178. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/events/clients.py +0 -0
  179. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/events/filters.py +0 -0
  180. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/events/instrument.py +0 -0
  181. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/events/related.py +0 -0
  182. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/events/utilities.py +0 -0
  183. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/events/worker.py +0 -0
  184. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/exceptions.py +0 -0
  185. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/filesystems.py +0 -0
  186. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/flow_runs.py +0 -0
  187. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/futures.py +0 -0
  188. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/infrastructure/__init__.py +0 -0
  189. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/infrastructure/base.py +0 -0
  190. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/infrastructure/container.py +0 -0
  191. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/infrastructure/kubernetes.py +0 -0
  192. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/infrastructure/process.py +0 -0
  193. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/infrastructure/provisioners/__init__.py +0 -0
  194. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/infrastructure/provisioners/cloud_run.py +0 -0
  195. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/infrastructure/provisioners/container_instance.py +0 -0
  196. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/infrastructure/provisioners/ecs.py +0 -0
  197. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/infrastructure/provisioners/modal.py +0 -0
  198. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/input/__init__.py +0 -0
  199. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/input/actions.py +0 -0
  200. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/input/run_input.py +0 -0
  201. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/logging/__init__.py +0 -0
  202. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/logging/configuration.py +0 -0
  203. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/logging/filters.py +0 -0
  204. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/logging/formatters.py +0 -0
  205. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/logging/handlers.py +0 -0
  206. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/logging/highlighters.py +0 -0
  207. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/logging/loggers.py +0 -0
  208. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/logging/logging.yml +0 -0
  209. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/manifests.py +0 -0
  210. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/packaging/__init__.py +0 -0
  211. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/packaging/base.py +0 -0
  212. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/packaging/docker.py +0 -0
  213. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/packaging/file.py +0 -0
  214. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/packaging/orion.py +0 -0
  215. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/packaging/serializers.py +0 -0
  216. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/plugins.py +0 -0
  217. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/profiles.toml +0 -0
  218. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/py.typed +0 -0
  219. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/results.py +0 -0
  220. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/runner/__init__.py +0 -0
  221. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/runner/server.py +0 -0
  222. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/runner/storage.py +0 -0
  223. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/runner/submit.py +0 -0
  224. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/runner/utils.py +0 -0
  225. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/runtime/__init__.py +0 -0
  226. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/runtime/deployment.py +0 -0
  227. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/runtime/flow_run.py +0 -0
  228. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/runtime/task_run.py +0 -0
  229. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/serializers.py +0 -0
  230. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/server/api/static/prefect-logo-mark-gradient.png +0 -0
  231. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/software/__init__.py +0 -0
  232. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/software/base.py +0 -0
  233. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/software/conda.py +0 -0
  234. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/software/pip.py +0 -0
  235. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/software/python.py +0 -0
  236. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/states.py +0 -0
  237. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/task_runners.py +0 -0
  238. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/task_server.py +0 -0
  239. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/utilities/__init__.py +0 -0
  240. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/utilities/annotations.py +0 -0
  241. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/utilities/asyncutils.py +0 -0
  242. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/utilities/callables.py +0 -0
  243. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/utilities/collections.py +0 -0
  244. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/utilities/compat.py +0 -0
  245. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/utilities/context.py +0 -0
  246. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/utilities/dispatch.py +0 -0
  247. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/utilities/dockerutils.py +0 -0
  248. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/utilities/filesystem.py +0 -0
  249. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/utilities/hashing.py +0 -0
  250. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/utilities/importtools.py +0 -0
  251. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/utilities/math.py +0 -0
  252. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/utilities/names.py +0 -0
  253. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/utilities/processutils.py +0 -0
  254. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/utilities/pydantic.py +0 -0
  255. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/utilities/render_swagger.py +0 -0
  256. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/utilities/services.py +0 -0
  257. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/utilities/slugify.py +0 -0
  258. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/utilities/templating.py +0 -0
  259. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/utilities/text.py +0 -0
  260. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/utilities/validation.py +0 -0
  261. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/utilities/visualization.py +0 -0
  262. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/variables.py +0 -0
  263. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/workers/__init__.py +0 -0
  264. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/workers/base.py +0 -0
  265. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/workers/block.py +0 -0
  266. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/workers/process.py +0 -0
  267. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/workers/server.py +0 -0
  268. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect/workers/utilities.py +0 -0
  269. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect_client.egg-info/dependency_links.txt +0 -0
  270. {prefect-client-2.16.2 → prefect-client-2.16.3}/src/prefect_client.egg-info/top_level.txt +0 -0
  271. {prefect-client-2.16.2 → 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.2
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:
@@ -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 (
@@ -649,11 +653,17 @@ class Deployment(BaseModel):
649
653
  cls._validate_schedule(value)
650
654
  return value
651
655
 
652
- @validator("schedules")
653
- def validate_schedules(cls, value):
654
- for schedule in value:
655
- cls._validate_schedule(schedule.schedule)
656
- 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
657
667
 
658
668
  @classmethod
659
669
  @sync_compatible
@@ -936,6 +946,7 @@ class Deployment(BaseModel):
936
946
  ignore_file: str = ".prefectignore",
937
947
  apply: bool = False,
938
948
  load_existing: bool = True,
949
+ schedules: Optional[FlexibleScheduleList] = None,
939
950
  **kwargs,
940
951
  ) -> "Deployment":
941
952
  """
@@ -955,6 +966,14 @@ class Deployment(BaseModel):
955
966
  load_existing: if True, load any settings that may already be configured for
956
967
  the named deployment server-side (e.g., schedules, default parameter
957
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`.
958
977
  **kwargs: other keyword arguments to pass to the constructor for the
959
978
  `Deployment` class
960
979
  """
@@ -963,7 +982,11 @@ class Deployment(BaseModel):
963
982
 
964
983
  # note that `deployment.load` only updates settings that were *not*
965
984
  # provided at initialization
966
- deployment = cls(name=name, **kwargs)
985
+ deployment = cls(
986
+ name=name,
987
+ schedules=schedules,
988
+ **kwargs,
989
+ )
967
990
  deployment.flow_name = flow.name
968
991
  if not deployment.entrypoint:
969
992
  ## first see if an entrypoint can be determined
@@ -34,7 +34,7 @@ import importlib
34
34
  import tempfile
35
35
  from datetime import datetime, timedelta
36
36
  from pathlib import Path
37
- from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Union, get_args
37
+ from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Union
38
38
  from uuid import UUID
39
39
 
40
40
  import pendulum
@@ -63,6 +63,11 @@ from prefect.client.schemas.schedules import (
63
63
  SCHEDULE_TYPES,
64
64
  construct_schedule,
65
65
  )
66
+ from prefect.deployments.schedules import (
67
+ FlexibleScheduleList,
68
+ create_minimal_deployment_schedule,
69
+ normalize_to_minimal_deployment_schedules,
70
+ )
66
71
  from prefect.events.schemas import DeploymentTrigger
67
72
  from prefect.exceptions import (
68
73
  ObjectNotFound,
@@ -83,18 +88,9 @@ from prefect.utilities.slugify import slugify
83
88
  if TYPE_CHECKING:
84
89
  from prefect.flows import Flow
85
90
 
86
- FlexibleScheduleList = Union[MinimalDeploymentSchedule, dict, SCHEDULE_TYPES]
87
-
88
91
  __all__ = ["RunnerDeployment"]
89
92
 
90
93
 
91
- def _to_deployment_schedule(
92
- schedule: Optional[SCHEDULE_TYPES] = None,
93
- active: Optional[bool] = True,
94
- ) -> MinimalDeploymentSchedule:
95
- return MinimalDeploymentSchedule(schedule=schedule, active=active)
96
-
97
-
98
94
  class DeploymentApplyError(RuntimeError):
99
95
  """
100
96
  Raised when an error occurs while applying a deployment.
@@ -264,23 +260,9 @@ class RunnerDeployment(BaseModel):
264
260
  schedules = values.get("schedules")
265
261
 
266
262
  if schedules is None and schedule is not None:
267
- values["schedules"] = [_to_deployment_schedule(schedule)]
263
+ values["schedules"] = [create_minimal_deployment_schedule(schedule)]
268
264
  elif schedules is not None and len(schedules) > 0:
269
- reconciled = []
270
- for obj in schedules:
271
- if isinstance(obj, get_args(SCHEDULE_TYPES)):
272
- reconciled.append(_to_deployment_schedule(obj))
273
- elif isinstance(obj, dict):
274
- reconciled.append(_to_deployment_schedule(**obj))
275
- elif isinstance(obj, MinimalDeploymentSchedule):
276
- reconciled.append(obj)
277
- else:
278
- raise ValueError(
279
- "Invalid schedule provided. Must be a schedule object, a dict,"
280
- " or a MinimalDeploymentSchedule."
281
- )
282
-
283
- values["schedules"] = reconciled
265
+ values["schedules"] = normalize_to_minimal_deployment_schedules(schedules)
284
266
 
285
267
  return values
286
268
 
@@ -389,8 +371,8 @@ class RunnerDeployment(BaseModel):
389
371
  rrule: Optional[Union[Iterable[str], str]] = None,
390
372
  timezone: Optional[str] = None,
391
373
  schedule: Optional[SCHEDULE_TYPES] = None,
392
- schedules: Optional[List[FlexibleScheduleList]] = None,
393
- ) -> Union[List[MinimalDeploymentSchedule], List[FlexibleScheduleList]]:
374
+ schedules: Optional[FlexibleScheduleList] = None,
375
+ ) -> Union[List[MinimalDeploymentSchedule], FlexibleScheduleList]:
394
376
  """
395
377
  Construct a schedule or schedules from the provided arguments.
396
378
 
@@ -448,7 +430,7 @@ class RunnerDeployment(BaseModel):
448
430
  value = [value]
449
431
 
450
432
  return [
451
- _to_deployment_schedule(
433
+ create_minimal_deployment_schedule(
452
434
  construct_schedule(
453
435
  **{
454
436
  schedule_type: v,
@@ -460,7 +442,7 @@ class RunnerDeployment(BaseModel):
460
442
  for v in value
461
443
  ]
462
444
  else:
463
- return [_to_deployment_schedule(schedule)]
445
+ return [create_minimal_deployment_schedule(schedule)]
464
446
 
465
447
  def _set_defaults_from_flow(self, flow: "Flow"):
466
448
  self._parameter_openapi_schema = parameter_schema(flow)
@@ -481,7 +463,7 @@ class RunnerDeployment(BaseModel):
481
463
  cron: Optional[Union[Iterable[str], str]] = None,
482
464
  rrule: Optional[Union[Iterable[str], str]] = None,
483
465
  paused: Optional[bool] = None,
484
- schedules: Optional[List[FlexibleScheduleList]] = None,
466
+ schedules: Optional[FlexibleScheduleList] = None,
485
467
  schedule: Optional[SCHEDULE_TYPES] = None,
486
468
  is_schedule_active: Optional[bool] = None,
487
469
  parameters: Optional[dict] = None,
@@ -617,7 +599,7 @@ class RunnerDeployment(BaseModel):
617
599
  cron: Optional[Union[Iterable[str], str]] = None,
618
600
  rrule: Optional[Union[Iterable[str], str]] = None,
619
601
  paused: Optional[bool] = None,
620
- schedules: Optional[List[FlexibleScheduleList]] = None,
602
+ schedules: Optional[FlexibleScheduleList] = None,
621
603
  schedule: Optional[SCHEDULE_TYPES] = None,
622
604
  is_schedule_active: Optional[bool] = None,
623
605
  parameters: Optional[dict] = None,
@@ -715,7 +697,7 @@ class RunnerDeployment(BaseModel):
715
697
  cron: Optional[Union[Iterable[str], str]] = None,
716
698
  rrule: Optional[Union[Iterable[str], str]] = None,
717
699
  paused: Optional[bool] = None,
718
- schedules: Optional[List[FlexibleScheduleList]] = None,
700
+ schedules: Optional[FlexibleScheduleList] = None,
719
701
  schedule: Optional[SCHEDULE_TYPES] = None,
720
702
  is_schedule_active: Optional[bool] = None,
721
703
  parameters: Optional[dict] = None,
@@ -0,0 +1,37 @@
1
+ from typing import List, Optional, Sequence, Union, get_args
2
+
3
+ from prefect.client.schemas.objects import MinimalDeploymentSchedule
4
+ from prefect.client.schemas.schedules import SCHEDULE_TYPES
5
+
6
+ FlexibleScheduleList = Sequence[Union[MinimalDeploymentSchedule, dict, SCHEDULE_TYPES]]
7
+
8
+
9
+ def create_minimal_deployment_schedule(
10
+ schedule: SCHEDULE_TYPES,
11
+ active: Optional[bool] = True,
12
+ ) -> MinimalDeploymentSchedule:
13
+ return MinimalDeploymentSchedule(
14
+ schedule=schedule,
15
+ active=active if active is not None else True,
16
+ )
17
+
18
+
19
+ def normalize_to_minimal_deployment_schedules(
20
+ schedules: Optional[FlexibleScheduleList],
21
+ ) -> List[MinimalDeploymentSchedule]:
22
+ normalized = []
23
+ if schedules is not None:
24
+ for obj in schedules:
25
+ if isinstance(obj, get_args(SCHEDULE_TYPES)):
26
+ normalized.append(create_minimal_deployment_schedule(obj))
27
+ elif isinstance(obj, dict):
28
+ normalized.append(create_minimal_deployment_schedule(**obj))
29
+ elif isinstance(obj, MinimalDeploymentSchedule):
30
+ normalized.append(obj)
31
+ else:
32
+ raise ValueError(
33
+ "Invalid schedule provided. Must be a schedule object, a dict,"
34
+ " or a MinimalDeploymentSchedule."
35
+ )
36
+
37
+ return normalized