Fix handling for unknown config variable in pyodide config get#200
Fix handling for unknown config variable in pyodide config get#200hoodmane wants to merge 1 commit intopyodide:mainfrom
pyodide config get#200Conversation
| typer.echo(f"Config variable {config_var} not found.") | ||
| typer.Exit(1) | ||
| print(f"Config variable {config_var} not found.", file=sys.stderr) | ||
| raise typer.Exit(1) |
| if config_var not in configs: | ||
| typer.echo(f"Config variable {config_var} not found.") | ||
| typer.Exit(1) | ||
| print(f"Config variable {config_var} not found.", file=sys.stderr) |
There was a problem hiding this comment.
What's the purpose of changing typo.echo to print? If the goal is to avoid using typer APIs we might change it everywhere.
There was a problem hiding this comment.
The point is to print to stderr. I was unable to figure out how to do that with typer.echo()
There was a problem hiding this comment.
The docs at https://typer.tiangolo.com/tutorial/printing/?h=stderr#printing-to-standard-error say that we need to use stderr=True, but it has to be done at the rich.console.Console() level. Maybe we should set that somewhere?
There was a problem hiding this comment.
I tried that and didn't fix it in ~10 minutes or so of messing around. I think it matters much more that the print goes to stderr then that it goes through rich. The same looking text shows up on the console at the end either way.
ryanking13
left a comment
There was a problem hiding this comment.
It looks like some tests need to be updated to check result.stderr. Otherwise looks good to me.
No description provided.