metaflow 2.12.5__py2.py3-none-any.whl → 2.12.6__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.
@@ -6,6 +6,7 @@ import shlex
6
6
  import sys
7
7
  from collections import defaultdict
8
8
  from hashlib import sha1
9
+ from math import inf
9
10
 
10
11
  from metaflow import JSONType, current
11
12
  from metaflow.decorators import flow_decorators
@@ -901,7 +902,9 @@ class ArgoWorkflows(object):
901
902
  "argo-{{workflow.name}}/%s/{{tasks.%s.outputs.parameters.task-id}}"
902
903
  % (n, self._sanitize(n))
903
904
  for n in node.in_funcs
904
- ]
905
+ ],
906
+ # NOTE: We set zlibmin to infinite because zlib compression for the Argo input-paths breaks template value substitution.
907
+ zlibmin=inf,
905
908
  )
906
909
  )
907
910
  ]
@@ -2154,7 +2157,8 @@ class ArgoWorkflows(object):
2154
2157
  # everything within the body.
2155
2158
  # NOTE: We need the conditional logic in order to successfully fall back to the default value
2156
2159
  # when the event payload does not contain a key for a parameter.
2157
- data_template='{{ if (hasKey $.Input.body.payload "%s") }}{{- (.Input.body.payload.%s | toJson) -}}{{- else -}}{{ (fail "use-default-instead") }}{{- end -}}'
2160
+ # NOTE: Keys might contain dashes, so use the safer 'get' for fetching the value
2161
+ data_template='{{ if (hasKey $.Input.body.payload "%s") }}{{- (get $.Input.body.payload "%s" | toJson) -}}{{- else -}}{{ (fail "use-default-instead") }}{{- end -}}'
2158
2162
  % (v, v),
2159
2163
  # Unfortunately the sensor needs to
2160
2164
  # record the default values for
@@ -100,6 +100,10 @@ class CondaStepDecorator(StepDecorator):
100
100
  # --environment=pypi to --environment=conda
101
101
  _supported_virtual_envs.extend(["pypi"])
102
102
 
103
+ # TODO: Hardcoded for now to support Docker environment.
104
+ # We should introduce a more robust mechanism for appending supported environments, for example from within extensions.
105
+ _supported_virtual_envs.extend(["docker"])
106
+
103
107
  # The --environment= requirement ensures that valid virtual environments are
104
108
  # created for every step to execute it, greatly simplifying the @conda
105
109
  # implementation.
@@ -340,6 +344,10 @@ class CondaFlowDecorator(FlowDecorator):
340
344
  # --environment=pypi to --environment=conda
341
345
  _supported_virtual_envs.extend(["pypi"])
342
346
 
347
+ # TODO: Hardcoded for now to support Docker environment.
348
+ # We should introduce a more robust mechanism for appending supported environments, for example from within extensions.
349
+ _supported_virtual_envs.extend(["docker"])
350
+
343
351
  # The --environment= requirement ensures that valid virtual environments are
344
352
  # created for every step to execute it, greatly simplifying the @conda
345
353
  # implementation.
@@ -65,7 +65,7 @@ class CondaEnvironment(MetaflowEnvironment):
65
65
  micromamba = Micromamba()
66
66
  self.solvers = {"conda": micromamba, "pypi": Pip(micromamba)}
67
67
 
68
- def init_environment(self, echo):
68
+ def init_environment(self, echo, only_steps=None):
69
69
  # The implementation optimizes for latency to ensure as many operations can
70
70
  # be turned into cheap no-ops as feasible. Otherwise, we focus on maintaining
71
71
  # a balance between latency and maintainability of code without re-implementing
@@ -77,6 +77,8 @@ class CondaEnvironment(MetaflowEnvironment):
77
77
  def environments(type_):
78
78
  seen = set()
79
79
  for step in self.flow:
80
+ if only_steps and step.name not in only_steps:
81
+ continue
80
82
  environment = self.get_environment(step)
81
83
  if type_ in environment and environment["id_"] not in seen:
82
84
  seen.add(environment["id_"])
@@ -9,7 +9,6 @@ from itertools import chain, product
9
9
  from urllib.parse import unquote
10
10
 
11
11
  from metaflow.exception import MetaflowException
12
- from metaflow.util import which
13
12
 
14
13
  from .micromamba import Micromamba
15
14
  from .utils import pip_tags, wheel_tags
@@ -25,6 +24,23 @@ class PipException(MetaflowException):
25
24
  super(PipException, self).__init__(msg)
26
25
 
27
26
 
27
+ class PipPackageNotFound(Exception):
28
+ "Wrapper for pip package resolve errors."
29
+
30
+ def __init__(self, error):
31
+ self.error = error
32
+ try:
33
+ # Parse the package spec from error message:
34
+ # ERROR: ERROR: Could not find a version that satisfies the requirement pkg==0.0.1 (from versions: none)
35
+ # ERROR: No matching distribution found for pkg==0.0.1
36
+ self.package_spec = re.search(
37
+ "ERROR: No matching distribution found for (.*)", self.error
38
+ )[1]
39
+ self.package_name = re.match("\w*", self.package_spec)[0]
40
+ except Exception:
41
+ pass
42
+
43
+
28
44
  METADATA_FILE = "{prefix}/.pip/metadata"
29
45
  INSTALLATION_MARKER = "{prefix}/.pip/id"
30
46
 
@@ -81,7 +97,16 @@ class Pip(object):
81
97
  cmd.append(f"{package}{version}")
82
98
  else:
83
99
  cmd.append(f"{package}=={version}")
84
- self._call(prefix, cmd)
100
+ try:
101
+ self._call(prefix, cmd)
102
+ except PipPackageNotFound as ex:
103
+ # pretty print package errors
104
+ raise PipException(
105
+ "Could not find a binary distribution for %s \n"
106
+ "for the platform %s\n\n"
107
+ "Note that ***@pypi*** does not currently support source distributions"
108
+ % (ex.package_spec, platform)
109
+ )
85
110
 
86
111
  def _format(dl_info):
87
112
  res = {k: v for k, v in dl_info.items() if k in ["url"]}
@@ -302,11 +327,14 @@ class Pip(object):
302
327
  .strip()
303
328
  )
304
329
  except subprocess.CalledProcessError as e:
330
+ errors = e.stderr.decode()
331
+ if "No matching distribution" in errors:
332
+ raise PipPackageNotFound(errors)
305
333
  raise PipException(
306
334
  "command '{cmd}' returned error ({code}) {output}\n{stderr}".format(
307
335
  cmd=" ".join(e.cmd),
308
336
  code=e.returncode,
309
337
  output=e.output.decode(),
310
- stderr=e.stderr.decode(),
338
+ stderr=errors,
311
339
  )
312
340
  )
@@ -70,6 +70,10 @@ class PyPIStepDecorator(StepDecorator):
70
70
  # --environment=pypi to --environment=conda
71
71
  _supported_virtual_envs.extend(["pypi"])
72
72
 
73
+ # TODO: Hardcoded for now to support Docker environment.
74
+ # We should introduce a more robust mechanism for appending supported environments, for example from within extensions.
75
+ _supported_virtual_envs.extend(["docker"])
76
+
73
77
  # The --environment= requirement ensures that valid virtual environments are
74
78
  # created for every step to execute it, greatly simplifying the @pypi
75
79
  # implementation.
@@ -119,6 +123,10 @@ class PyPIFlowDecorator(FlowDecorator):
119
123
  # --environment=pypi to --environment=conda
120
124
  _supported_virtual_envs.extend(["pypi"])
121
125
 
126
+ # TODO: Hardcoded for now to support Docker environment.
127
+ # We should introduce a more robust mechanism for appending supported environments, for example from within extensions.
128
+ _supported_virtual_envs.extend(["docker"])
129
+
122
130
  # The --environment= requirement ensures that valid virtual environments are
123
131
  # created for every step to execute it, greatly simplifying the @conda
124
132
  # implementation.
metaflow/version.py CHANGED
@@ -1 +1 @@
1
- metaflow_version = "2.12.5"
1
+ metaflow_version = "2.12.6"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: metaflow
3
- Version: 2.12.5
3
+ Version: 2.12.6
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.5 ; extra == 'stubs'
29
+ Requires-Dist: metaflow-stubs ==2.12.6 ; 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
 
@@ -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=m5womQ7y-jXehuMyHPfByDbZ4HwTJxzs869cPOlMR8s,13057
37
37
  metaflow/vendor.py,sha256=FchtA9tH22JM-eEtJ2c9FpUdMn8sSb1VHuQS56EcdZk,5139
38
- metaflow/version.py,sha256=c_PABqNl34MzEytuF8yQavSkvAjpdC4GMlENKrxredY,28
38
+ metaflow/version.py,sha256=W4Z4K8bmvALkOGfzpEO-uMEWPW_3H7Ez7xUk75yIURk,28
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
@@ -174,7 +174,7 @@ metaflow/plugins/airflow/sensors/s3_sensor.py,sha256=iDReG-7FKnumrtQg-HY6cCUAAqN
174
174
  metaflow/plugins/argo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
175
175
  metaflow/plugins/argo/argo_client.py,sha256=MKKhMCbWOPzf6z5zQQiyDRHHkAXcO7ipboDZDqAAvOk,15849
176
176
  metaflow/plugins/argo/argo_events.py,sha256=_C1KWztVqgi3zuH57pInaE9OzABc2NnncC-zdwOMZ-w,5909
177
- metaflow/plugins/argo/argo_workflows.py,sha256=OAbj6S3uuyS-od_Fstrt2eif-8M2mHhPRgbQjCVRXho,130335
177
+ metaflow/plugins/argo/argo_workflows.py,sha256=j07kwbloA4MIPjvaia3Efyvfw3k0nZ99yO3D6gnZy5k,130683
178
178
  metaflow/plugins/argo/argo_workflows_cli.py,sha256=sZTpgfmc50eT3e0qIxpVqUgWhTcYlO1HM4gU6Oaya8g,33259
179
179
  metaflow/plugins/argo/argo_workflows_decorator.py,sha256=K5t4uIk2IXPdK7v7DEjj3buSB8ikLjLycKjbZUYeiaw,6781
180
180
  metaflow/plugins/argo/generate_input_paths.py,sha256=loYsI6RFX9LlFsHb7Fe-mzlTTtRdySoOu7sYDy-uXK0,881
@@ -285,11 +285,11 @@ metaflow/plugins/metadata/local.py,sha256=YhLJC5zjVJrvQFIyQ92ZBByiUmhCC762RUX7IT
285
285
  metaflow/plugins/metadata/service.py,sha256=ihq5F7KQZlxvYwzH_-jyP2aWN_I96i2vp92j_d697s8,20204
286
286
  metaflow/plugins/pypi/__init__.py,sha256=0YFZpXvX7HCkyBFglatual7XGifdA1RwC3U4kcizyak,1037
287
287
  metaflow/plugins/pypi/bootstrap.py,sha256=Hik3PZ_RQC8T6hEf-NE2Xr_jq2ZIUkpgUtJlx-rqJgU,5107
288
- metaflow/plugins/pypi/conda_decorator.py,sha256=-bPxNtZKjxqOo4sj89uIp8ZVrCIontWhAp7wwRFjYpg,14189
289
- metaflow/plugins/pypi/conda_environment.py,sha256=7k5GJ6S-EiSkDxnFtNpdKkCOiMKSnjOJ-2N_0fWjMHU,19230
288
+ metaflow/plugins/pypi/conda_decorator.py,sha256=phrUvVC5QrfNwPqIByrXsnpRDg1SNVsfpl1wbAVrykI,14679
289
+ metaflow/plugins/pypi/conda_environment.py,sha256=COybS4bogDm956UzOzbd4JupE7PBbEMqq1dfl-f9DYM,19339
290
290
  metaflow/plugins/pypi/micromamba.py,sha256=wlVN2fm4WXFh3jVNtpDfu4XEz6VJKbmFNp0QvqlMIuI,12179
291
- metaflow/plugins/pypi/pip.py,sha256=MAgdyP7wK7Cp6iusG6S-jeKKDCxlA9k-jMqIGvyi0Ng,12472
292
- metaflow/plugins/pypi/pypi_decorator.py,sha256=syWk_oSQhIK9Y7OeOINMG2XVyxh9sj5uJhapwAXRBDw,5583
291
+ metaflow/plugins/pypi/pip.py,sha256=uYPEHYV1_PtY4QA3NqUcVSPBAlRucGeY9tuyz7sB7aY,13641
292
+ metaflow/plugins/pypi/pypi_decorator.py,sha256=Plmm4fhLECW-sj1QSFI84Gva7qqqwlJsqJ8laCRKIzw,6073
293
293
  metaflow/plugins/pypi/pypi_environment.py,sha256=FYMg8kF3lXqcLfRYWD83a9zpVjcoo_TARqMGZ763rRk,230
294
294
  metaflow/plugins/pypi/utils.py,sha256=ds1Mnv_DaxGnLAYp7ozg_K6oyguGyNhvHfE-75Ia1YA,2836
295
295
  metaflow/plugins/secrets/__init__.py,sha256=mhJaN2eMS_ZZVewAMR2E-JdP5i0t3v9e6Dcwd-WpruE,310
@@ -332,9 +332,9 @@ metaflow/tutorials/07-worldview/README.md,sha256=5vQTrFqulJ7rWN6r20dhot9lI2sVj9W
332
332
  metaflow/tutorials/07-worldview/worldview.ipynb,sha256=ztPZPI9BXxvW1QdS2Tfe7LBuVzvFvv0AToDnsDJhLdE,2237
333
333
  metaflow/tutorials/08-autopilot/README.md,sha256=GnePFp_q76jPs991lMUqfIIh5zSorIeWznyiUxzeUVE,1039
334
334
  metaflow/tutorials/08-autopilot/autopilot.ipynb,sha256=DQoJlILV7Mq9vfPBGW-QV_kNhWPjS5n6SJLqePjFYLY,3191
335
- metaflow-2.12.5.dist-info/LICENSE,sha256=nl_Lt5v9VvJ-5lWJDT4ddKAG-VZ-2IaLmbzpgYDz2hU,11343
336
- metaflow-2.12.5.dist-info/METADATA,sha256=WNxjG7krB0L--6wpxwGN5tzT7B0SoB7wL-P7DZ4WDAI,5906
337
- metaflow-2.12.5.dist-info/WHEEL,sha256=pOwdCRdxkCaq8tWTvnGIC-q_meWYHwmqvvQPkeaM2I4,109
338
- metaflow-2.12.5.dist-info/entry_points.txt,sha256=IKwTN1T3I5eJL3uo_vnkyxVffcgnRdFbKwlghZfn27k,57
339
- metaflow-2.12.5.dist-info/top_level.txt,sha256=v1pDHoWaSaKeuc5fKTRSfsXCKSdW1zvNVmvA-i0if3o,9
340
- metaflow-2.12.5.dist-info/RECORD,,
335
+ metaflow-2.12.6.dist-info/LICENSE,sha256=nl_Lt5v9VvJ-5lWJDT4ddKAG-VZ-2IaLmbzpgYDz2hU,11343
336
+ metaflow-2.12.6.dist-info/METADATA,sha256=aTpN9idMdHJ1zv9CxVHgfJKMdfbhlHNnS2XF_xtt1hE,5906
337
+ metaflow-2.12.6.dist-info/WHEEL,sha256=0XQbNV6JE5ziJsWjIU8TRRv0N6SohNonLWgP86g5fiI,109
338
+ metaflow-2.12.6.dist-info/entry_points.txt,sha256=IKwTN1T3I5eJL3uo_vnkyxVffcgnRdFbKwlghZfn27k,57
339
+ metaflow-2.12.6.dist-info/top_level.txt,sha256=v1pDHoWaSaKeuc5fKTRSfsXCKSdW1zvNVmvA-i0if3o,9
340
+ metaflow-2.12.6.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (70.1.0)
2
+ Generator: setuptools (70.2.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any