File tree Expand file tree Collapse file tree 1 file changed +20
-11
lines changed Expand file tree Collapse file tree 1 file changed +20
-11
lines changed Original file line number Diff line number Diff line change 3
3
import pathlib
4
4
import inspect
5
5
import importlib
6
+ import typing
6
7
7
8
import yaml
8
9
@@ -109,17 +110,25 @@ def _call_signature(
109
110
110
111
if expected_type == pathlib .Path :
111
112
kwargs [arg ] = (config_folder / pathlib .Path (kwargs [arg ])).resolve ()
112
-
113
- if not isinstance (kwargs [arg ], expected_type ):
114
- raise ParserError (
115
- f"{ terminal_colors .RED } { terminal_colors .BOLD } "
116
- f"The value provided for argument `{ arg } ` "
117
- f"given to container `{ container_name } ` is "
118
- f"of type `{ type (kwargs [arg ]).__name__ } `. "
119
- f"Expected type "
120
- f"`{ argspec .annotations [arg ].__name__ } `."
121
- f"{ terminal_colors .END } "
122
- )
113
+ elif expected_type == typing .List [pathlib .Path ]:
114
+ kwargs [arg ] = [
115
+ (config_folder / pathlib .Path (patharg )).resolve ()
116
+ for patharg in kwargs [arg ]
117
+ ]
118
+ try :
119
+ if not isinstance (kwargs [arg ], expected_type ):
120
+ raise ParserError (
121
+ f"{ terminal_colors .RED } { terminal_colors .BOLD } "
122
+ f"The value provided for argument `{ arg } ` "
123
+ f"given to container `{ container_name } ` is "
124
+ f"of type `{ type (kwargs [arg ]).__name__ } `. "
125
+ f"Expected type "
126
+ f"`{ argspec .annotations [arg ].__name__ } `."
127
+ f"{ terminal_colors .END } "
128
+ )
129
+ # Typechecking typing classes does not work in python 3.7
130
+ except TypeError :
131
+ pass
123
132
124
133
special_args = ""
125
134
if "app" in argspec .args :
You can’t perform that action at this time.
0 commit comments