typing_copilot
typing_copilot copied to clipboard
Add a better error message when a user runs the compilot in a nested directory
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.
Thanks! Definitely a good place to add some polish.