-
Notifications
You must be signed in to change notification settings - Fork 422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print more user friendly error when --python version not found #1171
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI failing.
Windows was not covered, should be fixed now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase.
Co-authored-by: chrysle <[email protected]>
for more information, see https://pre-commit.ci
Indentation never works with those suggestions :-( |
Yeah that would be too easy. Does the message look fine to you now? I got rid of the newline as it is stripped by pipx_wrap anyways. Looks like this now: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Unfortunately, one release chases the other these days...
I'm afraid you'll have to rebase once more.
docs/changelog.md
Summary of changes
Resolves #1089
Capture FileNotFound error during the install command and exit with a meaningful error message if it indicates that the provided python version was not found.
I think it would actually be nice to do the handling in venv.create_venv which is where the error surfaces. This would mean that the handling is uniform for all places that use this functionality (commands/run, commands/common, commands/install), bit it would also introduce a return value to this function.
def create_venv(...) -> None:
->def create_venv(...) -> EXIT_CODE_OK | EXIT_CODE_SPECIFIED_PYTHON_EXECUTABLE_NOT_FOUND:
If that's desired I'm happy to change the code accordingly.
Test plan
Tested by running
nox -s tests-3.12