@@ -10,7 +10,7 @@ def weight(value: int | float) -> Callable[[F], F]:
1010 """Make able to put weight in classes or functions by decorator @weight"""
1111
1212 def decorator (func : F ) -> F :
13- func .weight = value # type: ignore[attr-defined]
13+ func .weight = value
1414 return func
1515
1616 return decorator
@@ -34,11 +34,11 @@ def __call__(self, func: Callable[..., Any]) -> Callable[..., Any]:
3434 def wrapper (* args : Any , ** kwargs : Any ) -> Any :
3535 return func (* args , ** kwargs )
3636
37- # Attach metadata
38- wrapper ._osmo_step = True # type: ignore[attr-defined ]
39- wrapper ._osmo_step_name = self .name or func .__name__ # type: ignore[attr-defined ]
40- wrapper ._osmo_weight = self .weight_value # type: ignore[attr-defined ]
41- wrapper ._osmo_enabled = self .enabled # type: ignore[attr-defined ]
37+ # Attach metadata (dynamic attributes for model discovery)
38+ wrapper ._osmo_step = True # type: ignore[unresolved-attribute ]
39+ wrapper ._osmo_step_name = self .name or func .__name__ # type: ignore[unresolved-attribute ]
40+ wrapper ._osmo_weight = self .weight_value # type: ignore[unresolved-attribute ]
41+ wrapper ._osmo_enabled = self .enabled # type: ignore[unresolved-attribute ]
4242
4343 return wrapper
4444
@@ -102,17 +102,17 @@ def can_process(self) -> bool:
102102 guard_func = step_name_or_func
103103
104104 def inline_decorator (func : Callable [..., Any ]) -> Callable [..., Any ]:
105- func ._osmo_guard_inline = guard_func # type: ignore[attr-defined ]
106- func ._osmo_guard_invert = invert # type: ignore[attr-defined ]
105+ func ._osmo_guard_inline = guard_func # type: ignore[unresolved-attribute ]
106+ func ._osmo_guard_invert = invert # type: ignore[unresolved-attribute ]
107107 return func
108108
109109 return inline_decorator
110110
111111 # Named guard
112112 def named_decorator (func : Callable [..., Any ]) -> Callable [..., Any ]:
113- func ._osmo_guard = True # type: ignore[attr-defined ]
114- func ._osmo_guard_for = step_name_or_func # type: ignore[attr-defined ]
115- func ._osmo_guard_invert = invert # type: ignore[attr-defined ]
113+ func ._osmo_guard = True # type: ignore[unresolved-attribute ]
114+ func ._osmo_guard_for = step_name_or_func # type: ignore[unresolved-attribute ]
115+ func ._osmo_guard_invert = invert # type: ignore[unresolved-attribute ]
116116 return func
117117
118118 return named_decorator
@@ -134,8 +134,8 @@ def before_login(self):
134134 """
135135
136136 def decorator (func : F ) -> F :
137- func ._osmo_pre = True # type: ignore[attr-defined]
138- func ._osmo_pre_for = step_name # type: ignore[attr-defined]
137+ func ._osmo_pre = True
138+ func ._osmo_pre_for = step_name
139139 return func
140140
141141 return decorator
@@ -157,8 +157,8 @@ def after_login(self):
157157 """
158158
159159 def decorator (func : F ) -> F :
160- func ._osmo_post = True # type: ignore[attr-defined]
161- func ._osmo_post_for = step_name # type: ignore[attr-defined]
160+ func ._osmo_post = True
161+ func ._osmo_post_for = step_name
162162 return func
163163
164164 return decorator
@@ -181,7 +181,7 @@ def checkout(self):
181181 """
182182
183183 def decorator (func : F ) -> F :
184- func ._osmo_requires = list (requirements ) # type: ignore[attr-defined]
184+ func ._osmo_requires = list (requirements )
185185 return func
186186
187187 return decorator
@@ -204,8 +204,8 @@ def complete_order(self):
204204 """
205205
206206 def decorator (func : F ) -> F :
207- func ._osmo_requires = list (requirements ) # type: ignore[attr-defined]
208- func ._osmo_requires_all = True # type: ignore[attr-defined]
207+ func ._osmo_requires = list (requirements )
208+ func ._osmo_requires_all = True
209209 return func
210210
211211 return decorator
@@ -228,8 +228,8 @@ def check_auth(self):
228228 """
229229
230230 def decorator (func : F ) -> F :
231- func ._osmo_requires = list (requirements ) # type: ignore[attr-defined]
232- func ._osmo_requires_any = True # type: ignore[attr-defined]
231+ func ._osmo_requires = list (requirements )
232+ func ._osmo_requires_any = True
233233 return func
234234
235235 return decorator
@@ -254,9 +254,9 @@ def get_cart_size(self) -> str:
254254 """
255255
256256 def decorator (func : F ) -> F :
257- func ._osmo_variable = True # type: ignore[attr-defined]
258- func ._osmo_variable_name = name # type: ignore[attr-defined]
259- func ._osmo_variable_categories = categories # type: ignore[attr-defined]
257+ func ._osmo_variable = True
258+ func ._osmo_variable_name = name
259+ func ._osmo_variable_categories = categories
260260 return func
261261
262262 return decorator
@@ -276,5 +276,5 @@ def get_state(self) -> str:
276276 Returns:
277277 Decorated function
278278 """
279- func ._osmo_state = True # type: ignore[attr-defined]
279+ func ._osmo_state = True
280280 return func
0 commit comments