typing_copilot icon indicating copy to clipboard operation
typing_copilot copied to clipboard

Add a better error message when a user runs the compilot in a nested directory

Open MichaelaShtilmanMinkin opened this issue 4 years ago • 1 comments

If you're supposed to run the copilot in the parent directory but run it any number of levels in, you'll see a message along the lines of:

AssertionError: Unexpected mypy exit code 2. Process info: CompletedProcess(args=['mypy', '--config-file', '/var/folders/q5/xdhsj6997hl8qghm3bx6v74r0000gn/T/mypy-copilot-kcxuh4uf/mypy.ini', '--show-error-codes', '--error-summary', '.'], returncode=2, stdout='', stderr='. is not a valid Python package name\n'

You will see . is not a valid Python package name whether you're in correct_dir/x or correct_dir/x/y.

As a user of typing-copilot, I first activated poetry shell, installed typing copilot, and then tried running typing-copilot init, which failed with the above error. It's easy to miss the step of changing dirs, so it would be beneficial to wrap this error with a hint / suggestion.

MichaelaShtilmanMinkin avatar Feb 03 '21 20:02 MichaelaShtilmanMinkin

Thanks! Definitely a good place to add some polish.

obi1kenobi avatar Feb 03 '21 20:02 obi1kenobi