-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
health/pythonx: handle "pip upgrade failure" #9468
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
Conversation
2a9c281
to
d7b3ac0
Compare
This comment has been minimized.
This comment has been minimized.
And now I did the proper thing.... (thanks jamessan)
|
51c2ac9
to
75593e6
Compare
@mhinz |
\ . pip ." install pynvim\n" | ||
\ . pip ." install neovim # only if needed by third-party software") | ||
endif | ||
else |
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.
@mhinz
This code does not handle using a host var properly: python_exe
might be empty (e.g. because "check_bin" rejects it, #11047), and then this code will use it as-is (without extra checks being done for python_exe
), resulting in a false positive.
This could be fixed by using provider#pythonx#CheckForModule(exe, a:module, a:major_version)
directly when "python_exe" comes via the host var. (but it needs to be re-retrieved from there then; likely a helper var might be usedful, since the from-host-var-check is done several times)
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, please go for it. You seem to be more into that code right 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.
Maybe this whole help-with-pip-upgrade check should be removed?
At least it should maybe also use "python -m pip" style instead of "pip", especially when it comes to issues it tries to report, where pip in PATH might be different from python.
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.
Well, we certainly won't need that check forever, but we added it because a lot of people had that issue when neovim
was renamed to pynvim
: https://github.com/neovim/neovim/wiki/Following-HEAD#20181118
It's up to @justinmk to decide when to remove it again. :]
As for pip
vs. python -m pip
: I don't even know the effective difference without looking it up, so.. yeah, I'd rather care about the Ruby side.
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.
At least it should maybe also use "python -m pip" style instead of "pip",
+1
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.
@justinmk
Cool.
But given that the upgrade migration period is over by now already, do you think we should rather drop this check, instead of fixing it for two different issues?
(it also simplifies code!)
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.
Is it over? Some people still use nvim 0.1.7, this stuff takes years.
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.
I've meant the transition to the new Python/pip package name.
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.
Yes, my point is that it's likely there are still many people who haven't upgraded their python packages.
The first 2 commits are purely for cleanup. More of that will come in follow-up PRs, since the current state of
s:check_python()
is an unreadable mess.The important commit is the one that handles the pip upgrade failure.