metaflow 2.12.17__py2.py3-none-any.whl → 2.12.19__py2.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.
@@ -98,7 +98,7 @@ class MetaflowEnvironment(object):
98
98
  # Boto3 does not play well with passing None or an empty string to endpoint_url
99
99
  return "{python} -c '{script}'".format(
100
100
  python=self._python(),
101
- script='import boto3, os; ep=os.getenv(\\"METAFLOW_S3_ENDPOINT_URL\\"); boto3.client(\\"s3\\", **({endpoint_url:ep} if ep else {})).download_file(\\"%s\\", \\"%s\\", \\"job.tar\\")'
101
+ script='import boto3, os; ep=os.getenv(\\"METAFLOW_S3_ENDPOINT_URL\\"); boto3.client(\\"s3\\", **({\\"endpoint_url\\":ep} if ep else {})).download_file(\\"%s\\", \\"%s\\", \\"job.tar\\")'
102
102
  % (bucket, s3_object),
103
103
  )
104
104
  elif datastore_type == "azure":
@@ -698,7 +698,7 @@ class Kubernetes(object):
698
698
  t = time.time()
699
699
  time.sleep(update_delay(time.time() - start_time))
700
700
 
701
- _make_prefix = lambda: b"[%s] " % util.to_bytes(self._job.id)
701
+ prefix = lambda: b"[%s] " % util.to_bytes(self._job.id)
702
702
 
703
703
  stdout_tail = get_log_tailer(stdout_location, self._datastore.TYPE)
704
704
  stderr_tail = get_log_tailer(stderr_location, self._datastore.TYPE)
@@ -708,7 +708,7 @@ class Kubernetes(object):
708
708
 
709
709
  # 2) Tail logs until the job has finished
710
710
  tail_logs(
711
- prefix=_make_prefix(),
711
+ prefix=prefix(),
712
712
  stdout_tail=stdout_tail,
713
713
  stderr_tail=stderr_tail,
714
714
  echo=echo,
@@ -571,10 +571,8 @@ class JobSetSpec(object):
571
571
  namespace=self._kwargs["namespace"],
572
572
  ),
573
573
  spec=client.V1PodSpec(
574
- ## --- jobset require podspec deets start----
575
574
  subdomain=self._kwargs["subdomain"],
576
575
  set_hostname_as_fqdn=True,
577
- ## --- jobset require podspec deets end ----
578
576
  # Timeout is set on the pod and not the job (important!)
579
577
  active_deadline_seconds=self._kwargs[
580
578
  "timeout_in_seconds"
@@ -50,6 +50,9 @@ class CondaStepDecorator(StepDecorator):
50
50
  # conda channels, users can specify channel::package as the package name.
51
51
 
52
52
  def __init__(self, attributes=None, statically_defined=False):
53
+ self._user_defined_attributes = (
54
+ attributes.copy() if attributes is not None else {}
55
+ )
53
56
  super(CondaStepDecorator, self).__init__(attributes, statically_defined)
54
57
 
55
58
  # Support legacy 'libraries=' attribute for the decorator.
@@ -59,6 +62,9 @@ class CondaStepDecorator(StepDecorator):
59
62
  }
60
63
  del self.attributes["libraries"]
61
64
 
65
+ def is_attribute_user_defined(self, name):
66
+ return name in self._user_defined_attributes
67
+
62
68
  def step_init(self, flow, graph, step, decos, environment, flow_datastore, logger):
63
69
  # The init_environment hook for Environment creates the relevant virtual
64
70
  # environments. The step_init hook sets up the relevant state for that hook to
@@ -71,11 +77,16 @@ class CondaStepDecorator(StepDecorator):
71
77
 
72
78
  # Support flow-level decorator.
73
79
  if "conda_base" in self.flow._flow_decorators:
74
- super_attributes = self.flow._flow_decorators["conda_base"][0].attributes
80
+ conda_base = self.flow._flow_decorators["conda_base"][0]
81
+ super_attributes = conda_base.attributes
75
82
  self.attributes["packages"] = {
76
83
  **super_attributes["packages"],
77
84
  **self.attributes["packages"],
78
85
  }
86
+ self._user_defined_attributes = {
87
+ **self._user_defined_attributes,
88
+ **conda_base._user_defined_attributes,
89
+ }
79
90
  self.attributes["python"] = (
80
91
  self.attributes["python"] or super_attributes["python"]
81
92
  )
@@ -322,6 +333,9 @@ class CondaFlowDecorator(FlowDecorator):
322
333
  }
323
334
 
324
335
  def __init__(self, attributes=None, statically_defined=False):
336
+ self._user_defined_attributes = (
337
+ attributes.copy() if attributes is not None else {}
338
+ )
325
339
  super(CondaFlowDecorator, self).__init__(attributes, statically_defined)
326
340
 
327
341
  # Support legacy 'libraries=' attribute for the decorator.
@@ -333,6 +347,9 @@ class CondaFlowDecorator(FlowDecorator):
333
347
  if self.attributes["python"]:
334
348
  self.attributes["python"] = str(self.attributes["python"])
335
349
 
350
+ def is_attribute_user_defined(self, name):
351
+ return name in self._user_defined_attributes
352
+
336
353
  def flow_init(
337
354
  self, flow, graph, environment, flow_datastore, metadata, logger, echo, options
338
355
  ):
@@ -185,7 +185,10 @@ class CondaEnvironment(MetaflowEnvironment):
185
185
  self.logger("Virtual environment(s) bootstrapped!")
186
186
 
187
187
  def executable(self, step_name, default=None):
188
- step = next(step for step in self.flow if step.name == step_name)
188
+ step = next((step for step in self.flow if step.name == step_name), None)
189
+ if step is None:
190
+ # requesting internal steps e.g. _parameters
191
+ return super().executable(step_name, default)
189
192
  id_ = self.get_environment(step).get("id_")
190
193
  if id_:
191
194
  # bootstrap.py is responsible for ensuring the validity of this executable.
@@ -40,7 +40,12 @@ class PyPIStepDecorator(StepDecorator):
40
40
 
41
41
  # Support flow-level decorator
42
42
  if "pypi_base" in self.flow._flow_decorators:
43
- super_attributes = self.flow._flow_decorators["pypi_base"][0].attributes
43
+ pypi_base = self.flow._flow_decorators["pypi_base"][0]
44
+ super_attributes = pypi_base.attributes
45
+ self._user_defined_attributes = {
46
+ **self._user_defined_attributes,
47
+ **pypi_base._user_defined_attributes,
48
+ }
44
49
  self.attributes["packages"] = {
45
50
  **super_attributes["packages"],
46
51
  **self.attributes["packages"],
@@ -93,6 +98,12 @@ class PyPIStepDecorator(StepDecorator):
93
98
  ),
94
99
  )
95
100
  )
101
+ # TODO: This code snippet can be done away with by altering the constructor of
102
+ # MetaflowEnvironment. A good first-task exercise.
103
+ # Avoid circular import
104
+ from metaflow.plugins.datastores.local_storage import LocalStorage
105
+
106
+ environment.set_local_root(LocalStorage.get_datastore_root_from_config(logger))
96
107
 
97
108
  def is_attribute_user_defined(self, name):
98
109
  return name in self._user_defined_attributes
@@ -117,6 +128,12 @@ class PyPIFlowDecorator(FlowDecorator):
117
128
  name = "pypi_base"
118
129
  defaults = {"packages": {}, "python": None, "disabled": None}
119
130
 
131
+ def __init__(self, attributes=None, statically_defined=False):
132
+ self._user_defined_attributes = (
133
+ attributes.copy() if attributes is not None else {}
134
+ )
135
+ super().__init__(attributes, statically_defined)
136
+
120
137
  def flow_init(
121
138
  self, flow, graph, environment, flow_datastore, metadata, logger, echo, options
122
139
  ):
metaflow/version.py CHANGED
@@ -1 +1 @@
1
- metaflow_version = "2.12.17"
1
+ metaflow_version = "2.12.19"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: metaflow
3
- Version: 2.12.17
3
+ Version: 2.12.19
4
4
  Summary: Metaflow: More Data Science, Less Engineering
5
5
  Author: Metaflow Developers
6
6
  Author-email: help@metaflow.org
@@ -26,7 +26,7 @@ License-File: LICENSE
26
26
  Requires-Dist: requests
27
27
  Requires-Dist: boto3
28
28
  Provides-Extra: stubs
29
- Requires-Dist: metaflow-stubs==2.12.17; extra == "stubs"
29
+ Requires-Dist: metaflow-stubs==2.12.19; extra == "stubs"
30
30
 
31
31
  ![Metaflow_Logo_Horizontal_FullColor_Ribbon_Dark_RGB](https://user-images.githubusercontent.com/763451/89453116-96a57e00-d713-11ea-9fa6-82b29d4d6eff.png)
32
32
 
@@ -18,7 +18,7 @@ metaflow/lint.py,sha256=5rj1MlpluxyPTSINjtMoJ7viotyNzfjtBJSAihlAwMU,10870
18
18
  metaflow/metaflow_config.py,sha256=4PUd2-JWJs35SaobDgMg4RdpZaKjhEqPUFh2f0pjqnU,22853
19
19
  metaflow/metaflow_config_funcs.py,sha256=5GlvoafV6SxykwfL8D12WXSfwjBN_NsyuKE_Q3gjGVE,6738
20
20
  metaflow/metaflow_current.py,sha256=5Kri7fzj-rtIJVr5xh5kPKwZ0T73_4egZybzlDR-fgc,7136
21
- metaflow/metaflow_environment.py,sha256=bZxySBGuriqLjZSt0VvuLSuE3sMAyrD7wXwdyUdXO9g,8109
21
+ metaflow/metaflow_environment.py,sha256=D7zHYqe8aLZVwJ20nx19vmsNW29Kf3PVE8hbBjVQin8,8115
22
22
  metaflow/metaflow_profile.py,sha256=jKPEW-hmAQO-htSxb9hXaeloLacAh41A35rMZH6G8pA,418
23
23
  metaflow/metaflow_version.py,sha256=mPQ6g_3XjNdi0NrxDzwlW8ZH0nMyYpwqmJ04P7TIdP0,4774
24
24
  metaflow/monitor.py,sha256=T0NMaBPvXynlJAO_avKtk8OIIRMyEuMAyF8bIp79aZU,5323
@@ -35,7 +35,7 @@ metaflow/tuple_util.py,sha256=_G5YIEhuugwJ_f6rrZoelMFak3DqAR2tt_5CapS1XTY,830
35
35
  metaflow/unbounded_foreach.py,sha256=p184WMbrMJ3xKYHwewj27ZhRUsSj_kw1jlye5gA9xJk,387
36
36
  metaflow/util.py,sha256=olAvJK3y1it_k99MhLulTaAJo7OFVt5rnrD-ulIFLCU,13616
37
37
  metaflow/vendor.py,sha256=FchtA9tH22JM-eEtJ2c9FpUdMn8sSb1VHuQS56EcdZk,5139
38
- metaflow/version.py,sha256=aRhCRpO5-SPvEInmdUUPKUQmAJLs0l3XtE3GQEGP7Rs,29
38
+ metaflow/version.py,sha256=fKkvZn7TUtrxHS2I73qyoYIKvp6Psia2Jcc91r3fjck,29
39
39
  metaflow/_vendor/__init__.py,sha256=y_CiwUD3l4eAKvTVDZeqgVujMy31cAM1qjAB-HfI-9s,353
40
40
  metaflow/_vendor/typing_extensions.py,sha256=0nUs5p1A_UrZigrAVBoOEM6TxU37zzPDUtiij1ZwpNc,110417
41
41
  metaflow/_vendor/zipp.py,sha256=ajztOH-9I7KA_4wqDYygtHa6xUBVZgFpmZ8FE74HHHI,8425
@@ -279,22 +279,22 @@ metaflow/plugins/gcp/gs_tail.py,sha256=Jl_wvnzU7dub07A-DOAuP5FeccNIrPM-CeL1xKFs1
279
279
  metaflow/plugins/gcp/gs_utils.py,sha256=ZmIGFse1qYyvAVrwga23PQUzF6dXEDLLsZ2F-YRmvow,2030
280
280
  metaflow/plugins/gcp/includefile_support.py,sha256=vIDeR-MiJuUh-2S2pV7Z7FBkhIWwtHXaRrj76MWGRiY,3869
281
281
  metaflow/plugins/kubernetes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
282
- metaflow/plugins/kubernetes/kubernetes.py,sha256=cr3TheUasxIBEwFZ3GEVbctaf8gW57BM5BDk80ikjPI,31063
282
+ metaflow/plugins/kubernetes/kubernetes.py,sha256=sP5BDnjv-5cLm8i7E5YiJygWN4yNRQHt-hhOmysKm1k,31051
283
283
  metaflow/plugins/kubernetes/kubernetes_cli.py,sha256=qBDdr1Lvtt-RO9pB-9_HTOPdzAmDvvJ0aiQ1OoCcrMU,10892
284
284
  metaflow/plugins/kubernetes/kubernetes_client.py,sha256=GKg-gT3qhXMRQV-sG1YyoOf3Z32NXr_wwEN2ytMVSEg,2471
285
285
  metaflow/plugins/kubernetes/kubernetes_decorator.py,sha256=CXStYHomuJJK_Yocpdo6OJadEQv5hDfSpO7GPL61ltw,25322
286
286
  metaflow/plugins/kubernetes/kubernetes_job.py,sha256=Cfkee8LbXC17jSXWoeNdomQRvF_8YSeXNg1gvxm6E_M,31806
287
- metaflow/plugins/kubernetes/kubernetes_jobsets.py,sha256=OBmLtX-ZUDQdCCfftUmRMernfmTNMwdTxPoCAp_NmwE,40957
287
+ metaflow/plugins/kubernetes/kubernetes_jobsets.py,sha256=sCVuy-PRN60s5HWpnRvFmnljS41k70sBoPO3nOtl2ZE,40800
288
288
  metaflow/plugins/metadata/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
289
289
  metaflow/plugins/metadata/local.py,sha256=YhLJC5zjVJrvQFIyQ92ZBByiUmhCC762RUX7ITX12O8,22428
290
290
  metaflow/plugins/metadata/service.py,sha256=ihq5F7KQZlxvYwzH_-jyP2aWN_I96i2vp92j_d697s8,20204
291
291
  metaflow/plugins/pypi/__init__.py,sha256=0YFZpXvX7HCkyBFglatual7XGifdA1RwC3U4kcizyak,1037
292
292
  metaflow/plugins/pypi/bootstrap.py,sha256=Tvc4_QKIx-A8j5Aq8ccWZrrxNM8csN40rK8HmxDx-Z8,5106
293
- metaflow/plugins/pypi/conda_decorator.py,sha256=fTJVbEfgOUtsDXIfnfsNk46sKeA9uTuTqGey9OFs9Ig,14738
294
- metaflow/plugins/pypi/conda_environment.py,sha256=erVvMgQhg6oBv4l6Yca72FKKoB0QEcitpTserPSPc44,19328
293
+ metaflow/plugins/pypi/conda_decorator.py,sha256=D5B6xnBc2KUNPhaD0J062CGM1Jzo6D2bxhSU87KrmCM,15372
294
+ metaflow/plugins/pypi/conda_environment.py,sha256=--q-8lypKupCdGsASpqABNpNqRxtQi6UCDgq8iHDFe4,19476
295
295
  metaflow/plugins/pypi/micromamba.py,sha256=67FiIZZz0Kig9EcN7bZLObsE6Z1MFyo4Dp93fd3Grcc,12178
296
296
  metaflow/plugins/pypi/pip.py,sha256=7B06mPOs5MvY33xbzPVYZlBr1iKMYaN-n8uulL9zSVg,13649
297
- metaflow/plugins/pypi/pypi_decorator.py,sha256=h5cAnxkWjmj4Ad4q0AkABKwhHQHYfeexy12yMaaLgXQ,6443
297
+ metaflow/plugins/pypi/pypi_decorator.py,sha256=rDMbHl7r81Ye7-TuIlKAVJ_CDnfjl9jV44ZPws-UsTY,7229
298
298
  metaflow/plugins/pypi/pypi_environment.py,sha256=FYMg8kF3lXqcLfRYWD83a9zpVjcoo_TARqMGZ763rRk,230
299
299
  metaflow/plugins/pypi/utils.py,sha256=ds1Mnv_DaxGnLAYp7ozg_K6oyguGyNhvHfE-75Ia1YA,2836
300
300
  metaflow/plugins/secrets/__init__.py,sha256=mhJaN2eMS_ZZVewAMR2E-JdP5i0t3v9e6Dcwd-WpruE,310
@@ -344,9 +344,9 @@ metaflow/tutorials/07-worldview/README.md,sha256=5vQTrFqulJ7rWN6r20dhot9lI2sVj9W
344
344
  metaflow/tutorials/07-worldview/worldview.ipynb,sha256=ztPZPI9BXxvW1QdS2Tfe7LBuVzvFvv0AToDnsDJhLdE,2237
345
345
  metaflow/tutorials/08-autopilot/README.md,sha256=GnePFp_q76jPs991lMUqfIIh5zSorIeWznyiUxzeUVE,1039
346
346
  metaflow/tutorials/08-autopilot/autopilot.ipynb,sha256=DQoJlILV7Mq9vfPBGW-QV_kNhWPjS5n6SJLqePjFYLY,3191
347
- metaflow-2.12.17.dist-info/LICENSE,sha256=nl_Lt5v9VvJ-5lWJDT4ddKAG-VZ-2IaLmbzpgYDz2hU,11343
348
- metaflow-2.12.17.dist-info/METADATA,sha256=w84PuAmNwt7w-PGFrUHmcNAj5BJFQ_26DkctyFTls2M,5906
349
- metaflow-2.12.17.dist-info/WHEEL,sha256=GUeE9LxUgRABPG7YM0jCNs9cBsAIx0YAkzCB88PMLgc,109
350
- metaflow-2.12.17.dist-info/entry_points.txt,sha256=IKwTN1T3I5eJL3uo_vnkyxVffcgnRdFbKwlghZfn27k,57
351
- metaflow-2.12.17.dist-info/top_level.txt,sha256=v1pDHoWaSaKeuc5fKTRSfsXCKSdW1zvNVmvA-i0if3o,9
352
- metaflow-2.12.17.dist-info/RECORD,,
347
+ metaflow-2.12.19.dist-info/LICENSE,sha256=nl_Lt5v9VvJ-5lWJDT4ddKAG-VZ-2IaLmbzpgYDz2hU,11343
348
+ metaflow-2.12.19.dist-info/METADATA,sha256=jMfQXXyRRJPzr4SJe-Y9028tXuVWJCMg7ZmXbEMswQI,5906
349
+ metaflow-2.12.19.dist-info/WHEEL,sha256=O8iI_RpvXnU2dkdPNf_wSffaC9hi-VsSQKnuYEptk_s,109
350
+ metaflow-2.12.19.dist-info/entry_points.txt,sha256=IKwTN1T3I5eJL3uo_vnkyxVffcgnRdFbKwlghZfn27k,57
351
+ metaflow-2.12.19.dist-info/top_level.txt,sha256=v1pDHoWaSaKeuc5fKTRSfsXCKSdW1zvNVmvA-i0if3o,9
352
+ metaflow-2.12.19.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (73.0.1)
2
+ Generator: setuptools (74.1.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any