Skip to content

Commit 3aaf15c

Browse files
authored
feat: -vvv dumps conifg to output (#261)
* feat: -vvv dumps conifg to output * fix: prevent hatch pre-install command from failing when CPU_ONLY is unset
1 parent dcb2333 commit 3aaf15c

3 files changed

Lines changed: 19 additions & 2 deletions

File tree

esbmc_ai/__main__.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
# Author: Yiannis Charalambous 2023
44

5+
import json
56
import logging
67
import sys
78

@@ -201,12 +202,29 @@ def main() -> None:
201202

202203
cm.set_verifier_by_name(config.verifier.name)
203204

205+
# Show full config at highest verbosity level (-vvv)
206+
if config.verbose_level >= 3:
207+
logger.debug("Global configuration:")
208+
print(json.dumps(config.model_dump(), indent=2, default=str))
209+
print()
210+
204211
# Run the command
205212
command_name = config.command_name
206213
command_names: list[str] = cm.command_names
207214
if command_name in command_names:
208215
logger.info(f"Running Command: {command_name}\n")
209216
command: ChatCommand = cm.commands[command_name]
217+
218+
# Show command config at highest verbosity level (-vvv)
219+
if config.verbose_level >= 3:
220+
try:
221+
cmd_config = command.config
222+
logger.debug(f"Command '{command_name}' configuration:")
223+
print(json.dumps(cmd_config.model_dump(), indent=2, default=str))
224+
print()
225+
except NotImplementedError:
226+
pass
227+
210228
result: CommandResult | None = command.execute()
211229
if result:
212230
print(result)

esbmc_ai/commands/fix_code_command.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ def execute(self) -> FixCodeCommandResult:
136136
solution: Solution = Solution([])
137137
solution.add_source_file(source_file)
138138

139-
self._logger.info(f"FixCodeConfig: {self._config}")
140139

141140
verifier: Any = ComponentManager().get_verifier("esbmc")
142141
assert isinstance(verifier, ESBMC)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ dependencies = [
5858

5959
pre-install-commands = [
6060
# Preinstall hook for PyTorch - installs CPU-only version if CPU_ONLY=true
61-
'[ -n "$CPU_ONLY" ] && pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu',
61+
'[ -n "$CPU_ONLY" ] && pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu || true',
6262
]
6363

6464
[tool.hatch.envs.default.scripts]

0 commit comments

Comments
 (0)