prefect-client 3.2.8__py3-none-any.whl → 3.2.9__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.2.8"
3
- __build_date__ = "2025-02-28 00:11:08.300212+00:00"
4
- __git_commit__ = "2c0860d5dcd6156fc3fae75d53f7f48f4bd1a522"
2
+ __version__ = "3.2.9"
3
+ __build_date__ = "2025-02-28 20:11:13.828993+00:00"
4
+ __git_commit__ = "27eb408c48e16b1f16718b884ce7753d5b32ae35"
5
5
  __dirty__ = False
@@ -11,7 +11,6 @@ import sys
11
11
  from typing import Any, TypedDict
12
12
 
13
13
  import cloudpickle
14
- import uv
15
14
 
16
15
  from prefect.client.schemas.objects import FlowRun
17
16
  from prefect.context import SettingsContext, get_settings_context, serialize_context
@@ -22,6 +21,13 @@ from prefect.settings.context import get_current_settings
22
21
  from prefect.settings.models.root import Settings
23
22
  from prefect.utilities.slugify import slugify
24
23
 
24
+ try:
25
+ import uv
26
+
27
+ uv_path = uv.find_uv_bin()
28
+ except (ImportError, ModuleNotFoundError):
29
+ uv_path = "uv"
30
+
25
31
 
26
32
  class SerializedBundle(TypedDict):
27
33
  """
@@ -73,7 +79,7 @@ def create_bundle_for_flow_run(
73
79
  "flow_run": flow_run.model_dump(mode="json"),
74
80
  "dependencies": subprocess.check_output(
75
81
  [
76
- uv.find_uv_bin(),
82
+ uv_path,
77
83
  "pip",
78
84
  "freeze",
79
85
  # Exclude editable installs because we won't be able to install them in the execution environment
@@ -148,7 +154,7 @@ def execute_bundle_in_subprocess(
148
154
  # Install dependencies if necessary
149
155
  if dependencies := bundle.get("dependencies"):
150
156
  subprocess.check_call(
151
- [uv.find_uv_bin(), "pip", "install", *dependencies.split("\n")],
157
+ [uv_path, "pip", "install", *dependencies.split("\n")],
152
158
  # Copy the current environment to ensure we install into the correct venv
153
159
  env=os.environ,
154
160
  )
prefect/runner/runner.py CHANGED
@@ -114,6 +114,7 @@ from prefect.states import (
114
114
  )
115
115
  from prefect.types._datetime import DateTime
116
116
  from prefect.types.entrypoint import EntrypointType
117
+ from prefect.utilities.annotations import NotSet
117
118
  from prefect.utilities.asyncutils import (
118
119
  asyncnullcontext,
119
120
  is_async_fn,
@@ -153,7 +154,7 @@ class Runner:
153
154
  query_seconds: Optional[float] = None,
154
155
  prefetch_seconds: float = 10,
155
156
  heartbeat_seconds: Optional[float] = None,
156
- limit: Optional[int] = None,
157
+ limit: int | type[NotSet] | None = NotSet,
157
158
  pause_on_shutdown: bool = True,
158
159
  webserver: bool = False,
159
160
  ):
@@ -169,7 +170,8 @@ class Runner:
169
170
  heartbeat_seconds: The number of seconds to wait between emitting
170
171
  flow run heartbeats. The runner will not emit heartbeats if the value is None.
171
172
  Defaults to `PREFECT_RUNNER_HEARTBEAT_FREQUENCY`.
172
- limit: The maximum number of flow runs this runner should be running at
173
+ limit: The maximum number of flow runs this runner should be running at. Provide `None` for no limit.
174
+ If not provided, the runner will use the value of `PREFECT_RUNNER_PROCESS_LIMIT`.
173
175
  pause_on_shutdown: A boolean for whether or not to automatically pause
174
176
  deployment schedules on shutdown; defaults to `True`
175
177
  webserver: a boolean flag for whether to start a webserver for this runner
@@ -210,7 +212,11 @@ class Runner:
210
212
  self.started: bool = False
211
213
  self.stopping: bool = False
212
214
  self.pause_on_shutdown: bool = pause_on_shutdown
213
- self.limit: int | None = limit or settings.runner.process_limit
215
+ self.limit: int | None = (
216
+ settings.runner.process_limit
217
+ if limit is NotSet or isinstance(limit, type)
218
+ else limit
219
+ )
214
220
  self.webserver: bool = webserver
215
221
 
216
222
  self.query_seconds: float = query_seconds or settings.runner.poll_frequency
@@ -1280,8 +1286,8 @@ class Runner:
1280
1286
  assert self._limiter is not None
1281
1287
  self._logger.info(
1282
1288
  f"Flow run limit reached; {self._limiter.borrowed_tokens} flow runs"
1283
- " in progress. You can control this limit by passing a `limit` value"
1284
- " to `serve` or adjusting the PREFECT_RUNNER_PROCESS_LIMIT setting."
1289
+ " in progress. You can control this limit by adjusting the "
1290
+ "PREFECT_RUNNER_PROCESS_LIMIT setting."
1285
1291
  )
1286
1292
  return False
1287
1293
 
@@ -222,7 +222,7 @@ class ProcessWorker(
222
222
  async def __aenter__(self) -> ProcessWorker:
223
223
  await super().__aenter__()
224
224
  self._runner = await self._exit_stack.enter_async_context(
225
- Runner(pause_on_shutdown=False)
225
+ Runner(pause_on_shutdown=False, limit=None)
226
226
  )
227
227
  return self
228
228
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: prefect-client
3
- Version: 3.2.8
3
+ Version: 3.2.9
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=xmDfVj6oyNn39V5dUMzOXraIYaSVi10dtszKjtYfoLY,180
4
+ prefect/_build_info.py,sha256=YVNMCSqdfJZSZWqetAM6lnrtSoA_cqDrXyw6RGNF-3s,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
@@ -31,7 +31,7 @@ prefect/tasks.py,sha256=g__kIAXvbvdY7NtK7R-KbJg7qUP31xjf5uK80zRS3Ds,74049
31
31
  prefect/transactions.py,sha256=kOXwghBW3jM71gg49MkjJPTnImEzXWeTCUE_zpq2MlI,16068
32
32
  prefect/variables.py,sha256=dCK3vX7TbkqXZhnNT_v7rcGh3ISRqoR6pJVLpoll3Js,8342
33
33
  prefect/_experimental/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
- prefect/_experimental/bundles.py,sha256=qVxA4rkE35wdZeitBOsECa4JBvWFF9oamCRgGchJIdc,6159
34
+ prefect/_experimental/bundles.py,sha256=cxfUFdvBjd42imrimPG2MF3zJoyi1vGeYOVSiyjLC8Y,6245
35
35
  prefect/_experimental/lineage.py,sha256=8LssReoq7eLtQScUCu-7FCtrWoRZstXKRdpO0PxgbKg,9958
36
36
  prefect/_experimental/sla/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
37
  prefect/_experimental/sla/client.py,sha256=XTkYHFZiBy_O7RgUyGEdl9MxaHP-6fEAKBk3ksNQobU,3611
@@ -184,7 +184,7 @@ prefect/logging/highlighters.py,sha256=BCf_LNhFInIfGPqwuu8YVrGa4wVxNc4YXo2pYgftp
184
184
  prefect/logging/loggers.py,sha256=xkmHXsiuoPZZXcrrEgMA-ZQu0E-gW3tNVd4BIxWjnpM,12704
185
185
  prefect/logging/logging.yml,sha256=tT7gTyC4NmngFSqFkCdHaw7R0GPNPDDsTCGZQByiJAQ,3169
186
186
  prefect/runner/__init__.py,sha256=7U-vAOXFkzMfRz1q8Uv6Otsvc0OrPYLLP44srwkJ_8s,89
187
- prefect/runner/runner.py,sha256=fT2_jXIabxcx0iZmT0q5WmMr46GnN_LZp10hfdB4l3I,63552
187
+ prefect/runner/runner.py,sha256=_jGRxJlq8A-bqLdyYonRuTLHzDOKZ-ZMaOLV6vcTByE,63801
188
188
  prefect/runner/server.py,sha256=WDDjCbnd2F_3LZBpVX2Y398xpmHvxjyBLKVHWkh5QxI,11240
189
189
  prefect/runner/storage.py,sha256=Uxx_7SPm-F0LR1LUq64cT-xHL2ofd37hHqLHtRYjGW0,27527
190
190
  prefect/runner/submit.py,sha256=3Ey6H4XrhYhCII4AobpvzZf21vAunWlMu40zAjMC0gc,8353
@@ -315,10 +315,10 @@ prefect/workers/__init__.py,sha256=EaM1F0RZ-XIJaGeTKLsXDnfOPHzVWk5bk0_c4BVS44M,6
315
315
  prefect/workers/base.py,sha256=1lPZRj2hBDP1-lS2oqdfUXg0iZJ4Y1qw5C6THDG9iB0,49842
316
316
  prefect/workers/block.py,sha256=dPvG1jDGD5HSH7aM2utwtk6RaJ9qg13XjkA0lAIgQmY,287
317
317
  prefect/workers/cloud.py,sha256=dPvG1jDGD5HSH7aM2utwtk6RaJ9qg13XjkA0lAIgQmY,287
318
- prefect/workers/process.py,sha256=hv1WssMDDznpq3zpTwo6SA3UhzXXKrfIYL4jq1Beark,8490
318
+ prefect/workers/process.py,sha256=p3BJ3YQoiffqIeKXTPocD9dTFniMj24QnlFPiDM41So,8502
319
319
  prefect/workers/server.py,sha256=SEuyScZ5nGm2OotdtbHjpvqJlTRVWCh29ND7FeL_fZA,1974
320
320
  prefect/workers/utilities.py,sha256=VfPfAlGtTuDj0-Kb8WlMgAuOfgXCdrGAnKMapPSBrwc,2483
321
- prefect_client-3.2.8.dist-info/METADATA,sha256=q5Zs-swuflfHYhLYk6sTTD9tSgAPcMBniLAFSCrKeV8,7192
322
- prefect_client-3.2.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
323
- prefect_client-3.2.8.dist-info/licenses/LICENSE,sha256=MCxsn8osAkzfxKC4CC_dLcUkU8DZLkyihZ8mGs3Ah3Q,11357
324
- prefect_client-3.2.8.dist-info/RECORD,,
321
+ prefect_client-3.2.9.dist-info/METADATA,sha256=cmjLtGd6PRjFL-54S8bfSaDotSAqrn2tB3DPpgk5Bho,7192
322
+ prefect_client-3.2.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
323
+ prefect_client-3.2.9.dist-info/licenses/LICENSE,sha256=MCxsn8osAkzfxKC4CC_dLcUkU8DZLkyihZ8mGs3Ah3Q,11357
324
+ prefect_client-3.2.9.dist-info/RECORD,,