prefect-client 2.14.21__tar.gz → 2.15.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 (277) hide show
  1. {prefect-client-2.14.21 → prefect-client-2.15.0}/PKG-INFO +1 -1
  2. {prefect-client-2.14.21 → prefect-client-2.15.0}/requirements-client.txt +5 -1
  3. {prefect-client-2.14.21 → prefect-client-2.15.0}/requirements.txt +1 -0
  4. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_internal/concurrency/api.py +37 -2
  5. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_internal/concurrency/calls.py +9 -0
  6. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_internal/concurrency/cancellation.py +3 -1
  7. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_internal/concurrency/event_loop.py +2 -2
  8. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_internal/concurrency/threads.py +3 -2
  9. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_internal/pydantic/annotations/pendulum.py +4 -4
  10. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_internal/pydantic/v2_schema.py +2 -2
  11. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/__init__.py +1 -1
  12. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/applications.py +13 -13
  13. prefect-client-2.15.0/src/prefect/_vendor/fastapi/background.py +3 -0
  14. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/concurrency.py +7 -3
  15. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/datastructures.py +9 -7
  16. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/dependencies/utils.py +12 -7
  17. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/encoders.py +1 -1
  18. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/exception_handlers.py +7 -4
  19. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/exceptions.py +4 -2
  20. prefect-client-2.15.0/src/prefect/_vendor/fastapi/middleware/__init__.py +1 -0
  21. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/middleware/asyncexitstack.py +1 -1
  22. prefect-client-2.15.0/src/prefect/_vendor/fastapi/middleware/cors.py +3 -0
  23. prefect-client-2.15.0/src/prefect/_vendor/fastapi/middleware/gzip.py +3 -0
  24. prefect-client-2.15.0/src/prefect/_vendor/fastapi/middleware/httpsredirect.py +3 -0
  25. prefect-client-2.15.0/src/prefect/_vendor/fastapi/middleware/trustedhost.py +3 -0
  26. prefect-client-2.15.0/src/prefect/_vendor/fastapi/middleware/wsgi.py +3 -0
  27. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/openapi/docs.py +1 -1
  28. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/openapi/utils.py +3 -3
  29. prefect-client-2.15.0/src/prefect/_vendor/fastapi/requests.py +4 -0
  30. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/responses.py +13 -7
  31. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/routing.py +15 -15
  32. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/security/api_key.py +3 -3
  33. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/security/http.py +2 -2
  34. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/security/oauth2.py +2 -2
  35. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/security/open_id_connect_url.py +3 -3
  36. prefect-client-2.15.0/src/prefect/_vendor/fastapi/staticfiles.py +1 -0
  37. prefect-client-2.15.0/src/prefect/_vendor/fastapi/templating.py +3 -0
  38. prefect-client-2.15.0/src/prefect/_vendor/fastapi/testclient.py +1 -0
  39. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/utils.py +3 -3
  40. prefect-client-2.15.0/src/prefect/_vendor/fastapi/websockets.py +7 -0
  41. prefect-client-2.15.0/src/prefect/_vendor/starlette/__init__.py +1 -0
  42. prefect-client-2.15.0/src/prefect/_vendor/starlette/_compat.py +28 -0
  43. prefect-client-2.15.0/src/prefect/_vendor/starlette/_exception_handler.py +80 -0
  44. prefect-client-2.15.0/src/prefect/_vendor/starlette/_utils.py +88 -0
  45. prefect-client-2.15.0/src/prefect/_vendor/starlette/applications.py +261 -0
  46. prefect-client-2.15.0/src/prefect/_vendor/starlette/authentication.py +159 -0
  47. prefect-client-2.15.0/src/prefect/_vendor/starlette/background.py +43 -0
  48. prefect-client-2.15.0/src/prefect/_vendor/starlette/concurrency.py +59 -0
  49. prefect-client-2.15.0/src/prefect/_vendor/starlette/config.py +151 -0
  50. prefect-client-2.15.0/src/prefect/_vendor/starlette/convertors.py +87 -0
  51. prefect-client-2.15.0/src/prefect/_vendor/starlette/datastructures.py +707 -0
  52. prefect-client-2.15.0/src/prefect/_vendor/starlette/endpoints.py +130 -0
  53. prefect-client-2.15.0/src/prefect/_vendor/starlette/exceptions.py +60 -0
  54. prefect-client-2.15.0/src/prefect/_vendor/starlette/formparsers.py +276 -0
  55. prefect-client-2.15.0/src/prefect/_vendor/starlette/middleware/__init__.py +17 -0
  56. prefect-client-2.15.0/src/prefect/_vendor/starlette/middleware/authentication.py +52 -0
  57. prefect-client-2.15.0/src/prefect/_vendor/starlette/middleware/base.py +220 -0
  58. prefect-client-2.15.0/src/prefect/_vendor/starlette/middleware/cors.py +176 -0
  59. prefect-client-2.15.0/src/prefect/_vendor/starlette/middleware/errors.py +265 -0
  60. prefect-client-2.15.0/src/prefect/_vendor/starlette/middleware/exceptions.py +74 -0
  61. prefect-client-2.15.0/src/prefect/_vendor/starlette/middleware/gzip.py +113 -0
  62. prefect-client-2.15.0/src/prefect/_vendor/starlette/middleware/httpsredirect.py +19 -0
  63. prefect-client-2.15.0/src/prefect/_vendor/starlette/middleware/sessions.py +82 -0
  64. prefect-client-2.15.0/src/prefect/_vendor/starlette/middleware/trustedhost.py +64 -0
  65. prefect-client-2.15.0/src/prefect/_vendor/starlette/middleware/wsgi.py +147 -0
  66. prefect-client-2.15.0/src/prefect/_vendor/starlette/requests.py +328 -0
  67. prefect-client-2.15.0/src/prefect/_vendor/starlette/responses.py +347 -0
  68. prefect-client-2.15.0/src/prefect/_vendor/starlette/routing.py +933 -0
  69. prefect-client-2.15.0/src/prefect/_vendor/starlette/schemas.py +154 -0
  70. prefect-client-2.15.0/src/prefect/_vendor/starlette/staticfiles.py +248 -0
  71. prefect-client-2.15.0/src/prefect/_vendor/starlette/status.py +199 -0
  72. prefect-client-2.15.0/src/prefect/_vendor/starlette/templating.py +231 -0
  73. prefect-client-2.15.0/src/prefect/_vendor/starlette/testclient.py +805 -0
  74. prefect-client-2.15.0/src/prefect/_vendor/starlette/types.py +30 -0
  75. prefect-client-2.15.0/src/prefect/_vendor/starlette/websockets.py +193 -0
  76. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/blocks/core.py +3 -3
  77. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/blocks/notifications.py +8 -8
  78. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/client/base.py +1 -1
  79. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/client/cloud.py +1 -1
  80. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/client/orchestration.py +1 -1
  81. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/client/subscriptions.py +2 -6
  82. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/concurrency/services.py +1 -1
  83. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/context.py +3 -3
  84. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/deployments/deployments.py +3 -3
  85. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/engine.py +69 -9
  86. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/events/clients.py +1 -1
  87. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/filesystems.py +9 -9
  88. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/flow_runs.py +5 -1
  89. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/futures.py +1 -1
  90. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/infrastructure/container.py +3 -3
  91. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/infrastructure/kubernetes.py +4 -6
  92. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/infrastructure/process.py +3 -3
  93. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/input/run_input.py +1 -1
  94. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/logging/formatters.py +1 -1
  95. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/runner/server.py +3 -3
  96. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/settings.py +3 -4
  97. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/software/pip.py +1 -1
  98. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/task_engine.py +4 -0
  99. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/task_server.py +35 -17
  100. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/utilities/asyncutils.py +1 -1
  101. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/utilities/collections.py +1 -1
  102. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect_client.egg-info/PKG-INFO +1 -1
  103. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect_client.egg-info/SOURCES.txt +35 -0
  104. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect_client.egg-info/requires.txt +3 -1
  105. {prefect-client-2.14.21 → prefect-client-2.15.0}/versioneer.py +1 -3
  106. prefect-client-2.14.21/src/prefect/_vendor/fastapi/background.py +0 -1
  107. prefect-client-2.14.21/src/prefect/_vendor/fastapi/middleware/__init__.py +0 -1
  108. prefect-client-2.14.21/src/prefect/_vendor/fastapi/middleware/cors.py +0 -1
  109. prefect-client-2.14.21/src/prefect/_vendor/fastapi/middleware/gzip.py +0 -1
  110. prefect-client-2.14.21/src/prefect/_vendor/fastapi/middleware/httpsredirect.py +0 -3
  111. prefect-client-2.14.21/src/prefect/_vendor/fastapi/middleware/trustedhost.py +0 -3
  112. prefect-client-2.14.21/src/prefect/_vendor/fastapi/middleware/wsgi.py +0 -1
  113. prefect-client-2.14.21/src/prefect/_vendor/fastapi/requests.py +0 -2
  114. prefect-client-2.14.21/src/prefect/_vendor/fastapi/staticfiles.py +0 -1
  115. prefect-client-2.14.21/src/prefect/_vendor/fastapi/templating.py +0 -1
  116. prefect-client-2.14.21/src/prefect/_vendor/fastapi/testclient.py +0 -1
  117. prefect-client-2.14.21/src/prefect/_vendor/fastapi/websockets.py +0 -3
  118. {prefect-client-2.14.21 → prefect-client-2.15.0}/LICENSE +0 -0
  119. {prefect-client-2.14.21 → prefect-client-2.15.0}/MANIFEST.in +0 -0
  120. {prefect-client-2.14.21 → prefect-client-2.15.0}/README.md +0 -0
  121. {prefect-client-2.14.21 → prefect-client-2.15.0}/requirements-dev.txt +0 -0
  122. {prefect-client-2.14.21 → prefect-client-2.15.0}/setup.cfg +0 -0
  123. {prefect-client-2.14.21 → prefect-client-2.15.0}/setup.py +0 -0
  124. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/.prefectignore +0 -0
  125. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/__init__.py +0 -0
  126. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_internal/__init__.py +0 -0
  127. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_internal/_logging.py +0 -0
  128. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_internal/compatibility/__init__.py +0 -0
  129. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_internal/compatibility/deprecated.py +0 -0
  130. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_internal/compatibility/experimental.py +0 -0
  131. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_internal/concurrency/__init__.py +0 -0
  132. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_internal/concurrency/inspection.py +0 -0
  133. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_internal/concurrency/primitives.py +0 -0
  134. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_internal/concurrency/services.py +0 -0
  135. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_internal/concurrency/waiters.py +0 -0
  136. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_internal/pydantic/__init__.py +0 -0
  137. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_internal/pydantic/annotations/__init__.py +0 -0
  138. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_internal/pydantic/schemas.py +0 -0
  139. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_internal/pydantic/v2_validated_func.py +0 -0
  140. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_internal/pytz.py +0 -0
  141. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_internal/schemas/__init__.py +0 -0
  142. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_internal/schemas/bases.py +0 -0
  143. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_internal/schemas/fields.py +0 -0
  144. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_internal/schemas/serializers.py +0 -0
  145. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_internal/schemas/transformations.py +0 -0
  146. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_internal/schemas/validators.py +0 -0
  147. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/__init__.py +0 -0
  148. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/dependencies/__init__.py +0 -0
  149. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/dependencies/models.py +0 -0
  150. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/logger.py +0 -0
  151. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/openapi/__init__.py +0 -0
  152. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/openapi/constants.py +0 -0
  153. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/openapi/models.py +0 -0
  154. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/param_functions.py +0 -0
  155. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/params.py +0 -0
  156. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/security/__init__.py +0 -0
  157. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/security/base.py +0 -0
  158. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/security/utils.py +0 -0
  159. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_vendor/fastapi/types.py +0 -0
  160. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/_version.py +0 -0
  161. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/agent.py +0 -0
  162. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/blocks/__init__.py +0 -0
  163. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/blocks/abstract.py +0 -0
  164. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/blocks/fields.py +0 -0
  165. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/blocks/kubernetes.py +0 -0
  166. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/blocks/system.py +0 -0
  167. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/blocks/webhook.py +0 -0
  168. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/client/__init__.py +0 -0
  169. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/client/collections.py +0 -0
  170. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/client/constants.py +0 -0
  171. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/client/schemas/__init__.py +0 -0
  172. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/client/schemas/actions.py +0 -0
  173. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/client/schemas/filters.py +0 -0
  174. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/client/schemas/objects.py +0 -0
  175. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/client/schemas/responses.py +0 -0
  176. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/client/schemas/schedules.py +0 -0
  177. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/client/schemas/sorting.py +0 -0
  178. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/client/utilities.py +0 -0
  179. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/concurrency/__init__.py +0 -0
  180. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/concurrency/asyncio.py +0 -0
  181. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/concurrency/common.py +0 -0
  182. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/concurrency/events.py +0 -0
  183. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/concurrency/sync.py +0 -0
  184. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/deployments/__init__.py +0 -0
  185. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/deployments/base.py +0 -0
  186. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/deployments/runner.py +0 -0
  187. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/deployments/steps/__init__.py +0 -0
  188. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/deployments/steps/core.py +0 -0
  189. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/deployments/steps/pull.py +0 -0
  190. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/deployments/steps/utility.py +0 -0
  191. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/deprecated/__init__.py +0 -0
  192. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/deprecated/data_documents.py +0 -0
  193. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/events/__init__.py +0 -0
  194. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/events/actions.py +0 -0
  195. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/events/filters.py +0 -0
  196. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/events/instrument.py +0 -0
  197. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/events/related.py +0 -0
  198. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/events/schemas.py +0 -0
  199. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/events/utilities.py +0 -0
  200. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/events/worker.py +0 -0
  201. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/exceptions.py +0 -0
  202. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/flows.py +0 -0
  203. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/infrastructure/__init__.py +0 -0
  204. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/infrastructure/base.py +0 -0
  205. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/infrastructure/provisioners/__init__.py +0 -0
  206. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/infrastructure/provisioners/cloud_run.py +0 -0
  207. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/infrastructure/provisioners/container_instance.py +0 -0
  208. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/infrastructure/provisioners/ecs.py +0 -0
  209. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/infrastructure/provisioners/modal.py +0 -0
  210. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/input/__init__.py +0 -0
  211. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/input/actions.py +0 -0
  212. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/logging/__init__.py +0 -0
  213. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/logging/configuration.py +0 -0
  214. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/logging/handlers.py +0 -0
  215. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/logging/highlighters.py +0 -0
  216. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/logging/loggers.py +0 -0
  217. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/logging/logging.yml +0 -0
  218. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/manifests.py +0 -0
  219. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/packaging/__init__.py +0 -0
  220. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/packaging/base.py +0 -0
  221. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/packaging/docker.py +0 -0
  222. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/packaging/file.py +0 -0
  223. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/packaging/orion.py +0 -0
  224. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/packaging/serializers.py +0 -0
  225. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/plugins.py +0 -0
  226. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/profiles.toml +0 -0
  227. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/py.typed +0 -0
  228. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/results.py +0 -0
  229. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/runner/__init__.py +0 -0
  230. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/runner/runner.py +0 -0
  231. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/runner/storage.py +0 -0
  232. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/runner/submit.py +0 -0
  233. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/runner/utils.py +0 -0
  234. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/runtime/__init__.py +0 -0
  235. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/runtime/deployment.py +0 -0
  236. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/runtime/flow_run.py +0 -0
  237. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/runtime/task_run.py +0 -0
  238. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/serializers.py +0 -0
  239. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/server/api/collections_data/views/aggregate-worker-metadata.json +0 -0
  240. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/server/api/static/prefect-logo-mark-gradient.png +0 -0
  241. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/software/__init__.py +0 -0
  242. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/software/base.py +0 -0
  243. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/software/conda.py +0 -0
  244. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/software/python.py +0 -0
  245. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/states.py +0 -0
  246. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/task_runners.py +0 -0
  247. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/tasks.py +0 -0
  248. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/utilities/__init__.py +0 -0
  249. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/utilities/annotations.py +0 -0
  250. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/utilities/callables.py +0 -0
  251. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/utilities/compat.py +0 -0
  252. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/utilities/context.py +0 -0
  253. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/utilities/dispatch.py +0 -0
  254. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/utilities/dockerutils.py +0 -0
  255. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/utilities/filesystem.py +0 -0
  256. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/utilities/hashing.py +0 -0
  257. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/utilities/importtools.py +0 -0
  258. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/utilities/math.py +0 -0
  259. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/utilities/names.py +0 -0
  260. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/utilities/processutils.py +0 -0
  261. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/utilities/pydantic.py +0 -0
  262. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/utilities/render_swagger.py +0 -0
  263. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/utilities/services.py +0 -0
  264. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/utilities/slugify.py +0 -0
  265. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/utilities/templating.py +0 -0
  266. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/utilities/text.py +0 -0
  267. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/utilities/validation.py +0 -0
  268. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/utilities/visualization.py +0 -0
  269. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/variables.py +0 -0
  270. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/workers/__init__.py +0 -0
  271. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/workers/base.py +0 -0
  272. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/workers/block.py +0 -0
  273. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/workers/process.py +0 -0
  274. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/workers/server.py +0 -0
  275. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect/workers/utilities.py +0 -0
  276. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect_client.egg-info/dependency_links.txt +0 -0
  277. {prefect-client-2.14.21 → prefect-client-2.15.0}/src/prefect_client.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: prefect-client
3
- Version: 2.14.21
3
+ Version: 2.15.0
4
4
  Summary: Workflow orchestration and management.
5
5
  Home-page: https://www.prefect.io
6
6
  Author: Prefect Technologies, Inc.
@@ -6,6 +6,7 @@ coolname >= 1.0.4, < 3.0.0
6
6
  croniter >= 1.0.12, < 3.0.0
7
7
  fsspec >= 2022.5.0
8
8
  graphviz >= 0.20.1
9
+ greenback >= 1.2.0
9
10
  griffe >= 0.20.0
10
11
  httpcore >=0.15.0, < 2.0.0
11
12
  httpx[http2] >= 0.23, != 0.23.2
@@ -26,9 +27,12 @@ pyyaml >= 5.4.1, < 7.0.0
26
27
  rich >= 11.0, < 14.0
27
28
  ruamel.yaml >= 0.17.0
28
29
  sniffio >=1.3.0, < 2.0.0
29
- starlette >= 0.27.0, < 0.33.0
30
30
  toml >= 0.10.0
31
31
  typing_extensions >= 4.5.0, < 5.0.0
32
32
  ujson >= 5.8.0, < 6.0.0
33
33
  uvicorn >= 0.14.0
34
34
  websockets >= 10.4, < 13.0
35
+
36
+ # additional dependencies of starlette, which we're currently vendoring
37
+ itsdangerous
38
+ python-multipart>=0.0.7
@@ -10,6 +10,7 @@ dateparser >= 1.1.1, < 2.0.0
10
10
  docker >= 4.0, < 7.0
11
11
  graphviz >= 0.20.1
12
12
  griffe >= 0.20.0
13
+ greenback >= 1.2.0
13
14
  jinja2 >= 3.0.0, < 4.0.0
14
15
  kubernetes >= 24.2.0, < 30.0.0
15
16
  pytz >= 2021.1, < 2025
@@ -16,8 +16,11 @@ from typing import (
16
16
  Union,
17
17
  )
18
18
 
19
+ import greenback
19
20
  from typing_extensions import ParamSpec
20
21
 
22
+ from prefect._internal.concurrency import logger
23
+ from prefect._internal.concurrency.event_loop import get_running_loop
21
24
  from prefect._internal.concurrency.threads import (
22
25
  WorkerThread,
23
26
  get_global_loop,
@@ -179,7 +182,7 @@ class from_async(_base):
179
182
  for context in contexts or []:
180
183
  stack.enter_context(context)
181
184
  await waiter.wait()
182
- return call.result()
185
+ return await call.aresult()
183
186
 
184
187
  @staticmethod
185
188
  async def wait_for_call_in_new_thread(
@@ -193,7 +196,7 @@ class from_async(_base):
193
196
  waiter.add_done_callback(callback)
194
197
  _base.call_soon_in_new_thread(call, timeout=timeout)
195
198
  await waiter.wait()
196
- return call.result()
199
+ return await call.aresult()
197
200
 
198
201
  @staticmethod
199
202
  def call_in_waiting_thread(
@@ -231,6 +234,25 @@ class from_sync(_base):
231
234
  done_callbacks: Optional[Iterable[Call]] = None,
232
235
  contexts: Optional[Iterable[ContextManager]] = None,
233
236
  ) -> Awaitable[T]:
237
+ # Check for a running event loop to prevent blocking
238
+ if get_running_loop():
239
+ if greenback.has_portal():
240
+ # Use greenback to avoid blocking the event loop while waiting
241
+ return greenback.await_(
242
+ from_async.wait_for_call_in_loop_thread(
243
+ __call,
244
+ timeout=timeout,
245
+ done_callbacks=done_callbacks,
246
+ contexts=contexts,
247
+ )
248
+ )
249
+ else:
250
+ logger.error(
251
+ "Detected unsafe call to `from_sync` from thread with event loop. "
252
+ "Use `await greenback.ensure_portal()` to allow call to run "
253
+ "without blocking the event loop."
254
+ )
255
+
234
256
  call = _cast_to_call(__call)
235
257
  waiter = SyncWaiter(call)
236
258
  _base.call_soon_in_loop_thread(call, timeout=timeout)
@@ -262,6 +284,10 @@ class from_sync(_base):
262
284
  thread: threading.Thread,
263
285
  timeout: Optional[float] = None,
264
286
  ) -> T:
287
+ if get_running_loop():
288
+ raise RuntimeError(
289
+ "Detected unsafe call to `from_sync` from thread with event loop."
290
+ )
265
291
  call = _base.call_soon_in_waiting_thread(__call, thread, timeout=timeout)
266
292
  return call.result()
267
293
 
@@ -269,6 +295,10 @@ class from_sync(_base):
269
295
  def call_in_new_thread(
270
296
  __call: Union[Callable[[], T], Call[T]], timeout: Optional[float] = None
271
297
  ) -> T:
298
+ if get_running_loop():
299
+ raise RuntimeError(
300
+ "Detected unsafe call to `from_sync` from thread with event loop."
301
+ )
272
302
  call = _base.call_soon_in_new_thread(__call, timeout=timeout)
273
303
  return call.result()
274
304
 
@@ -283,5 +313,10 @@ class from_sync(_base):
283
313
  call = _cast_to_call(__call)
284
314
  return call()
285
315
 
316
+ if get_running_loop():
317
+ raise RuntimeError(
318
+ "Detected unsafe call to `from_sync` from thread with event loop."
319
+ )
320
+
286
321
  call = _base.call_soon_in_loop_thread(__call, timeout=timeout)
287
322
  return call.result()
@@ -18,6 +18,7 @@ from concurrent.futures._base import (
18
18
  )
19
19
  from typing import Any, Awaitable, Callable, Dict, Generic, Optional, Tuple, TypeVar
20
20
 
21
+ import greenback
21
22
  from typing_extensions import ParamSpec
22
23
 
23
24
  from prefect._internal.concurrency import logger
@@ -347,6 +348,14 @@ class Call(Generic[T]):
347
348
  logger.debug("Finished call %r", self) # noqa: F821
348
349
 
349
350
  async def _run_async(self, coro):
351
+ from prefect._internal.concurrency.threads import in_global_loop
352
+
353
+ # Ensure the greenback portal is shimmed for this task so we can safely call
354
+ # back into async code from sync code if the user does something silly; avoid
355
+ # this overhead for our internal event loop
356
+ if not in_global_loop():
357
+ await greenback.ensure_portal()
358
+
350
359
  cancel_scope = None
351
360
  try:
352
361
  with set_current_call(self):
@@ -230,7 +230,9 @@ class CancelScope(abc.ABC):
230
230
  else (
231
231
  "cancelled"
232
232
  if self._cancelled
233
- else "running" if self._started else "pending"
233
+ else "running"
234
+ if self._started
235
+ else "pending"
234
236
  )
235
237
  ).upper()
236
238
  timeout = f", timeout={self._timeout:.2f}" if self._timeout else ""
@@ -29,7 +29,7 @@ def call_in_loop(
29
29
  __loop: asyncio.AbstractEventLoop,
30
30
  __fn: Callable[P, T],
31
31
  *args: P.args,
32
- **kwargs: P.kwargs
32
+ **kwargs: P.kwargs,
33
33
  ) -> T:
34
34
  """
35
35
  Run a synchronous call in event loop's thread from another thread.
@@ -49,7 +49,7 @@ def call_soon_in_loop(
49
49
  __loop: asyncio.AbstractEventLoop,
50
50
  __fn: Callable[P, T],
51
51
  *args: P.args,
52
- **kwargs: P.kwargs
52
+ **kwargs: P.kwargs,
53
53
  ) -> concurrent.futures.Future:
54
54
  """
55
55
  Run a synchronous call in an event loop's thread from another thread.
@@ -257,11 +257,12 @@ def in_global_loop() -> bool:
257
257
  """
258
258
  Check if called from the global loop.
259
259
  """
260
- if GLOBAL_LOOP is None:
260
+ loop = get_running_loop()
261
+ if GLOBAL_LOOP is None or not loop:
261
262
  # Avoid creating a global loop if there isn't one
262
263
  return False
263
264
 
264
- return get_global_loop()._loop == get_running_loop()
265
+ return GLOBAL_LOOP._loop == loop
265
266
 
266
267
 
267
268
  def wait_for_global_loop_exit(timeout: Optional[float] = None) -> None:
@@ -13,9 +13,9 @@ from typing_extensions import Annotated
13
13
 
14
14
 
15
15
  class _PendulumDateTimeAnnotation:
16
- _pendulum_type: t.Type[t.Union[pendulum.DateTime, pendulum.Date, pendulum.Time]] = (
17
- pendulum.DateTime
18
- )
16
+ _pendulum_type: t.Type[
17
+ t.Union[pendulum.DateTime, pendulum.Date, pendulum.Time]
18
+ ] = pendulum.DateTime
19
19
 
20
20
  _pendulum_types_to_schemas = {
21
21
  pendulum.DateTime: core_schema.datetime_schema(),
@@ -35,7 +35,7 @@ class _PendulumDateTimeAnnotation:
35
35
  return pendulum.parse(value)
36
36
 
37
37
  def to_str(
38
- value: t.Union[pendulum.DateTime, pendulum.Date, pendulum.Time]
38
+ value: t.Union[pendulum.DateTime, pendulum.Date, pendulum.Time],
39
39
  ) -> str:
40
40
  return value.isoformat()
41
41
 
@@ -59,7 +59,7 @@ def process_v2_params(
59
59
  *,
60
60
  position: int,
61
61
  docstrings: t.Dict[str, str],
62
- aliases: t.Dict
62
+ aliases: t.Dict,
63
63
  ) -> t.Tuple[str, t.Any, "pydantic.Field"]:
64
64
  """
65
65
  Generate a sanitized name, type, and pydantic.Field for a given parameter.
@@ -98,7 +98,7 @@ def create_v2_schema(
98
98
  name_: str,
99
99
  model_cfg: t.Optional[ConfigDict] = None,
100
100
  model_base: t.Optional[t.Type[V2BaseModel]] = None,
101
- **model_fields
101
+ **model_fields,
102
102
  ):
103
103
  """
104
104
  Create a pydantic v2 model and craft a v1 compatible schema from it.
@@ -2,7 +2,7 @@
2
2
 
3
3
  __version__ = "0.99.1"
4
4
 
5
- from starlette import status as status
5
+ from prefect._vendor.starlette import status as status
6
6
 
7
7
  from .applications import FastAPI as FastAPI
8
8
  from .background import BackgroundTasks as BackgroundTasks
@@ -36,17 +36,17 @@ from prefect._vendor.fastapi.openapi.utils import get_openapi
36
36
  from prefect._vendor.fastapi.params import Depends
37
37
  from prefect._vendor.fastapi.types import DecoratedCallable
38
38
  from prefect._vendor.fastapi.utils import generate_unique_id
39
- from starlette.applications import Starlette
40
- from starlette.datastructures import State
41
- from starlette.exceptions import HTTPException
42
- from starlette.middleware import Middleware
43
- from starlette.middleware.base import BaseHTTPMiddleware
44
- from starlette.middleware.errors import ServerErrorMiddleware
45
- from starlette.middleware.exceptions import ExceptionMiddleware
46
- from starlette.requests import Request
47
- from starlette.responses import HTMLResponse, JSONResponse, Response
48
- from starlette.routing import BaseRoute
49
- from starlette.types import ASGIApp, Lifespan, Receive, Scope, Send
39
+ from prefect._vendor.starlette.applications import Starlette
40
+ from prefect._vendor.starlette.datastructures import State
41
+ from prefect._vendor.starlette.exceptions import HTTPException
42
+ from prefect._vendor.starlette.middleware import Middleware
43
+ from prefect._vendor.starlette.middleware.base import BaseHTTPMiddleware
44
+ from prefect._vendor.starlette.middleware.errors import ServerErrorMiddleware
45
+ from prefect._vendor.starlette.middleware.exceptions import ExceptionMiddleware
46
+ from prefect._vendor.starlette.requests import Request
47
+ from prefect._vendor.starlette.responses import HTMLResponse, JSONResponse, Response
48
+ from prefect._vendor.starlette.routing import BaseRoute
49
+ from prefect._vendor.starlette.types import ASGIApp, Lifespan, Receive, Scope, Send
50
50
 
51
51
  AppType = TypeVar("AppType", bound="FastAPI")
52
52
 
@@ -150,7 +150,7 @@ class FastAPI(Starlette):
150
150
  )
151
151
  self.exception_handlers: Dict[
152
152
  Any, Callable[[Request, Any], Union[Response, Awaitable[Response]]]
153
- ] = ({} if exception_handlers is None else dict(exception_handlers))
153
+ ] = {} if exception_handlers is None else dict(exception_handlers)
154
154
  self.exception_handlers.setdefault(HTTPException, http_exception_handler)
155
155
  self.exception_handlers.setdefault(
156
156
  RequestValidationError, request_validation_exception_handler
@@ -168,7 +168,7 @@ class FastAPI(Starlette):
168
168
  self.setup()
169
169
 
170
170
  def build_middleware_stack(self) -> ASGIApp:
171
- # Duplicate/override from Starlette to add AsyncExitStackMiddleware
171
+ # Duplicate/override from prefect._vendor.starlette to add AsyncExitStackMiddleware
172
172
  # inside of ExceptionMiddleware, inside of custom user middlewares
173
173
  debug = self.debug
174
174
  error_handler = None
@@ -0,0 +1,3 @@
1
+ from prefect._vendor.starlette.background import (
2
+ BackgroundTasks as BackgroundTasks,
3
+ )
@@ -4,9 +4,13 @@ from typing import AsyncGenerator, ContextManager, TypeVar
4
4
 
5
5
  import anyio
6
6
  from anyio import CapacityLimiter
7
- from starlette.concurrency import iterate_in_threadpool as iterate_in_threadpool # noqa
8
- from starlette.concurrency import run_in_threadpool as run_in_threadpool # noqa
9
- from starlette.concurrency import ( # noqa
7
+ from prefect._vendor.starlette.concurrency import (
8
+ iterate_in_threadpool as iterate_in_threadpool,
9
+ ) # noqa
10
+ from prefect._vendor.starlette.concurrency import (
11
+ run_in_threadpool as run_in_threadpool,
12
+ ) # noqa
13
+ from prefect._vendor.starlette.concurrency import ( # noqa
10
14
  run_until_first_complete as run_until_first_complete,
11
15
  )
12
16
 
@@ -1,12 +1,14 @@
1
1
  from typing import Any, Callable, Dict, Iterable, Type, TypeVar
2
2
 
3
- from starlette.datastructures import URL as URL # noqa: F401
4
- from starlette.datastructures import Address as Address # noqa: F401
5
- from starlette.datastructures import FormData as FormData # noqa: F401
6
- from starlette.datastructures import Headers as Headers # noqa: F401
7
- from starlette.datastructures import QueryParams as QueryParams # noqa: F401
8
- from starlette.datastructures import State as State # noqa: F401
9
- from starlette.datastructures import UploadFile as StarletteUploadFile
3
+ from prefect._vendor.starlette.datastructures import URL as URL # noqa: F401
4
+ from prefect._vendor.starlette.datastructures import Address as Address # noqa: F401
5
+ from prefect._vendor.starlette.datastructures import FormData as FormData # noqa: F401
6
+ from prefect._vendor.starlette.datastructures import Headers as Headers # noqa: F401
7
+ from prefect._vendor.starlette.datastructures import (
8
+ QueryParams as QueryParams, # noqa: F401
9
+ )
10
+ from prefect._vendor.starlette.datastructures import State as State # noqa: F401
11
+ from prefect._vendor.starlette.datastructures import UploadFile as StarletteUploadFile
10
12
 
11
13
 
12
14
  class UploadFile(StarletteUploadFile):
@@ -75,12 +75,17 @@ else:
75
75
  from pydantic.typing import evaluate_forwardref, get_args, get_origin
76
76
  from pydantic.utils import lenient_issubclass
77
77
 
78
- from starlette.background import BackgroundTasks
79
- from starlette.concurrency import run_in_threadpool
80
- from starlette.datastructures import FormData, Headers, QueryParams, UploadFile
81
- from starlette.requests import HTTPConnection, Request
82
- from starlette.responses import Response
83
- from starlette.websockets import WebSocket
78
+ from prefect._vendor.starlette.background import BackgroundTasks
79
+ from prefect._vendor.starlette.concurrency import run_in_threadpool
80
+ from prefect._vendor.starlette.datastructures import (
81
+ FormData,
82
+ Headers,
83
+ QueryParams,
84
+ UploadFile,
85
+ )
86
+ from prefect._vendor.starlette.requests import HTTPConnection, Request
87
+ from prefect._vendor.starlette.responses import Response
88
+ from prefect._vendor.starlette.websockets import WebSocket
84
89
  from typing_extensions import Annotated
85
90
 
86
91
  sequence_shapes = {
@@ -798,7 +803,7 @@ async def request_body_to_args(
798
803
  results: List[Union[bytes, str]] = []
799
804
 
800
805
  async def process_fn(
801
- fn: Callable[[], Coroutine[Any, Any, Any]]
806
+ fn: Callable[[], Coroutine[Any, Any, Any]],
802
807
  ) -> None:
803
808
  result = await fn()
804
809
  results.append(result) # noqa: B023
@@ -19,7 +19,7 @@ DictIntStrAny = Dict[Union[int, str], Any]
19
19
 
20
20
 
21
21
  def generate_encoders_by_class_tuples(
22
- type_encoder_map: Dict[Any, Callable[[Any], Any]]
22
+ type_encoder_map: Dict[Any, Callable[[Any], Any]],
23
23
  ) -> Dict[Callable[[Any], Any], Tuple[Any, ...]]:
24
24
  encoders_by_class_tuples: Dict[Callable[[Any], Any], Tuple[Any, ...]] = defaultdict(
25
25
  tuple
@@ -5,10 +5,13 @@ from prefect._vendor.fastapi.exceptions import (
5
5
  )
6
6
  from prefect._vendor.fastapi.utils import is_body_allowed_for_status_code
7
7
  from prefect._vendor.fastapi.websockets import WebSocket
8
- from starlette.exceptions import HTTPException
9
- from starlette.requests import Request
10
- from starlette.responses import JSONResponse, Response
11
- from starlette.status import HTTP_422_UNPROCESSABLE_ENTITY, WS_1008_POLICY_VIOLATION
8
+ from prefect._vendor.starlette.exceptions import HTTPException
9
+ from prefect._vendor.starlette.requests import Request
10
+ from prefect._vendor.starlette.responses import JSONResponse, Response
11
+ from prefect._vendor.starlette.status import (
12
+ HTTP_422_UNPROCESSABLE_ENTITY,
13
+ WS_1008_POLICY_VIOLATION,
14
+ )
12
15
 
13
16
 
14
17
  async def http_exception_handler(request: Request, exc: HTTPException) -> Response:
@@ -9,8 +9,10 @@ else:
9
9
  from pydantic import BaseModel, ValidationError, create_model
10
10
  from pydantic.error_wrappers import ErrorList
11
11
 
12
- from starlette.exceptions import HTTPException as StarletteHTTPException
13
- from starlette.exceptions import WebSocketException as WebSocketException # noqa: F401
12
+ from prefect._vendor.starlette.exceptions import HTTPException as StarletteHTTPException
13
+ from prefect._vendor.starlette.exceptions import (
14
+ WebSocketException as WebSocketException, # noqa: F401
15
+ )
14
16
 
15
17
 
16
18
  class HTTPException(StarletteHTTPException):
@@ -0,0 +1 @@
1
+ from prefect._vendor.starlette.middleware import Middleware as Middleware
@@ -1,7 +1,7 @@
1
1
  from typing import Optional
2
2
 
3
3
  from prefect._vendor.fastapi.concurrency import AsyncExitStack
4
- from starlette.types import ASGIApp, Receive, Scope, Send
4
+ from prefect._vendor.starlette.types import ASGIApp, Receive, Scope, Send
5
5
 
6
6
 
7
7
  class AsyncExitStackMiddleware:
@@ -0,0 +1,3 @@
1
+ from prefect._vendor.starlette.middleware.cors import (
2
+ CORSMiddleware as CORSMiddleware,
3
+ )
@@ -0,0 +1,3 @@
1
+ from prefect._vendor.starlette.middleware.gzip import (
2
+ GZipMiddleware as GZipMiddleware,
3
+ )
@@ -0,0 +1,3 @@
1
+ from prefect._vendor.starlette.middleware.httpsredirect import ( # noqa
2
+ HTTPSRedirectMiddleware as HTTPSRedirectMiddleware,
3
+ )
@@ -0,0 +1,3 @@
1
+ from prefect._vendor.starlette.middleware.trustedhost import ( # noqa
2
+ TrustedHostMiddleware as TrustedHostMiddleware,
3
+ )
@@ -0,0 +1,3 @@
1
+ from prefect._vendor.starlette.middleware.wsgi import (
2
+ WSGIMiddleware as WSGIMiddleware,
3
+ )
@@ -2,7 +2,7 @@ import json
2
2
  from typing import Any, Dict, Optional
3
3
 
4
4
  from prefect._vendor.fastapi.encoders import jsonable_encoder
5
- from starlette.responses import HTMLResponse
5
+ from prefect._vendor.starlette.responses import HTMLResponse
6
6
 
7
7
  swagger_ui_default_parameters = {
8
8
  "dom_id": "#swagger-ui",
@@ -44,9 +44,9 @@ else:
44
44
  )
45
45
  from pydantic.utils import lenient_issubclass
46
46
 
47
- from starlette.responses import JSONResponse
48
- from starlette.routing import BaseRoute
49
- from starlette.status import HTTP_422_UNPROCESSABLE_ENTITY
47
+ from prefect._vendor.starlette.responses import JSONResponse
48
+ from prefect._vendor.starlette.routing import BaseRoute
49
+ from prefect._vendor.starlette.status import HTTP_422_UNPROCESSABLE_ENTITY
50
50
 
51
51
  validation_error_definition = {
52
52
  "title": "ValidationError",
@@ -0,0 +1,4 @@
1
+ from prefect._vendor.starlette.requests import (
2
+ HTTPConnection as HTTPConnection, # noqa: F401
3
+ )
4
+ from prefect._vendor.starlette.requests import Request as Request # noqa: F401
@@ -1,12 +1,18 @@
1
1
  from typing import Any
2
2
 
3
- from starlette.responses import FileResponse as FileResponse # noqa
4
- from starlette.responses import HTMLResponse as HTMLResponse # noqa
5
- from starlette.responses import JSONResponse as JSONResponse # noqa
6
- from starlette.responses import PlainTextResponse as PlainTextResponse # noqa
7
- from starlette.responses import RedirectResponse as RedirectResponse # noqa
8
- from starlette.responses import Response as Response # noqa
9
- from starlette.responses import StreamingResponse as StreamingResponse # noqa
3
+ from prefect._vendor.starlette.responses import FileResponse as FileResponse # noqa
4
+ from prefect._vendor.starlette.responses import HTMLResponse as HTMLResponse # noqa
5
+ from prefect._vendor.starlette.responses import JSONResponse as JSONResponse # noqa
6
+ from prefect._vendor.starlette.responses import (
7
+ PlainTextResponse as PlainTextResponse, # noqa
8
+ )
9
+ from prefect._vendor.starlette.responses import (
10
+ RedirectResponse as RedirectResponse, # noqa
11
+ )
12
+ from prefect._vendor.starlette.responses import Response as Response # noqa
13
+ from prefect._vendor.starlette.responses import (
14
+ StreamingResponse as StreamingResponse, # noqa
15
+ )
10
16
 
11
17
  try:
12
18
  import ujson
@@ -57,12 +57,12 @@ else:
57
57
  from pydantic.fields import ModelField, Undefined
58
58
  from pydantic.utils import lenient_issubclass
59
59
 
60
- from starlette import routing
61
- from starlette.concurrency import run_in_threadpool
62
- from starlette.exceptions import HTTPException
63
- from starlette.requests import Request
64
- from starlette.responses import JSONResponse, Response
65
- from starlette.routing import (
60
+ from prefect._vendor.starlette import routing
61
+ from prefect._vendor.starlette.concurrency import run_in_threadpool
62
+ from prefect._vendor.starlette.exceptions import HTTPException
63
+ from prefect._vendor.starlette.requests import Request
64
+ from prefect._vendor.starlette.responses import JSONResponse, Response
65
+ from prefect._vendor.starlette.routing import (
66
66
  BaseRoute,
67
67
  Match,
68
68
  compile_path,
@@ -70,9 +70,9 @@ from starlette.routing import (
70
70
  request_response,
71
71
  websocket_session,
72
72
  )
73
- from starlette.routing import Mount as Mount # noqa
74
- from starlette.types import ASGIApp, Lifespan, Scope
75
- from starlette.websockets import WebSocket
73
+ from prefect._vendor.starlette.routing import Mount as Mount # noqa
74
+ from prefect._vendor.starlette.types import ASGIApp, Lifespan, Scope
75
+ from prefect._vendor.starlette.websockets import WebSocket
76
76
 
77
77
 
78
78
  def _prepare_response_content(
@@ -408,9 +408,9 @@ class APIRoute(routing.Route):
408
408
  methods = ["GET"]
409
409
  self.methods: Set[str] = {method.upper() for method in methods}
410
410
  if isinstance(generate_unique_id_function, DefaultPlaceholder):
411
- current_generate_unique_id: Callable[["APIRoute"], str] = (
412
- generate_unique_id_function.value
413
- )
411
+ current_generate_unique_id: Callable[
412
+ ["APIRoute"], str
413
+ ] = generate_unique_id_function.value
414
414
  else:
415
415
  current_generate_unique_id = generate_unique_id_function
416
416
  self.unique_id = self.operation_id or current_generate_unique_id(self)
@@ -433,9 +433,9 @@ class APIRoute(routing.Route):
433
433
  # would pass the validation and be returned as is.
434
434
  # By being a new field, no inheritance will be passed as is. A new model
435
435
  # will be always created.
436
- self.secure_cloned_response_field: Optional[ModelField] = (
437
- create_cloned_field(self.response_field)
438
- )
436
+ self.secure_cloned_response_field: Optional[
437
+ ModelField
438
+ ] = create_cloned_field(self.response_field)
439
439
  else:
440
440
  self.response_field = None # type: ignore
441
441
  self.secure_cloned_response_field = None
@@ -2,9 +2,9 @@ from typing import Optional
2
2
 
3
3
  from prefect._vendor.fastapi.openapi.models import APIKey, APIKeyIn
4
4
  from prefect._vendor.fastapi.security.base import SecurityBase
5
- from starlette.exceptions import HTTPException
6
- from starlette.requests import Request
7
- from starlette.status import HTTP_403_FORBIDDEN
5
+ from prefect._vendor.starlette.exceptions import HTTPException
6
+ from prefect._vendor.starlette.requests import Request
7
+ from prefect._vendor.starlette.status import HTTP_403_FORBIDDEN
8
8
 
9
9
 
10
10
  class APIKeyBase(SecurityBase):
@@ -15,8 +15,8 @@ if HAS_PYDANTIC_V2:
15
15
  else:
16
16
  from pydantic import BaseModel
17
17
 
18
- from starlette.requests import Request
19
- from starlette.status import HTTP_401_UNAUTHORIZED, HTTP_403_FORBIDDEN
18
+ from prefect._vendor.starlette.requests import Request
19
+ from prefect._vendor.starlette.status import HTTP_401_UNAUTHORIZED, HTTP_403_FORBIDDEN
20
20
 
21
21
 
22
22
  class HTTPBasicCredentials(BaseModel):
@@ -6,8 +6,8 @@ from prefect._vendor.fastapi.openapi.models import OAuthFlows as OAuthFlowsModel
6
6
  from prefect._vendor.fastapi.param_functions import Form
7
7
  from prefect._vendor.fastapi.security.base import SecurityBase
8
8
  from prefect._vendor.fastapi.security.utils import get_authorization_scheme_param
9
- from starlette.requests import Request
10
- from starlette.status import HTTP_401_UNAUTHORIZED, HTTP_403_FORBIDDEN
9
+ from prefect._vendor.starlette.requests import Request
10
+ from prefect._vendor.starlette.status import HTTP_401_UNAUTHORIZED, HTTP_403_FORBIDDEN
11
11
 
12
12
 
13
13
  class OAuth2PasswordRequestForm:
@@ -2,9 +2,9 @@ from typing import Optional
2
2
 
3
3
  from prefect._vendor.fastapi.openapi.models import OpenIdConnect as OpenIdConnectModel
4
4
  from prefect._vendor.fastapi.security.base import SecurityBase
5
- from starlette.exceptions import HTTPException
6
- from starlette.requests import Request
7
- from starlette.status import HTTP_403_FORBIDDEN
5
+ from prefect._vendor.starlette.exceptions import HTTPException
6
+ from prefect._vendor.starlette.requests import Request
7
+ from prefect._vendor.starlette.status import HTTP_403_FORBIDDEN
8
8
 
9
9
 
10
10
  class OpenIdConnect(SecurityBase):
@@ -0,0 +1 @@
1
+ from prefect._vendor.starlette.staticfiles import StaticFiles as StaticFiles # noqa
@@ -0,0 +1,3 @@
1
+ from prefect._vendor.starlette.templating import (
2
+ Jinja2Templates as Jinja2Templates,
3
+ )
@@ -0,0 +1 @@
1
+ from prefect._vendor.starlette.testclient import TestClient as TestClient # noqa