You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently, if I want to apply a pre-build hook to both containers and scripts, I need to register the same hook twice, once for the Script type and once for Container. Similarly, there is no easy way to register a pre-build hook that will apply to all templates regardless of template type.
Describe the solution you'd like
Pre-build hooks should support union types, e.g.
ScriptOrContainer=TypeVar('ScriptOrContainer', bound=Union[Script, Container])
# This hook should be applied to scripts and containers@register_pre_build_hookdeffoo(template: T) ->T:
...
There should be an easy way to set a pre-build hook to support all template types.
Describe alternatives you've considered
The best alternative now is to define the hook in a native python function, and then wrap that function in a registered hook once per each type it needs to support.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Currently, if I want to apply a pre-build hook to both containers and scripts, I need to register the same hook twice, once for the
Script
type and once forContainer
. Similarly, there is no easy way to register a pre-build hook that will apply to all templates regardless of template type.Describe the solution you'd like
Describe alternatives you've considered
The best alternative now is to define the hook in a native python function, and then wrap that function in a registered hook once per each type it needs to support.
The text was updated successfully, but these errors were encountered: