Skip to content

Commit

Permalink
cli: tmp fix, this should be revisited
Browse files Browse the repository at this point in the history
* the type inference is buggy. it is strange that this happens now and
  was not discovered at the implementation time
  • Loading branch information
utnapischtim committed Nov 10, 2023
1 parent 072355a commit de560df
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion repository_cli/generate_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ def build_method_options(method: Callable) -> list:
# click coerces to `type`, which is ambiguous for `typing.Union` types
# (e.g. which of the classes `A`, `B` should `Union[A, B]` coerce to?)
# hence such annotations can't be used...
option_kwargs["type"] = param_info.annotation
# type_ = param_info.annotation
# option_kwargs["type"] = str if type_ == "str" else type_
# TODO
option_kwargs["type"] = str

options.append(option(f"--{param_name.replace('_', '-')}", **option_kwargs))

Expand Down

0 comments on commit de560df

Please sign in to comment.