-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added toml processing capability #2369
Conversation
…vm-semantics into tolga/toml-options
… the argument values provided from toml files, also adds some tests in this context
kevm-pyk/src/kevm_pyk/cli.py
Outdated
|
||
@staticmethod | ||
def get_argument_type() -> dict[str, Callable]: | ||
return {'node': node_id_like, 'node-delta': arg_pair_of(node_id_like, node_id_like)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is still a type mismatch. KCFGShowOptions.nodes
is expected to be a list of node ids, but the TOML reading system expects a single node ID, and will assign KCFGShowOptions.nodes
to that int
. With the get_argument_type
system you added maybe you can just set the argument type to list
. This should apply to all the options where the add_argument
call for that option has action='append'
. That setting makes it so that the typing function specified in add_argument
's type
parameter no longer matches the type that we want to end up as a field in the options class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've modified list_of()
function to handle lists provided by toml and apply type transformation to each element of the string. Also modified my test to test for nodes
and node_deltas
properly.
This PR adds toml config file input capability.
Following changes are provided:
parse_toml_args
function reads all the options available in the toml file provided, taking into account the provided profile nameget_option_string_destination
function collects the mathing option string according to the provided key in toml file by utilizing the newly addedfrom_option_string
method in*Options
classes.pyk.cli
package to provide better testability