prefect-client 3.3.3__py3-none-any.whl → 3.3.4__py3-none-any.whl

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.
prefect/_build_info.py CHANGED
@@ -1,5 +1,5 @@
1
1
  # Generated by versioningit
2
- __version__ = "3.3.3"
3
- __build_date__ = "2025-04-05 01:43:07.772891+00:00"
4
- __git_commit__ = "4100d4ea3c8d2559e48d9860a5b241d8cd29d47e"
2
+ __version__ = "3.3.4"
3
+ __build_date__ = "2025-04-11 00:26:30.248307+00:00"
4
+ __git_commit__ = "7ca03553d477301616da47ff29287096a4a785ea"
5
5
  __dirty__ = False
@@ -110,6 +110,7 @@ def create_default_prefect_yaml(
110
110
  f,
111
111
  sort_keys=False,
112
112
  )
113
+
113
114
  return True
114
115
 
115
116
 
@@ -293,6 +294,10 @@ def _save_deployment_to_prefect_file(
293
294
 
294
295
  current_directory_name = os.path.basename(os.getcwd())
295
296
  if not prefect_file.exists():
297
+ if triggers:
298
+ deployment["triggers"] = triggers
299
+ if sla:
300
+ deployment["sla"] = sla
296
301
  create_default_prefect_yaml(
297
302
  ".",
298
303
  current_directory_name,
prefect/runner/runner.py CHANGED
@@ -1363,7 +1363,9 @@ class Runner:
1363
1363
  ready_to_submit = await self._propose_pending_state(flow_run)
1364
1364
 
1365
1365
  if ready_to_submit:
1366
- readiness_result = await self._runs_task_group.start(
1366
+ readiness_result: (
1367
+ anyio.abc.Process | Exception
1368
+ ) = await self._runs_task_group.start(
1367
1369
  partial(
1368
1370
  self._submit_run_and_capture_errors,
1369
1371
  flow_run=flow_run,
@@ -1374,7 +1376,7 @@ class Runner:
1374
1376
  if readiness_result and not isinstance(readiness_result, Exception):
1375
1377
  async with self._flow_run_process_map_lock:
1376
1378
  self._flow_run_process_map[flow_run.id] = ProcessMapEntry(
1377
- pid=readiness_result, flow_run=flow_run
1379
+ pid=readiness_result.pid, flow_run=flow_run
1378
1380
  )
1379
1381
  # Heartbeats are opt-in and only emitted if a heartbeat frequency is set
1380
1382
  if self.heartbeat_seconds is not None:
prefect/runner/server.py CHANGED
@@ -1,6 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import uuid
4
+ from datetime import datetime
4
5
  from typing import TYPE_CHECKING, Any, Callable, Coroutine, Hashable, Optional
5
6
 
6
7
  import uvicorn
@@ -8,6 +9,7 @@ from fastapi import APIRouter, FastAPI, HTTPException, status
8
9
  from fastapi.responses import JSONResponse
9
10
  from typing_extensions import Literal
10
11
 
12
+ from prefect._internal.compatibility.deprecated import deprecated_callable
11
13
  from prefect._internal.schemas.validators import validate_values_conform_to_schema
12
14
  from prefect.client.orchestration import get_client
13
15
  from prefect.exceptions import MissingFlowError, ScriptError
@@ -252,6 +254,11 @@ def _build_generic_endpoint_for_flows(
252
254
  return _create_flow_run_for_flow_from_fqn
253
255
 
254
256
 
257
+ @deprecated_callable(
258
+ start_date=datetime(2025, 4, 1),
259
+ end_date=datetime(2025, 10, 1),
260
+ help="Use background tasks (https://docs.prefect.io/v3/develop/deferred-tasks) or `run_deployment` and `.serve` instead of submitting runs to the Runner webserver.",
261
+ )
255
262
  async def build_server(runner: "Runner") -> FastAPI:
256
263
  """
257
264
  Build a FastAPI server for a runner.
@@ -296,6 +303,11 @@ async def build_server(runner: "Runner") -> FastAPI:
296
303
  return webserver
297
304
 
298
305
 
306
+ @deprecated_callable(
307
+ start_date=datetime(2025, 4, 1),
308
+ end_date=datetime(2025, 10, 1),
309
+ help="Use background tasks (https://docs.prefect.io/v3/develop/deferred-tasks) or `run_deployment` and `.serve` instead of submitting runs to the Runner webserver.",
310
+ )
299
311
  def start_webserver(runner: "Runner", log_level: str | None = None) -> None:
300
312
  """
301
313
  Run a FastAPI server for a runner.
prefect/runner/submit.py CHANGED
@@ -3,12 +3,14 @@ from __future__ import annotations
3
3
  import asyncio
4
4
  import inspect
5
5
  import uuid
6
+ from datetime import datetime
6
7
  from typing import TYPE_CHECKING, Any, Union, overload
7
8
 
8
9
  import anyio
9
10
  import httpx
10
11
  from typing_extensions import Literal, TypeAlias
11
12
 
13
+ from prefect._internal.compatibility.deprecated import deprecated_callable
12
14
  from prefect.client.orchestration import get_client
13
15
  from prefect.client.schemas.filters import (
14
16
  FlowRunFilter,
@@ -119,6 +121,11 @@ def submit_to_runner(
119
121
  ) -> list[FlowRun]: ...
120
122
 
121
123
 
124
+ @deprecated_callable(
125
+ start_date=datetime(2025, 4, 1),
126
+ end_date=datetime(2025, 10, 1),
127
+ help="Use background tasks (https://docs.prefect.io/v3/develop/deferred-tasks) or `run_deployment` and `.serve` instead of submitting runs to the Runner webserver.",
128
+ )
122
129
  @sync_compatible
123
130
  async def submit_to_runner(
124
131
  prefect_callable: Flow[Any, Any],
@@ -186,13 +193,18 @@ async def submit_to_runner(
186
193
  return submitted_runs
187
194
 
188
195
 
196
+ @deprecated_callable(
197
+ start_date=datetime(2025, 4, 1),
198
+ end_date=datetime(2025, 10, 1),
199
+ help="Use background tasks (https://docs.prefect.io/v3/develop/deferred-tasks) or `run_deployment` and `.serve` instead of submitting runs to the Runner webserver.",
200
+ )
189
201
  @sync_compatible
190
202
  async def wait_for_submitted_runs(
191
203
  flow_run_filter: FlowRunFilter | None = None,
192
204
  task_run_filter: TaskRunFilter | None = None,
193
205
  timeout: float | None = None,
194
206
  poll_interval: float = 3.0,
195
- ):
207
+ ) -> uuid.UUID | None:
196
208
  """
197
209
  Wait for completion of any provided flow runs (eventually task runs), as well as subflow runs
198
210
  of the current flow run (if called from within a flow run and subflow runs exist).
@@ -911,6 +911,7 @@ async def update_deployment_schedule(
911
911
  session=session,
912
912
  deployment_id=deployment_id,
913
913
  auto_scheduled_only=True,
914
+ future_only=True,
914
915
  )
915
916
 
916
917
 
@@ -50,7 +50,7 @@ class ServerEventsSettings(PrefectBaseSettings):
50
50
  )
51
51
 
52
52
  maximum_related_resources: int = Field(
53
- default=500,
53
+ default=100,
54
54
  description="The maximum number of related resources an Event may have.",
55
55
  validation_alias=AliasChoices(
56
56
  AliasPath("maximum_related_resources"),
@@ -385,6 +385,13 @@ class ServerServicesSchedulerSettings(ServicesBaseSetting):
385
385
  ),
386
386
  )
387
387
 
388
+ recent_deployments_loop_seconds: float = Field(
389
+ default=5,
390
+ description="""
391
+ The number of seconds the recent deployments scheduler will wait between checking for recently updated deployments. Defaults to `5`.
392
+ """,
393
+ )
394
+
388
395
 
389
396
  class ServerServicesPauseExpirationsSettings(ServicesBaseSetting):
390
397
  """
prefect/states.py CHANGED
@@ -776,7 +776,7 @@ def AwaitingRetry(
776
776
  """Convenience function for creating `AwaitingRetry` states.
777
777
 
778
778
  Returns:
779
- State: a AwaitingRetry state
779
+ State: an AwaitingRetry state
780
780
  """
781
781
  return Scheduled(
782
782
  cls=cls, scheduled_time=scheduled_time, name="AwaitingRetry", **kwargs
@@ -791,7 +791,7 @@ def AwaitingConcurrencySlot(
791
791
  """Convenience function for creating `AwaitingConcurrencySlot` states.
792
792
 
793
793
  Returns:
794
- State: a AwaitingConcurrencySlot state
794
+ State: an AwaitingConcurrencySlot state
795
795
  """
796
796
  return Scheduled(
797
797
  cls=cls, scheduled_time=scheduled_time, name="AwaitingConcurrencySlot", **kwargs
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: prefect-client
3
- Version: 3.3.3
3
+ Version: 3.3.4
4
4
  Summary: Workflow orchestration and management.
5
5
  Project-URL: Changelog, https://github.com/PrefectHQ/prefect/releases
6
6
  Project-URL: Documentation, https://docs.prefect.io
@@ -1,7 +1,7 @@
1
1
  prefect/.prefectignore,sha256=awSprvKT0vI8a64mEOLrMxhxqcO-b0ERQeYpA2rNKVQ,390
2
2
  prefect/__init__.py,sha256=iCdcC5ZmeewikCdnPEP6YBAjPNV5dvfxpYCTpw30Hkw,3685
3
3
  prefect/__main__.py,sha256=WFjw3kaYJY6pOTA7WDOgqjsz8zUEUZHCcj3P5wyVa-g,66
4
- prefect/_build_info.py,sha256=rkcwN5IlOT8GJmmraH2Q4ljo2fZu5atasia8KZm29DQ,180
4
+ prefect/_build_info.py,sha256=6RJC3z2YmDGQcXgBE0UBptQmhmV-mbHV7Ksok0VNyVg,180
5
5
  prefect/_result_records.py,sha256=S6QmsODkehGVSzbMm6ig022PYbI6gNKz671p_8kBYx4,7789
6
6
  prefect/_waiters.py,sha256=Ia2ITaXdHzevtyWIgJoOg95lrEXQqNEOquHvw3T33UQ,9026
7
7
  prefect/agent.py,sha256=dPvG1jDGD5HSH7aM2utwtk6RaJ9qg13XjkA0lAIgQmY,287
@@ -22,7 +22,7 @@ prefect/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  prefect/results.py,sha256=9mMOOZsj8ueqEch3oqxCaZPhF6D76Sn3P5TkqgVpbg8,36679
23
23
  prefect/schedules.py,sha256=dhq4OhImRvcmtxF7UH1m8RbwYdHT5RQsp_FrxVXfODE,7289
24
24
  prefect/serializers.py,sha256=QI0oEal_BO4HQaWSjr6ReSwT55Hn4sbSOXxGgQI1-y0,9249
25
- prefect/states.py,sha256=IOfdOJCbgz2G94VCMknX2dheP1bJ6w9rYm62SF2dGQ8,26021
25
+ prefect/states.py,sha256=rh7l1bnIYpTXdlXt5nnpz66y9KLjBWAJrN9Eo5RwgQs,26023
26
26
  prefect/task_engine.py,sha256=IIvDRl2bnnO3aKXTmtWsz0pnV8kL7xjOaUyJTlL6LaM,61491
27
27
  prefect/task_runners.py,sha256=Ce_ngocfq_X-NA5zhPj13IdVmzZ5h6gXlmfxYWs2AXA,15828
28
28
  prefect/task_runs.py,sha256=7LIzfo3fondCyEUpU05sYFN5IfpZigBDXrhG5yc-8t0,9039
@@ -133,7 +133,7 @@ prefect/concurrency/v1/context.py,sha256=BhK63TYp9BQYRCgTI1onUPXmgBoYaP7o27U695l
133
133
  prefect/concurrency/v1/services.py,sha256=ppVCllzb2qeKc-xntobFu45dEh3J-ZTtLDPuHr1djxo,2958
134
134
  prefect/concurrency/v1/sync.py,sha256=N_CHNkbV_eNQvDsJoJaehQo8H68MFlX6B1ObDZuYlTM,2112
135
135
  prefect/deployments/__init__.py,sha256=_wb7NxDKhq11z9MjYsPckmT3o6MRhGLRgCV9TmvYtew,1002
136
- prefect/deployments/base.py,sha256=KEc07W35yyzGJcV6GIZry8bKcNfvQk6JjJ99KKB6XpQ,11729
136
+ prefect/deployments/base.py,sha256=YY7g8MN6qzjNEjEA8wQXPxCrd47WnACIUeSRtI4nrEk,11849
137
137
  prefect/deployments/deployments.py,sha256=K3Rgnpjxo_T8I8LMwlq24OKqZiZBTE8-YnPg-YGUStM,171
138
138
  prefect/deployments/flow_runs.py,sha256=NYe-Bphsy6ENLqSSfywQuX5cRZt-uVgzqGmOsf3Sqw4,7643
139
139
  prefect/deployments/runner.py,sha256=QNKdKsLEzx3TE7T_3dJcK7bGvTCvNLY2WCpgDxiQDno,54368
@@ -182,10 +182,10 @@ prefect/logging/highlighters.py,sha256=BCf_LNhFInIfGPqwuu8YVrGa4wVxNc4YXo2pYgftp
182
182
  prefect/logging/loggers.py,sha256=rwFJv0i3dhdKr25XX-xUkQy4Vv4dy18bTy366jrC0OQ,12741
183
183
  prefect/logging/logging.yml,sha256=tT7gTyC4NmngFSqFkCdHaw7R0GPNPDDsTCGZQByiJAQ,3169
184
184
  prefect/runner/__init__.py,sha256=pQBd9wVrUVUDUFJlgiweKSnbahoBZwqnd2O2jkhrULY,158
185
- prefect/runner/runner.py,sha256=eT0TtLjkxzTTCrJBwpPg7m_QFkCU9VaJY75BFBZKjLY,64895
186
- prefect/runner/server.py,sha256=vyqMlUVVq6_Te1feny0G9qE8zJCYREZaF9ZstDuGvJQ,11327
185
+ prefect/runner/runner.py,sha256=D2sTbcUvFW5eiQLsQgzUO8hSTyWMvwQ7-nTg35twuIY,64962
186
+ prefect/runner/server.py,sha256=YRYFNoYddA9XfiTIYtudxrnD1vCX-PaOLhvyGUOb9AQ,11966
187
187
  prefect/runner/storage.py,sha256=L7aSjie5L6qbXYCDqYDX3ouQ_NsNMlmfjPeaWOC-ncs,28043
188
- prefect/runner/submit.py,sha256=MtUrEKi4XznXXkDasILYYhY2w_DC2RcAL2hPJUgkgNo,8815
188
+ prefect/runner/submit.py,sha256=qOEj-NChQ6RYFV35hHEVMTklrNmKwaGs2mR78ku9H0o,9474
189
189
  prefect/runner/utils.py,sha256=19DbhyiV6nvSpTXmnWlt7qPNt1jrz1jscznYrRVGurw,3413
190
190
  prefect/runtime/__init__.py,sha256=JswiTlYRup2zXOYu8AqJ7czKtgcw9Kxo0tTbS6aWCqY,407
191
191
  prefect/runtime/deployment.py,sha256=0A_cUVpYiFk3ciJw2ixy95dk9xBJcjisyF69pakSCcQ,5091
@@ -205,7 +205,7 @@ prefect/server/api/concurrency_limits.py,sha256=E5TB2cJPIZjnxnm1pGxUJnwMDz5CS58g
205
205
  prefect/server/api/concurrency_limits_v2.py,sha256=PGjG7W2Z65OojNTP0ezFu2z69plXo1N8paqwHlHAPj0,10183
206
206
  prefect/server/api/csrf_token.py,sha256=BwysSjQAhre7O0OY_LF3ZcIiO53FdMQroNT11Q6OcOM,1344
207
207
  prefect/server/api/dependencies.py,sha256=VujfcIGn41TGJxUunFHVabY5hE-6nY6uSHyhNFj8PdI,6634
208
- prefect/server/api/deployments.py,sha256=d-GAbVP3T0RVkkz6VN5nsQN7XU7fTjQg-vzYxuooxQw,37933
208
+ prefect/server/api/deployments.py,sha256=HQwgiFQXHJ0bpNFRrhW6cY0rQFua0JJfcsMnPyj1H8I,37963
209
209
  prefect/server/api/events.py,sha256=3-Qdt6ORxFv3nLoogQqvd72zEulJSoAmcqZto2OULuk,9907
210
210
  prefect/server/api/flow_run_notification_policies.py,sha256=F8xNm6bgZTC3nFe9xCUJS4NlU9tLXZ8fShtJqmhT2m4,4828
211
211
  prefect/server/api/flow_run_states.py,sha256=lIdxVE9CqLgtDCuH9bTaKkzHNL81FPrr11liPzvONrw,1661
@@ -261,10 +261,10 @@ prefect/settings/models/server/api.py,sha256=fhj9pt6RGtUHkyriaTPto4NnOwJD4XWLdIy
261
261
  prefect/settings/models/server/database.py,sha256=Ilw452gS4L1L4tk53JP-G080JblPVdWzdSVxhfuXcXQ,11156
262
262
  prefect/settings/models/server/deployments.py,sha256=LjWQr2U1mjItYhuuLqMT_QQ7P4KHqC-tKFfA-rEKefs,898
263
263
  prefect/settings/models/server/ephemeral.py,sha256=rh8Py5Nxh-gq9KgfB7CDnIgT_nuOuv59OrLGuhMIGmk,1043
264
- prefect/settings/models/server/events.py,sha256=s766htbPv2yx7w-09i8BrtAZ_js--AtHYtvXeK7puIk,5578
264
+ prefect/settings/models/server/events.py,sha256=9rdlbLz9SIg_easm1UcFTfX1seS935Xtv5d9y3r39Eo,5578
265
265
  prefect/settings/models/server/flow_run_graph.py,sha256=PuAZqqdu6fzvrbUgXZzyntUH_Ii_bP7qezgcgvW7ULk,1146
266
266
  prefect/settings/models/server/root.py,sha256=Dk_Zx4eGUy1h2cAetDKphnd6TWhDrK6DHOLJxdP7e1Y,5215
267
- prefect/settings/models/server/services.py,sha256=8CXfs4EKrJkrSUYxI1Om4uUtyYJ-WGhqjRafpAYALjQ,18610
267
+ prefect/settings/models/server/services.py,sha256=FlU12Mw_J7KG_xsX-4Xp_t1WfTqDUDeniEGseV1WaEI,18866
268
268
  prefect/settings/models/server/tasks.py,sha256=_CaOUfh3WDXvUhmHXmR-MkTRaQqocZck4efmX74iOg8,2976
269
269
  prefect/settings/models/server/ui.py,sha256=hShsi4rPBtdJA2WnT1Er0tWqu-e5wUum8NkNgucShkk,1867
270
270
  prefect/telemetry/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
@@ -316,7 +316,7 @@ prefect/workers/cloud.py,sha256=dPvG1jDGD5HSH7aM2utwtk6RaJ9qg13XjkA0lAIgQmY,287
316
316
  prefect/workers/process.py,sha256=uxOwcqA2Ps-V-W6WeSdKCQMINrCxBEVx1K1Un8pb7vs,8973
317
317
  prefect/workers/server.py,sha256=2pmVeJZiVbEK02SO6BEZaBIvHMsn6G8LzjW8BXyiTtk,1952
318
318
  prefect/workers/utilities.py,sha256=VfPfAlGtTuDj0-Kb8WlMgAuOfgXCdrGAnKMapPSBrwc,2483
319
- prefect_client-3.3.3.dist-info/METADATA,sha256=iOCVZHQAkXFFvPYp6Z-LNCAfswoTz_HQDvEfYcZ7i5E,7451
320
- prefect_client-3.3.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
321
- prefect_client-3.3.3.dist-info/licenses/LICENSE,sha256=MCxsn8osAkzfxKC4CC_dLcUkU8DZLkyihZ8mGs3Ah3Q,11357
322
- prefect_client-3.3.3.dist-info/RECORD,,
319
+ prefect_client-3.3.4.dist-info/METADATA,sha256=Zb7WtdACzoCAfciXzTJuUYKTxqRgd60APZGpyJpY1kA,7451
320
+ prefect_client-3.3.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
321
+ prefect_client-3.3.4.dist-info/licenses/LICENSE,sha256=MCxsn8osAkzfxKC4CC_dLcUkU8DZLkyihZ8mGs3Ah3Q,11357
322
+ prefect_client-3.3.4.dist-info/RECORD,,