Skip to content

Commit 5c12282

Browse files
authoredAug 21, 2024··
move user-defined attribute check code to pypi decorator (#1979)
1 parent 58e9418 commit 5c12282

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

‎metaflow/plugins/pypi/pypi_decorator.py

+9
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ class PyPIStepDecorator(StepDecorator):
2424
name = "pypi"
2525
defaults = {"packages": {}, "python": None, "disabled": None} # wheels
2626

27+
def __init__(self, attributes=None, statically_defined=False):
28+
self._user_defined_attributes = (
29+
attributes.copy() if attributes is not None else {}
30+
)
31+
super().__init__(attributes, statically_defined)
32+
2733
def step_init(self, flow, graph, step, decos, environment, flow_datastore, logger):
2834
# The init_environment hook for Environment creates the relevant virtual
2935
# environments. The step_init hook sets up the relevant state for that hook to
@@ -88,6 +94,9 @@ def step_init(self, flow, graph, step, decos, environment, flow_datastore, logge
8894
)
8995
)
9096

97+
def is_attribute_user_defined(self, name):
98+
return name in self._user_defined_attributes
99+
91100

92101
class PyPIFlowDecorator(FlowDecorator):
93102
"""

0 commit comments

Comments
 (0)