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
{catkin,python} plugin: support cleaning #2171
{catkin,python} plugin: support cleaning #2171
Conversation
@@ -159,20 +171,20 @@ def _ensure_pip_installed(self): | |||
if not self._is_pip_installed(): | |||
logger.info('Fetching and installing pip...') | |||
|
|||
real_python_home = self._python_home | |||
real_python_home = self.__python_home |
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.
doesn't this have an extra _?
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.
ah, this is weird :-P
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.
Yeah it looks a tad off, but it maintains current behavior: "Ignore whatever you think you know, use this one. Okay, now you can go back to normal."
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.
Yeah, it is made clear in the comments below, but not as I read line by line until I reached the end of it 😄
Both the Catkin and Python plugins utilize the Pip class in order to clean their pull steps (specifically, they tell the Pip class to clean its packages). However, when cleaning the pull step, Python has already been removed from the installdir, which means the Pip class cannot be instantiated, causing an error about being unable to find Python. It's reasonable to ask Pip to clean any fetched packages, and doing so doesn't require Python. Fix this issue by lazily looking for Python only when it's required instead of upon class instantiation. LP: #1778716 Signed-off-by: Kyle Fazzari <kyrofa@ubuntu.com>
0149284
to
b2a9dac
Compare
Codecov Report
@@ Coverage Diff @@
## master #2171 +/- ##
==========================================
+ Coverage 91.31% 91.32% +<.01%
==========================================
Files 201 201
Lines 12610 12617 +7
Branches 1872 1874 +2
==========================================
+ Hits 11515 11522 +7
Misses 741 741
Partials 354 354
Continue to review full report at Codecov.
|
./runtests.sh static
?./runtests.sh unit
?Both the Catkin and Python plugins utilize the Pip class in order to clean their pull steps (specifically, they tell the Pip class to clean its packages). However, when cleaning the pull step, Python has already been removed from the installdir, which means the Pip class cannot be instantiated, causing an error about being unable to find Python.
It's reasonable to ask Pip to clean any fetched packages, and doing so doesn't require Python. This PR fixes LP: #1778716 by lazily looking for Python only when it's required instead of upon class instantiation.