prefect-client 2.20.13__py3-none-any.whl → 2.20.15__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/flows.py CHANGED
@@ -10,6 +10,7 @@ import datetime
10
10
  import importlib.util
11
11
  import inspect
12
12
  import os
13
+ import sys
13
14
  import tempfile
14
15
  import warnings
15
16
  from functools import partial, update_wrapper
@@ -137,6 +138,16 @@ logger = get_logger("flows")
137
138
  if TYPE_CHECKING:
138
139
  from prefect.deployments.runner import FlexibleScheduleList, RunnerDeployment
139
140
 
141
+ # Handle Python 3.8 compatibility for GenericAlias
142
+ if sys.version_info >= (3, 9):
143
+ from types import GenericAlias # novermin
144
+
145
+ GENERIC_ALIAS = (GenericAlias,)
146
+ else:
147
+ from typing import _GenericAlias
148
+
149
+ GENERIC_ALIAS = (_GenericAlias,)
150
+
140
151
 
141
152
  @PrefectObjectRegistry.register_instances
142
153
  class Flow(Generic[P, R]):
@@ -530,18 +541,22 @@ class Flow(Generic[P, R]):
530
541
  is_v1_type(param.annotation) for param in sig.parameters.values()
531
542
  )
532
543
  has_v1_models = any(
533
- issubclass(param.annotation, V1BaseModel)
534
- if isinstance(param.annotation, type)
535
- else False
544
+ (
545
+ isinstance(param.annotation, type)
546
+ and not isinstance(param.annotation, GENERIC_ALIAS)
547
+ and issubclass(param.annotation, V1BaseModel)
548
+ )
536
549
  for param in sig.parameters.values()
537
550
  )
538
551
  has_v2_types = any(
539
552
  is_v2_type(param.annotation) for param in sig.parameters.values()
540
553
  )
541
554
  has_v2_models = any(
542
- issubclass(param.annotation, V2BaseModel)
543
- if isinstance(param.annotation, type)
544
- else False
555
+ (
556
+ isinstance(param.annotation, type)
557
+ and not isinstance(param.annotation, GENERIC_ALIAS)
558
+ and issubclass(param.annotation, V2BaseModel)
559
+ )
545
560
  for param in sig.parameters.values()
546
561
  )
547
562
 
@@ -1601,7 +1616,9 @@ flow.from_source = Flow.from_source
1601
1616
 
1602
1617
 
1603
1618
  def select_flow(
1604
- flows: Iterable[Flow], flow_name: str = None, from_message: str = None
1619
+ flows: Iterable[Flow],
1620
+ flow_name: Optional[str] = None,
1621
+ from_message: Optional[str] = None,
1605
1622
  ) -> Flow:
1606
1623
  """
1607
1624
  Select the only flow in an iterable or a flow specified by name.
prefect/workers/base.py CHANGED
@@ -132,7 +132,7 @@ class BaseJobConfiguration(BaseModel):
132
132
  Important: this method expects that the base_job_template was already
133
133
  validated server-side.
134
134
  """
135
- job_config: Dict[str, Any] = base_job_template["job_configuration"]
135
+ base_config: Dict[str, Any] = base_job_template["job_configuration"]
136
136
  variables_schema = base_job_template["variables"]
137
137
  variables = cls._get_base_config_defaults(
138
138
  variables_schema.get("properties", {})
@@ -141,17 +141,17 @@ class BaseJobConfiguration(BaseModel):
141
141
  # copy variable defaults for `env` to job config before they're replaced by
142
142
  # deployment overrides
143
143
  if variables.get("env"):
144
- job_config["env"] = variables.get("env")
144
+ base_config["env"] = variables.get("env")
145
145
 
146
146
  variables.update(values)
147
147
 
148
148
  # deep merge `env`
149
- if isinstance(job_config.get("env"), dict) and (
150
- hardcoded_env := variables.get("env")
149
+ if isinstance(base_config.get("env"), dict) and (
150
+ deployment_env := variables.get("env")
151
151
  ):
152
- job_config["env"] = {**hardcoded_env, **job_config.get("env", {})}
152
+ base_config["env"] = {**base_config.get("env", {}), **deployment_env}
153
153
 
154
- populated_configuration = apply_values(template=job_config, values=variables)
154
+ populated_configuration = apply_values(template=base_config, values=variables)
155
155
  populated_configuration = await resolve_block_document_references(
156
156
  template=populated_configuration, client=client
157
157
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: prefect-client
3
- Version: 2.20.13
3
+ Version: 2.20.15
4
4
  Summary: Workflow orchestration and management.
5
5
  Home-page: https://www.prefect.io
6
6
  Author: Prefect Technologies, Inc.
@@ -34,15 +34,18 @@ Requires-Dist: graphviz>=0.20.1
34
34
  Requires-Dist: griffe<2.0.0,>=0.49.0
35
35
  Requires-Dist: httpcore<2.0.0,>=1.0.5
36
36
  Requires-Dist: httpx[http2]!=0.23.2,>=0.23
37
+ Requires-Dist: importlib_metadata>=4.4; python_version < "3.10"
37
38
  Requires-Dist: importlib-resources<6.5.0,>=6.1.3
38
39
  Requires-Dist: jsonpatch<2.0,>=1.32
39
40
  Requires-Dist: jsonschema<5.0.0,>=4.0.0
40
41
  Requires-Dist: orjson<4.0,>=3.7
41
42
  Requires-Dist: packaging<24.3,>=21.3
42
43
  Requires-Dist: pathspec>=0.8.0
44
+ Requires-Dist: pendulum<3.0; python_version < "3.12"
45
+ Requires-Dist: pendulum<4,>=3.0.0; python_version >= "3.12"
43
46
  Requires-Dist: pydantic[email]!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0,>=1.10.0
44
- Requires-Dist: pydantic-core<3.0.0,>=2.12.0
45
- Requires-Dist: python-dateutil<3.0.0,>=2.8.2
47
+ Requires-Dist: pydantic_core<3.0.0,>=2.12.0
48
+ Requires-Dist: python_dateutil<3.0.0,>=2.8.2
46
49
  Requires-Dist: python-slugify<9.0,>=5.0
47
50
  Requires-Dist: pyyaml<7.0.0,>=5.4.1
48
51
  Requires-Dist: rfc3339-validator<0.2.0,>=0.1.4
@@ -50,15 +53,12 @@ Requires-Dist: rich<14.0,>=11.0
50
53
  Requires-Dist: ruamel.yaml>=0.17.0
51
54
  Requires-Dist: sniffio<2.0.0,>=1.3.0
52
55
  Requires-Dist: toml>=0.10.0
53
- Requires-Dist: typing-extensions<5.0.0,>=4.5.0
56
+ Requires-Dist: typing_extensions<5.0.0,>=4.5.0
54
57
  Requires-Dist: ujson<6.0.0,>=5.8.0
55
58
  Requires-Dist: uvicorn!=0.29.0,>=0.14.0
56
59
  Requires-Dist: websockets<14.0,>=10.4
57
60
  Requires-Dist: itsdangerous
58
61
  Requires-Dist: python-multipart>=0.0.7
59
- Requires-Dist: importlib-metadata>=4.4; python_version < "3.10"
60
- Requires-Dist: pendulum<3.0; python_version < "3.12"
61
- Requires-Dist: pendulum<4,>=3.0.0; python_version >= "3.12"
62
62
  Provides-Extra: notifications
63
63
  Requires-Dist: apprise<2.0.0,>=1.1.0; extra == "notifications"
64
64
 
@@ -9,7 +9,7 @@ prefect/engine.py,sha256=i68gM-ZZ2x9D4aIwaLmApWeHqpMb2U2QWNJjX3aPmZM,92887
9
9
  prefect/exceptions.py,sha256=ElqC81_w6XbTaxLYANLMIPK8Fz46NmJZCRKL4NZ-JIg,10907
10
10
  prefect/filesystems.py,sha256=XniPSdBAqywj43X7GyfuWJQIbz07QJ5Y3cVNLhIF3lQ,35260
11
11
  prefect/flow_runs.py,sha256=mFHLavZk1yZ62H3UazuNDBZWAF7AqKttA4rMcHgsVSw,3119
12
- prefect/flows.py,sha256=rJ2lfAFy3yff6ecKwFx9sDrjhOhdSGKQo7ocx7BasAs,85988
12
+ prefect/flows.py,sha256=M5aP6QVpnFfIHFFcNOwBST1XcDY-vVFVBuI3DcvNPEY,86456
13
13
  prefect/futures.py,sha256=RaWfYIXtH7RsWxQ5QWTTlAzwtVV8XWpXaZT_hLq35vQ,12590
14
14
  prefect/manifests.py,sha256=sTM7j8Us5d49zaydYKWsKb7zJ96v1ChkLkLeR0GFYD8,683
15
15
  prefect/new_flow_engine.py,sha256=A1adTWTBAwPCn6ay003Jsoc2SdYgHV4AcJo1bmpa_7Y,16039
@@ -284,13 +284,13 @@ prefect/utilities/schema_tools/__init__.py,sha256=KsFsTEHQqgp89TkDpjggkgBBywoHQP
284
284
  prefect/utilities/schema_tools/hydration.py,sha256=RNuJK4Vd__V69gdQbaWSVhSkV0AUISfGzH_xd0p6Zh0,8291
285
285
  prefect/utilities/schema_tools/validation.py,sha256=zZHL_UFxAlgaUzi-qsEOrhWtZ7EkFQvPkX_YN1EJNTo,8414
286
286
  prefect/workers/__init__.py,sha256=6el2Q856CuRPa5Hdrbm9QyAWB_ovcT2bImSFsoWI46k,66
287
- prefect/workers/base.py,sha256=r0kM2EbT69yQsd3L7Lq99IqaBHhZgc6tcpdh3YekSJY,45779
287
+ prefect/workers/base.py,sha256=FZEbho1OHQ5WdFJEIxnxLCyIHR_f__uIHKZTE3XcHIk,45787
288
288
  prefect/workers/block.py,sha256=aYY__uq3v1eq1kkbVukxyhQNbkknaKYo6-_3tcrfKKA,8067
289
289
  prefect/workers/process.py,sha256=pPtCdA7fKQ4OsvoitT-cayZeh5HgLX4xBUYlb2Zad-Q,9475
290
290
  prefect/workers/server.py,sha256=WVZJxR8nTMzK0ov0BD0xw5OyQpT26AxlXbsGQ1OrxeQ,1551
291
291
  prefect/workers/utilities.py,sha256=VfPfAlGtTuDj0-Kb8WlMgAuOfgXCdrGAnKMapPSBrwc,2483
292
- prefect_client-2.20.13.dist-info/LICENSE,sha256=MCxsn8osAkzfxKC4CC_dLcUkU8DZLkyihZ8mGs3Ah3Q,11357
293
- prefect_client-2.20.13.dist-info/METADATA,sha256=vloZfmccHOZcZ4n8U_rzC4Y2ynSEulVBjINBy30o87E,7392
294
- prefect_client-2.20.13.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
295
- prefect_client-2.20.13.dist-info/top_level.txt,sha256=MJZYJgFdbRc2woQCeB4vM6T33tr01TmkEhRcns6H_H4,8
296
- prefect_client-2.20.13.dist-info/RECORD,,
292
+ prefect_client-2.20.15.dist-info/LICENSE,sha256=MCxsn8osAkzfxKC4CC_dLcUkU8DZLkyihZ8mGs3Ah3Q,11357
293
+ prefect_client-2.20.15.dist-info/METADATA,sha256=U4V3ao8oXEhOp4W4sOo8omIQqiKoXGESn5b2vbQu9Tc,7392
294
+ prefect_client-2.20.15.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
295
+ prefect_client-2.20.15.dist-info/top_level.txt,sha256=MJZYJgFdbRc2woQCeB4vM6T33tr01TmkEhRcns6H_H4,8
296
+ prefect_client-2.20.15.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.5.0)
2
+ Generator: setuptools (75.6.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5