-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix(cli): add RuntimeError when no python package found #81
fix(cli): add RuntimeError when no python package found #81
Conversation
this make it more explicit there is an issue somewhere instead of rez-pip just finishing without outputing anything to stdout
Note that all tests passed on my local Windows machine with python-3.10, note sure what is going on here. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #81 +/- ##
==========================================
- Coverage 82.14% 81.91% -0.23%
==========================================
Files 8 8
Lines 717 719 +2
Branches 149 150 +1
==========================================
Hits 589 589
- Misses 113 115 +2
Partials 15 15 ☔ View full report in Codecov by Sentry. |
src/rez_pip/cli.py
Outdated
raise RuntimeError( | ||
f"No python package found on system for python-{args.python_version}" |
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.
raise RuntimeError( | |
f"No python package found on system for python-{args.python_version}" | |
```suggestion | |
raise rez_pip.exceptions.RezPipError( | |
f'No "python" package found within the range {args.python_version!r}.' |
By using RezPipError
, the error will be nicely integrated and will be consistent with the other errors raised by rez-pip. I also tweaked the error message a bit.
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.
done !
4d73fcd
into
JeanChristopheMorinPerso:main
Hello,
This is a very simple change that is part of an issue I'm currently investigating on why does rez-pip doesn't work on a system.
Adding the exception make it more explicit there is an issue on the python package side, instead of rez-pip just finishing without outputing anything to stdout which make it tricky to debug.
I do not know the side-effect of raising an exception at this level so let me know if you prefer a "softer" solution.