Skip to content

Commit

Permalink
fix[tool]: fix combined_json output for CLI (vyperlang#3901)
Browse files Browse the repository at this point in the history
the output json would not be produced because Path does not have a json
serializer

there are actually tests for `combined_json`, but they test the
`compile_files` API directly, whereas the offending code is in the very
outer `_cli_helper()` function.

the best (long-term) way to test this might be to have a harness which
runs the vyper CLI directly from shell, but that is not explored here
to reduce scope.
  • Loading branch information
charles-cooper authored and electriclilies committed Apr 27, 2024
1 parent bd977e1 commit 43edb37
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions vyper/cli/vyper_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def _parse_cli_args():

def _cli_helper(f, output_formats, compiled):
if output_formats == ("combined_json",):
compiled = {str(path): v for (path, v) in compiled.items()}
print(json.dumps(compiled), file=f)
return

Expand Down

0 comments on commit 43edb37

Please # to comment.