-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* __main__, cli: add KontrolCLIArgs module for foundry arguments * Set Version: 0.1.5 * kontrol/cli: option --foundry-project-root => --root, to mimic direct forge calls better * Revert "kontrol/cli: option --foundry-project-root => --root, to mimic direct forge calls better" This reverts commit 0b5fdbd. * kontrol/cli: adjust to pre-update version of KEVM * Set Version: 0.1.6 --------- Co-authored-by: devops <devops@runtimeverification.com> Co-authored-by: rv-jenkins <admin@runtimeverification.com>
- Loading branch information
1 parent
c7b4d31
commit a012b23
Showing
4 changed files
with
117 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.1.5 | ||
0.1.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
from __future__ import annotations | ||
|
||
from argparse import ArgumentParser | ||
from functools import cached_property | ||
from pathlib import Path | ||
from typing import TYPE_CHECKING | ||
|
||
from kevm_pyk.cli import KEVMCLIArgs | ||
from pyk.cli.utils import dir_path | ||
|
||
if TYPE_CHECKING: | ||
from typing import TypeVar | ||
|
||
T = TypeVar('T') | ||
|
||
|
||
class KontrolCLIArgs(KEVMCLIArgs): | ||
@cached_property | ||
def foundry_args(self) -> ArgumentParser: | ||
args = ArgumentParser(add_help=False) | ||
args.add_argument( | ||
'--foundry-project-root', | ||
dest='foundry_root', | ||
type=dir_path, | ||
default=Path('.'), | ||
help='Path to Foundry project root directory.', | ||
) | ||
return args | ||
|
||
@cached_property | ||
def foundry_test_args(self) -> ArgumentParser: | ||
args = ArgumentParser(add_help=False) | ||
args.add_argument('test', type=str, help='Test to run') | ||
args.add_argument('--id', type=str, default=None, required=False, help='ID of the test') | ||
return args | ||
|
||
@cached_property | ||
def k_gen_args(self) -> ArgumentParser: | ||
args = ArgumentParser(add_help=False) | ||
args.add_argument( | ||
'--require', | ||
dest='requires', | ||
default=[], | ||
action='append', | ||
help='Extra K requires to include in generated output.', | ||
) | ||
args.add_argument( | ||
'--module-import', | ||
dest='imports', | ||
default=[], | ||
action='append', | ||
help='Extra modules to import into generated main module.', | ||
) | ||
return args |