prefect-client 2.19.9__tar.gz → 2.20.0__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 (302) hide show
  1. {prefect-client-2.19.9/src/prefect_client.egg-info → prefect-client-2.20.0}/PKG-INFO +1 -1
  2. {prefect-client-2.19.9 → prefect-client-2.20.0}/requirements-client.txt +1 -1
  3. {prefect-client-2.19.9 → prefect-client-2.20.0}/requirements.txt +2 -1
  4. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/blocks/notifications.py +30 -2
  5. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/engine.py +8 -6
  6. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/flows.py +151 -8
  7. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/task_server.py +23 -9
  8. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/asyncutils.py +6 -4
  9. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/callables.py +5 -3
  10. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/engine.py +14 -0
  11. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/importtools.py +138 -58
  12. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/services.py +7 -1
  13. {prefect-client-2.19.9 → prefect-client-2.20.0/src/prefect_client.egg-info}/PKG-INFO +1 -1
  14. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect_client.egg-info/requires.txt +1 -1
  15. {prefect-client-2.19.9 → prefect-client-2.20.0}/LICENSE +0 -0
  16. {prefect-client-2.19.9 → prefect-client-2.20.0}/MANIFEST.in +0 -0
  17. {prefect-client-2.19.9 → prefect-client-2.20.0}/README.md +0 -0
  18. {prefect-client-2.19.9 → prefect-client-2.20.0}/requirements-dev.txt +0 -0
  19. {prefect-client-2.19.9 → prefect-client-2.20.0}/setup.cfg +0 -0
  20. {prefect-client-2.19.9 → prefect-client-2.20.0}/setup.py +0 -0
  21. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/.prefectignore +0 -0
  22. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/__init__.py +0 -0
  23. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/__init__.py +0 -0
  24. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/_logging.py +0 -0
  25. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/compatibility/__init__.py +0 -0
  26. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/compatibility/deprecated.py +0 -0
  27. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/compatibility/experimental.py +0 -0
  28. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/__init__.py +0 -0
  29. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/api.py +0 -0
  30. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/calls.py +0 -0
  31. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/cancellation.py +0 -0
  32. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/event_loop.py +0 -0
  33. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/inspection.py +0 -0
  34. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/primitives.py +0 -0
  35. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/services.py +0 -0
  36. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/threads.py +0 -0
  37. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/waiters.py +0 -0
  38. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/__init__.py +0 -0
  39. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/_base_model.py +0 -0
  40. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/_compat.py +0 -0
  41. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/_flags.py +0 -0
  42. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/_types.py +0 -0
  43. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/annotations/__init__.py +0 -0
  44. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/annotations/pendulum.py +0 -0
  45. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/schemas.py +0 -0
  46. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/__init__.py +0 -0
  47. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/config_dict.py +0 -0
  48. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/field_validator.py +0 -0
  49. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_construct.py +0 -0
  50. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_copy.py +0 -0
  51. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_dump.py +0 -0
  52. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_dump_json.py +0 -0
  53. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_fields.py +0 -0
  54. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_fields_set.py +0 -0
  55. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_json_schema.py +0 -0
  56. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_rebuild.py +0 -0
  57. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_validate.py +0 -0
  58. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_validate_json.py +0 -0
  59. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_validator.py +0 -0
  60. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/type_adapter.py +0 -0
  61. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/v1_schema.py +0 -0
  62. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/v2_schema.py +0 -0
  63. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/v2_validated_func.py +0 -0
  64. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pytz.py +0 -0
  65. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/schemas/__init__.py +0 -0
  66. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/schemas/bases.py +0 -0
  67. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/schemas/fields.py +0 -0
  68. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/schemas/serializers.py +0 -0
  69. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/schemas/validators.py +0 -0
  70. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/__init__.py +0 -0
  71. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/__init__.py +0 -0
  72. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/applications.py +0 -0
  73. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/background.py +0 -0
  74. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/concurrency.py +0 -0
  75. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/datastructures.py +0 -0
  76. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/dependencies/__init__.py +0 -0
  77. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/dependencies/models.py +0 -0
  78. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/dependencies/utils.py +0 -0
  79. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/encoders.py +0 -0
  80. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/exception_handlers.py +0 -0
  81. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/exceptions.py +0 -0
  82. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/logger.py +0 -0
  83. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/middleware/__init__.py +0 -0
  84. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/middleware/asyncexitstack.py +0 -0
  85. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/middleware/cors.py +0 -0
  86. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/middleware/gzip.py +0 -0
  87. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/middleware/httpsredirect.py +0 -0
  88. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/middleware/trustedhost.py +0 -0
  89. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/middleware/wsgi.py +0 -0
  90. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/openapi/__init__.py +0 -0
  91. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/openapi/constants.py +0 -0
  92. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/openapi/docs.py +0 -0
  93. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/openapi/models.py +0 -0
  94. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/openapi/utils.py +0 -0
  95. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/param_functions.py +0 -0
  96. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/params.py +0 -0
  97. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/requests.py +0 -0
  98. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/responses.py +0 -0
  99. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/routing.py +0 -0
  100. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/security/__init__.py +0 -0
  101. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/security/api_key.py +0 -0
  102. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/security/base.py +0 -0
  103. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/security/http.py +0 -0
  104. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/security/oauth2.py +0 -0
  105. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/security/open_id_connect_url.py +0 -0
  106. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/security/utils.py +0 -0
  107. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/staticfiles.py +0 -0
  108. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/templating.py +0 -0
  109. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/testclient.py +0 -0
  110. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/types.py +0 -0
  111. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/utils.py +0 -0
  112. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/websockets.py +0 -0
  113. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/__init__.py +0 -0
  114. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/_compat.py +0 -0
  115. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/_exception_handler.py +0 -0
  116. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/_utils.py +0 -0
  117. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/applications.py +0 -0
  118. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/authentication.py +0 -0
  119. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/background.py +0 -0
  120. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/concurrency.py +0 -0
  121. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/config.py +0 -0
  122. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/convertors.py +0 -0
  123. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/datastructures.py +0 -0
  124. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/endpoints.py +0 -0
  125. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/exceptions.py +0 -0
  126. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/formparsers.py +0 -0
  127. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/__init__.py +0 -0
  128. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/authentication.py +0 -0
  129. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/base.py +0 -0
  130. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/cors.py +0 -0
  131. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/errors.py +0 -0
  132. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/exceptions.py +0 -0
  133. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/gzip.py +0 -0
  134. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/httpsredirect.py +0 -0
  135. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/sessions.py +0 -0
  136. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/trustedhost.py +0 -0
  137. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/wsgi.py +0 -0
  138. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/requests.py +0 -0
  139. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/responses.py +0 -0
  140. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/routing.py +0 -0
  141. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/schemas.py +0 -0
  142. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/staticfiles.py +0 -0
  143. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/status.py +0 -0
  144. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/templating.py +0 -0
  145. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/testclient.py +0 -0
  146. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/types.py +0 -0
  147. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/websockets.py +0 -0
  148. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_version.py +0 -0
  149. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/agent.py +0 -0
  150. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/artifacts.py +0 -0
  151. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/automations.py +0 -0
  152. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/blocks/__init__.py +0 -0
  153. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/blocks/abstract.py +0 -0
  154. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/blocks/core.py +0 -0
  155. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/blocks/fields.py +0 -0
  156. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/blocks/kubernetes.py +0 -0
  157. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/blocks/system.py +0 -0
  158. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/blocks/webhook.py +0 -0
  159. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/__init__.py +0 -0
  160. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/base.py +0 -0
  161. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/cloud.py +0 -0
  162. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/collections.py +0 -0
  163. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/constants.py +0 -0
  164. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/orchestration.py +0 -0
  165. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/schemas/__init__.py +0 -0
  166. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/schemas/actions.py +0 -0
  167. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/schemas/filters.py +0 -0
  168. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/schemas/objects.py +0 -0
  169. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/schemas/responses.py +0 -0
  170. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/schemas/schedules.py +0 -0
  171. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/schemas/sorting.py +0 -0
  172. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/subscriptions.py +0 -0
  173. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/utilities.py +0 -0
  174. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/concurrency/__init__.py +0 -0
  175. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/concurrency/asyncio.py +0 -0
  176. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/concurrency/events.py +0 -0
  177. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/concurrency/services.py +0 -0
  178. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/concurrency/sync.py +0 -0
  179. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/context.py +0 -0
  180. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deployments/__init__.py +0 -0
  181. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deployments/base.py +0 -0
  182. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deployments/deployments.py +0 -0
  183. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deployments/runner.py +0 -0
  184. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deployments/schedules.py +0 -0
  185. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deployments/steps/__init__.py +0 -0
  186. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deployments/steps/core.py +0 -0
  187. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deployments/steps/pull.py +0 -0
  188. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deployments/steps/utility.py +0 -0
  189. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deprecated/__init__.py +0 -0
  190. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deprecated/data_documents.py +0 -0
  191. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deprecated/packaging/__init__.py +0 -0
  192. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deprecated/packaging/base.py +0 -0
  193. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deprecated/packaging/docker.py +0 -0
  194. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deprecated/packaging/file.py +0 -0
  195. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deprecated/packaging/orion.py +0 -0
  196. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deprecated/packaging/serializers.py +0 -0
  197. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/__init__.py +0 -0
  198. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/actions.py +0 -0
  199. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/cli/__init__.py +0 -0
  200. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/cli/automations.py +0 -0
  201. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/clients.py +0 -0
  202. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/filters.py +0 -0
  203. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/instrument.py +0 -0
  204. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/related.py +0 -0
  205. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/schemas/__init__.py +0 -0
  206. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/schemas/automations.py +0 -0
  207. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/schemas/deployment_triggers.py +0 -0
  208. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/schemas/events.py +0 -0
  209. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/schemas/labelling.py +0 -0
  210. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/utilities.py +0 -0
  211. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/worker.py +0 -0
  212. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/exceptions.py +0 -0
  213. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/filesystems.py +0 -0
  214. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/flow_runs.py +0 -0
  215. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/futures.py +0 -0
  216. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/infrastructure/__init__.py +0 -0
  217. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/infrastructure/base.py +0 -0
  218. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/infrastructure/container.py +0 -0
  219. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/infrastructure/kubernetes.py +0 -0
  220. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/infrastructure/process.py +0 -0
  221. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/infrastructure/provisioners/__init__.py +0 -0
  222. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/infrastructure/provisioners/cloud_run.py +0 -0
  223. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/infrastructure/provisioners/container_instance.py +0 -0
  224. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/infrastructure/provisioners/ecs.py +0 -0
  225. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/infrastructure/provisioners/modal.py +0 -0
  226. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/input/__init__.py +0 -0
  227. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/input/actions.py +0 -0
  228. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/input/run_input.py +0 -0
  229. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/logging/__init__.py +0 -0
  230. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/logging/configuration.py +0 -0
  231. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/logging/filters.py +0 -0
  232. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/logging/formatters.py +0 -0
  233. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/logging/handlers.py +0 -0
  234. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/logging/highlighters.py +0 -0
  235. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/logging/loggers.py +0 -0
  236. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/logging/logging.yml +0 -0
  237. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/manifests.py +0 -0
  238. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/new_flow_engine.py +0 -0
  239. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/new_task_engine.py +0 -0
  240. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/plugins.py +0 -0
  241. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/profiles.toml +0 -0
  242. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/py.typed +0 -0
  243. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/pydantic/__init__.py +0 -0
  244. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/pydantic/main.py +0 -0
  245. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/results.py +0 -0
  246. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/runner/__init__.py +0 -0
  247. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/runner/runner.py +0 -0
  248. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/runner/server.py +0 -0
  249. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/runner/storage.py +0 -0
  250. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/runner/submit.py +0 -0
  251. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/runner/utils.py +0 -0
  252. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/runtime/__init__.py +0 -0
  253. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/runtime/deployment.py +0 -0
  254. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/runtime/flow_run.py +0 -0
  255. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/runtime/task_run.py +0 -0
  256. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/serializers.py +0 -0
  257. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/server/api/collections_data/views/aggregate-worker-metadata.json +0 -0
  258. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/server/api/static/prefect-logo-mark-gradient.png +0 -0
  259. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/settings.py +0 -0
  260. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/software/__init__.py +0 -0
  261. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/software/base.py +0 -0
  262. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/software/conda.py +0 -0
  263. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/software/pip.py +0 -0
  264. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/software/python.py +0 -0
  265. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/states.py +0 -0
  266. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/task_engine.py +0 -0
  267. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/task_runners.py +0 -0
  268. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/tasks.py +0 -0
  269. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/types/__init__.py +0 -0
  270. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/__init__.py +0 -0
  271. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/annotations.py +0 -0
  272. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/collections.py +0 -0
  273. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/compat.py +0 -0
  274. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/context.py +0 -0
  275. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/dispatch.py +0 -0
  276. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/dockerutils.py +0 -0
  277. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/filesystem.py +0 -0
  278. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/hashing.py +0 -0
  279. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/math.py +0 -0
  280. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/names.py +0 -0
  281. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/processutils.py +0 -0
  282. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/pydantic.py +0 -0
  283. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/render_swagger.py +0 -0
  284. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/schema_tools/__init__.py +0 -0
  285. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/schema_tools/hydration.py +0 -0
  286. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/schema_tools/validation.py +0 -0
  287. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/slugify.py +0 -0
  288. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/templating.py +0 -0
  289. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/text.py +0 -0
  290. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/timeout.py +0 -0
  291. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/visualization.py +0 -0
  292. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/variables.py +0 -0
  293. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/workers/__init__.py +0 -0
  294. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/workers/base.py +0 -0
  295. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/workers/block.py +0 -0
  296. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/workers/process.py +0 -0
  297. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/workers/server.py +0 -0
  298. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/workers/utilities.py +0 -0
  299. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect_client.egg-info/SOURCES.txt +0 -0
  300. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect_client.egg-info/dependency_links.txt +0 -0
  301. {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect_client.egg-info/top_level.txt +0 -0
  302. {prefect-client-2.19.9 → prefect-client-2.20.0}/versioneer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: prefect-client
3
- Version: 2.19.9
3
+ Version: 2.20.0
4
4
  Summary: Workflow orchestration and management.
5
5
  Home-page: https://www.prefect.io
6
6
  Author: Prefect Technologies, Inc.
@@ -1,4 +1,4 @@
1
- anyio >= 3.7.1, < 4.0.0
1
+ anyio >= 4.4.0, < 5.0.0
2
2
  asgi-lifespan >= 1.0, < 3.0
3
3
  cachetools >= 5.3, < 6.0
4
4
  cloudpickle >= 2.0, < 4.0
@@ -2,7 +2,7 @@
2
2
 
3
3
  aiosqlite >= 0.17.0
4
4
  alembic >= 1.7.5, < 2.0.0
5
- apprise >= 1.1.0, < 2.0.0
5
+ apprise >= 1.8.0, < 2.0.0
6
6
  asyncpg >= 0.23
7
7
  click >= 8.0, < 8.2
8
8
  cryptography >= 36.0.1
@@ -18,3 +18,4 @@ pytz >= 2021.1, < 2025
18
18
  readchar >= 4.0.0, < 5.0.0
19
19
  sqlalchemy[asyncio] >= 1.4.22, != 1.4.33, < 3.0.0
20
20
  typer >= 0.12.0, != 0.12.2, < 0.13.0
21
+ exceptiongroup >= 1.2.1
@@ -139,12 +139,40 @@ class MicrosoftTeamsWebhook(AppriseNotificationBlock):
139
139
  url: SecretStr = Field(
140
140
  ...,
141
141
  title="Webhook URL",
142
- description="The Teams incoming webhook URL used to send notifications.",
142
+ description="The Microsoft Power Automate (Workflows) URL used to send notifications to Teams.",
143
143
  examples=[
144
- "https://your-org.webhook.office.com/webhookb2/XXX/IncomingWebhook/YYY/ZZZ"
144
+ "https://prod-NO.LOCATION.logic.azure.com:443/workflows/WFID/triggers/manual/paths/invoke?sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=SIGNATURE"
145
145
  ],
146
146
  )
147
147
 
148
+ include_image: bool = Field(
149
+ default=True,
150
+ description="Include an image with the notification.",
151
+ )
152
+
153
+ wrap: bool = Field(
154
+ default=True,
155
+ description="Wrap the notification text.",
156
+ )
157
+
158
+ def block_initialization(self) -> None:
159
+ """see https://github.com/caronc/apprise/pull/1172"""
160
+ from apprise.plugins.workflows import NotifyWorkflows
161
+
162
+ if not (
163
+ parsed_url := NotifyWorkflows.parse_native_url(self.url.get_secret_value())
164
+ ):
165
+ raise ValueError("Invalid Microsoft Teams Workflow URL provided.")
166
+
167
+ parsed_url.update(
168
+ {
169
+ "include_image": self.include_image,
170
+ "wrap": self.wrap,
171
+ }
172
+ )
173
+
174
+ self._start_apprise_client(SecretStr(NotifyWorkflows(**parsed_url).url()))
175
+
148
176
 
149
177
  class PagerDutyWebHook(AbstractAppriseNotificationBlock):
150
178
  """
@@ -107,7 +107,7 @@ from uuid import UUID, uuid4
107
107
 
108
108
  import anyio
109
109
  import pendulum
110
- from anyio import start_blocking_portal
110
+ from anyio.from_thread import start_blocking_portal
111
111
  from typing_extensions import Literal
112
112
 
113
113
  import prefect
@@ -211,6 +211,7 @@ from prefect.utilities.engine import (
211
211
  _resolve_custom_task_run_name,
212
212
  capture_sigterm,
213
213
  check_api_reachable,
214
+ collapse_excgroups,
214
215
  collect_task_run_inputs,
215
216
  emit_task_run_state_change_event,
216
217
  propose_state,
@@ -279,7 +280,7 @@ def enter_flow_run_engine_from_flow_call(
279
280
  # the user. Generally, you should enter contexts _within_ the async `begin_run`
280
281
  # instead but if you need to enter a context from the main thread you'll need to do
281
282
  # it here.
282
- contexts = [capture_sigterm()]
283
+ contexts = [capture_sigterm(), collapse_excgroups()]
283
284
 
284
285
  if flow.isasync and (
285
286
  not is_subflow_run or (is_subflow_run and parent_flow_run_context.flow.isasync)
@@ -324,7 +325,7 @@ def enter_flow_run_engine_from_subprocess(flow_run_id: UUID) -> State:
324
325
  flow_run_id,
325
326
  user_thread=threading.current_thread(),
326
327
  ),
327
- contexts=[capture_sigterm()],
328
+ contexts=[capture_sigterm(), collapse_excgroups()],
328
329
  )
329
330
 
330
331
  APILogHandler.flush()
@@ -2248,9 +2249,9 @@ async def report_flow_run_crashes(flow_run: FlowRun, client: PrefectClient, flow
2248
2249
 
2249
2250
  This context _must_ reraise the exception to properly exit the run.
2250
2251
  """
2251
-
2252
2252
  try:
2253
- yield
2253
+ with collapse_excgroups():
2254
+ yield
2254
2255
  except (Abort, Pause):
2255
2256
  # Do not capture internal signals as crashes
2256
2257
  raise
@@ -2287,7 +2288,8 @@ async def report_task_run_crashes(task_run: TaskRun, client: PrefectClient):
2287
2288
  This context _must_ reraise the exception to properly exit the run.
2288
2289
  """
2289
2290
  try:
2290
- yield
2291
+ with collapse_excgroups():
2292
+ yield
2291
2293
  except (Abort, Pause):
2292
2294
  # Do not capture internal signals as crashes
2293
2295
  raise
@@ -1676,6 +1676,7 @@ def load_flow_from_entrypoint(
1676
1676
  if ":" in entrypoint:
1677
1677
  # split by the last colon once to handle Windows paths with drive letters i.e C:\path\to\file.py:do_stuff
1678
1678
  path, func_name = entrypoint.rsplit(":", maxsplit=1)
1679
+
1679
1680
  else:
1680
1681
  path, func_name = entrypoint.rsplit(".", maxsplit=1)
1681
1682
  try:
@@ -1684,15 +1685,13 @@ def load_flow_from_entrypoint(
1684
1685
  raise MissingFlowError(
1685
1686
  f"Flow function with name {func_name!r} not found in {path!r}. "
1686
1687
  ) from exc
1687
- except ScriptError as exc:
1688
+ except ScriptError:
1688
1689
  # If the flow has dependencies that are not installed in the current
1689
- # environment, fallback to loading the flow via AST parsing. The
1690
- # drawback of this approach is that we're unable to actually load the
1691
- # function, so we create a placeholder flow that will re-raise this
1692
- # exception when called.
1693
-
1690
+ # environment, fallback to loading the flow via AST parsing.
1694
1691
  if use_placeholder_flow:
1695
- flow = load_placeholder_flow(entrypoint=entrypoint, raises=exc)
1692
+ flow = safe_load_flow_from_entrypoint(entrypoint)
1693
+ if flow is None:
1694
+ raise
1696
1695
  else:
1697
1696
  raise
1698
1697
 
@@ -1855,6 +1854,147 @@ def load_placeholder_flow(entrypoint: str, raises: Exception):
1855
1854
  return Flow(**arguments)
1856
1855
 
1857
1856
 
1857
+ def safe_load_flow_from_entrypoint(entrypoint: str) -> Optional[Flow]:
1858
+ """
1859
+ Load a flow from an entrypoint and return None if an exception is raised.
1860
+
1861
+ Args:
1862
+ entrypoint: a string in the format `<path_to_script>:<flow_func_name>`
1863
+ or a module path to a flow function
1864
+ """
1865
+ func_def, source_code = _entrypoint_definition_and_source(entrypoint)
1866
+ path = None
1867
+ if ":" in entrypoint:
1868
+ path = entrypoint.rsplit(":")[0]
1869
+ namespace = safe_load_namespace(source_code, filepath=path)
1870
+ if func_def.name in namespace:
1871
+ return namespace[func_def.name]
1872
+ else:
1873
+ # If the function is not in the namespace, if may be due to missing dependencies
1874
+ # for the function. We will attempt to compile each annotation and default value
1875
+ # and remove them from the function definition to see if the function can be
1876
+ # compiled without them.
1877
+
1878
+ return _sanitize_and_load_flow(func_def, namespace)
1879
+
1880
+
1881
+ def _sanitize_and_load_flow(
1882
+ func_def: Union[ast.FunctionDef, ast.AsyncFunctionDef], namespace: Dict[str, Any]
1883
+ ) -> Optional[Flow]:
1884
+ """
1885
+ Attempt to load a flow from the function definition after sanitizing the annotations
1886
+ and defaults that can't be compiled.
1887
+
1888
+ Args:
1889
+ func_def: the function definition
1890
+ namespace: the namespace to load the function into
1891
+
1892
+ Returns:
1893
+ The loaded function or None if the function can't be loaded
1894
+ after sanitizing the annotations and defaults.
1895
+ """
1896
+ args = func_def.args.posonlyargs + func_def.args.args + func_def.args.kwonlyargs
1897
+ if func_def.args.vararg:
1898
+ args.append(func_def.args.vararg)
1899
+ if func_def.args.kwarg:
1900
+ args.append(func_def.args.kwarg)
1901
+ # Remove annotations that can't be compiled
1902
+ for arg in args:
1903
+ if arg.annotation is not None:
1904
+ try:
1905
+ code = compile(
1906
+ ast.Expression(arg.annotation),
1907
+ filename="<ast>",
1908
+ mode="eval",
1909
+ )
1910
+ exec(code, namespace)
1911
+ except Exception as e:
1912
+ logger.debug(
1913
+ "Failed to evaluate annotation for argument %s due to the following error. Ignoring annotation.",
1914
+ arg.arg,
1915
+ exc_info=e,
1916
+ )
1917
+ arg.annotation = None
1918
+
1919
+ # Remove defaults that can't be compiled
1920
+ new_defaults = []
1921
+ for default in func_def.args.defaults:
1922
+ try:
1923
+ code = compile(ast.Expression(default), "<ast>", "eval")
1924
+ exec(code, namespace)
1925
+ new_defaults.append(default)
1926
+ except Exception as e:
1927
+ logger.debug(
1928
+ "Failed to evaluate default value %s due to the following error. Ignoring default.",
1929
+ default,
1930
+ exc_info=e,
1931
+ )
1932
+ new_defaults.append(
1933
+ ast.Constant(
1934
+ value=None, lineno=default.lineno, col_offset=default.col_offset
1935
+ )
1936
+ )
1937
+ func_def.args.defaults = new_defaults
1938
+
1939
+ # Remove kw_defaults that can't be compiled
1940
+ new_kw_defaults = []
1941
+ for default in func_def.args.kw_defaults:
1942
+ if default is not None:
1943
+ try:
1944
+ code = compile(ast.Expression(default), "<ast>", "eval")
1945
+ exec(code, namespace)
1946
+ new_kw_defaults.append(default)
1947
+ except Exception as e:
1948
+ logger.debug(
1949
+ "Failed to evaluate default value %s due to the following error. Ignoring default.",
1950
+ default,
1951
+ exc_info=e,
1952
+ )
1953
+ new_kw_defaults.append(
1954
+ ast.Constant(
1955
+ value=None,
1956
+ lineno=default.lineno,
1957
+ col_offset=default.col_offset,
1958
+ )
1959
+ )
1960
+ else:
1961
+ new_kw_defaults.append(
1962
+ ast.Constant(
1963
+ value=None,
1964
+ lineno=func_def.lineno,
1965
+ col_offset=func_def.col_offset,
1966
+ )
1967
+ )
1968
+ func_def.args.kw_defaults = new_kw_defaults
1969
+
1970
+ if func_def.returns is not None:
1971
+ try:
1972
+ code = compile(
1973
+ ast.Expression(func_def.returns), filename="<ast>", mode="eval"
1974
+ )
1975
+ exec(code, namespace)
1976
+ except Exception as e:
1977
+ logger.debug(
1978
+ "Failed to evaluate return annotation due to the following error. Ignoring annotation.",
1979
+ exc_info=e,
1980
+ )
1981
+ func_def.returns = None
1982
+
1983
+ # Attempt to compile the function without annotations and defaults that
1984
+ # can't be compiled
1985
+ try:
1986
+ code = compile(
1987
+ ast.Module(body=[func_def], type_ignores=[]),
1988
+ filename="<ast>",
1989
+ mode="exec",
1990
+ )
1991
+ exec(code, namespace)
1992
+ except Exception as e:
1993
+ logger.debug("Failed to compile: %s", e)
1994
+ else:
1995
+ return namespace.get(func_def.name)
1996
+
1997
+
1858
1998
  def load_flow_arguments_from_entrypoint(
1859
1999
  entrypoint: str, arguments: Optional[Union[List[str], Set[str]]] = None
1860
2000
  ) -> Dict[str, Any]:
@@ -1870,6 +2010,9 @@ def load_flow_arguments_from_entrypoint(
1870
2010
  """
1871
2011
 
1872
2012
  func_def, source_code = _entrypoint_definition_and_source(entrypoint)
2013
+ path = None
2014
+ if ":" in entrypoint:
2015
+ path = entrypoint.rsplit(":")[0]
1873
2016
 
1874
2017
  if arguments is None:
1875
2018
  # If no arguments are provided default to known arguments that are of
@@ -1905,7 +2048,7 @@ def load_flow_arguments_from_entrypoint(
1905
2048
 
1906
2049
  # if the arg value is not a raw str (i.e. a variable or expression),
1907
2050
  # then attempt to evaluate it
1908
- namespace = safe_load_namespace(source_code)
2051
+ namespace = safe_load_namespace(source_code, filepath=path)
1909
2052
  literal_arg_value = ast.get_source_segment(source_code, keyword.value)
1910
2053
  cleaned_value = (
1911
2054
  literal_arg_value.replace("\n", "") if literal_arg_value else ""
@@ -9,6 +9,7 @@ from functools import partial
9
9
  from typing import List, Optional, Type
10
10
 
11
11
  import anyio
12
+ from exceptiongroup import BaseExceptionGroup # novermin
12
13
  from websockets.exceptions import InvalidStatusCode
13
14
 
14
15
  from prefect import Task, get_client
@@ -225,16 +226,21 @@ class TaskServer:
225
226
  validated_state=state,
226
227
  )
227
228
 
228
- self._runs_task_group.start_soon(
229
- partial(
230
- submit_autonomous_task_run_to_engine,
231
- task=task,
232
- task_run=task_run,
233
- parameters=parameters,
234
- task_runner=self.task_runner,
235
- client=self._client,
229
+ try:
230
+ self._runs_task_group.start_soon(
231
+ partial(
232
+ submit_autonomous_task_run_to_engine,
233
+ task=task,
234
+ task_run=task_run,
235
+ parameters=parameters,
236
+ task_runner=self.task_runner,
237
+ client=self._client,
238
+ )
239
+ )
240
+ except BaseException as exc:
241
+ logger.exception(
242
+ f"Failed to submit task run {task_run.id!r} to engine", exc_info=exc
236
243
  )
237
- )
238
244
 
239
245
  async def execute_task_run(self, task_run: TaskRun):
240
246
  """Execute a task run in the task server."""
@@ -301,6 +307,14 @@ async def serve(*tasks: Task, task_runner: Optional[Type[BaseTaskRunner]] = None
301
307
  try:
302
308
  await task_server.start()
303
309
 
310
+ except BaseExceptionGroup as exc: # novermin
311
+ exceptions = exc.exceptions
312
+ n_exceptions = len(exceptions)
313
+ logger.error(
314
+ f"Task worker stopped with {n_exceptions} exception{'s' if n_exceptions != 1 else ''}:"
315
+ f"\n" + "\n".join(str(e) for e in exceptions)
316
+ )
317
+
304
318
  except StopTaskServer:
305
319
  logger.info("Task server stopped.")
306
320
 
@@ -29,7 +29,9 @@ from uuid import UUID, uuid4
29
29
 
30
30
  import anyio
31
31
  import anyio.abc
32
+ import anyio.to_thread
32
33
  import sniffio
34
+ from anyio.from_thread import start_blocking_portal
33
35
  from typing_extensions import Literal, ParamSpec, TypeGuard
34
36
 
35
37
  from prefect.logging import get_logger
@@ -134,7 +136,7 @@ async def run_sync_in_worker_thread(
134
136
  """
135
137
  call = partial(__fn, *args, **kwargs)
136
138
  return await anyio.to_thread.run_sync(
137
- call, cancellable=True, limiter=get_thread_limiter()
139
+ call, abandon_on_cancel=True, limiter=get_thread_limiter()
138
140
  )
139
141
 
140
142
 
@@ -202,7 +204,7 @@ async def run_sync_in_interruptible_worker_thread(
202
204
  partial(
203
205
  anyio.to_thread.run_sync,
204
206
  capture_worker_thread_and_result,
205
- cancellable=True,
207
+ abandon_on_cancel=True,
206
208
  limiter=get_thread_limiter(),
207
209
  )
208
210
  )
@@ -228,7 +230,7 @@ def run_async_in_new_loop(__fn: Callable[..., Awaitable[T]], *args: Any, **kwarg
228
230
 
229
231
  def in_async_worker_thread() -> bool:
230
232
  try:
231
- anyio.from_thread.threadlocals.current_async_module
233
+ anyio.from_thread.threadlocals.current_async_backend
232
234
  except AttributeError:
233
235
  return False
234
236
  else:
@@ -338,7 +340,7 @@ def sync(__async_fn: Callable[P, Awaitable[T]], *args: P.args, **kwargs: P.kwarg
338
340
  "`sync` called from an asynchronous context; "
339
341
  "you should `await` the async function directly instead."
340
342
  )
341
- with anyio.start_blocking_portal() as portal:
343
+ with start_blocking_portal() as portal:
342
344
  return portal.call(partial(__async_fn, *args, **kwargs))
343
345
  elif in_async_worker_thread():
344
346
  # In a sync context but we can access the event loop thread; send the async
@@ -346,17 +346,19 @@ def parameter_schema_from_entrypoint(entrypoint: str) -> ParameterSchema:
346
346
  Returns:
347
347
  ParameterSchema: The parameter schema for the function.
348
348
  """
349
+ filepath = None
349
350
  if ":" in entrypoint:
350
351
  # split by the last colon once to handle Windows paths with drive letters i.e C:\path\to\file.py:do_stuff
351
352
  path, func_name = entrypoint.rsplit(":", maxsplit=1)
352
353
  source_code = Path(path).read_text()
354
+ filepath = path
353
355
  else:
354
356
  path, func_name = entrypoint.rsplit(".", maxsplit=1)
355
357
  spec = importlib.util.find_spec(path)
356
358
  if not spec or not spec.origin:
357
359
  raise ValueError(f"Could not find module {path!r}")
358
360
  source_code = Path(spec.origin).read_text()
359
- signature = _generate_signature_from_source(source_code, func_name)
361
+ signature = _generate_signature_from_source(source_code, func_name, filepath)
360
362
  docstring = _get_docstring_from_source(source_code, func_name)
361
363
  return generate_parameter_schema(signature, parameter_docstrings(docstring))
362
364
 
@@ -424,7 +426,7 @@ def raise_for_reserved_arguments(fn: Callable, reserved_arguments: Iterable[str]
424
426
 
425
427
 
426
428
  def _generate_signature_from_source(
427
- source_code: str, func_name: str
429
+ source_code: str, func_name: str, filepath: Optional[str] = None
428
430
  ) -> inspect.Signature:
429
431
  """
430
432
  Extract the signature of a function from its source code.
@@ -440,7 +442,7 @@ def _generate_signature_from_source(
440
442
  """
441
443
  # Load the namespace from the source code. Missing imports and exceptions while
442
444
  # loading local class definitions are ignored.
443
- namespace = safe_load_namespace(source_code)
445
+ namespace = safe_load_namespace(source_code, filepath=filepath)
444
446
  # Parse the source code into an AST
445
447
  parsed_code = ast.parse(source_code)
446
448
 
@@ -4,11 +4,13 @@ import inspect
4
4
  import os
5
5
  import signal
6
6
  import time
7
+ from contextlib import contextmanager
7
8
  from functools import partial
8
9
  from typing import (
9
10
  Any,
10
11
  Callable,
11
12
  Dict,
13
+ Generator,
12
14
  Iterable,
13
15
  Optional,
14
16
  Set,
@@ -18,6 +20,7 @@ from typing import (
18
20
  from uuid import UUID, uuid4
19
21
 
20
22
  import anyio
23
+ from exceptiongroup import BaseExceptionGroup # novermin
21
24
  from typing_extensions import Literal
22
25
 
23
26
  import prefect
@@ -734,3 +737,14 @@ def emit_task_run_state_change_event(
734
737
  },
735
738
  follows=follows,
736
739
  )
740
+
741
+
742
+ @contextmanager
743
+ def collapse_excgroups() -> Generator[None, None, None]:
744
+ try:
745
+ yield
746
+ except BaseException as exc:
747
+ while isinstance(exc, BaseExceptionGroup) and len(exc.exceptions) == 1:
748
+ exc = exc.exceptions[0]
749
+
750
+ raise exc