Skip to content
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

Merged
merged 4 commits into from
Dec 17, 2023

Conversation

MrLixm
Copy link
Contributor

@MrLixm MrLixm commented Dec 14, 2023

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.

this make it more explicit there is an issue somewhere instead of rez-pip just finishing without outputing anything to stdout
@MrLixm
Copy link
Contributor Author

MrLixm commented Dec 14, 2023

Note that all tests passed on my local Windows machine with python-3.10, note sure what is going on here.

Copy link

codecov bot commented Dec 16, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (8515ee4) 82.14% compared to head (a405bcc) 81.91%.

Files Patch % Lines
src/rez_pip/cli.py 0.00% 2 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

Comment on lines 167 to 168
raise RuntimeError(
f"No python package found on system for python-{args.python_version}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done !

@JeanChristopheMorinPerso JeanChristopheMorinPerso merged commit 4d73fcd into JeanChristopheMorinPerso:main Dec 17, 2023
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants