-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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: rescue docarray in setup #4203
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4203 +/- ##
==========================================
+ Coverage 85.72% 86.88% +1.15%
==========================================
Files 114 114
Lines 8304 8304
==========================================
+ Hits 7119 7215 +96
+ Misses 1185 1089 -96
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Latency summaryCurrent PR yields:
Breakdown
Backed by latency-tracking. Further commits will update this comment. |
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.
Python package system is so strange, from a NodeJSer's perspective. (node_modules
is also a mess, tho )
Good hack. ; )
# as recommended by pip https://pip.pypa.io/en/latest/user_guide/#using-pip-from-your-program | ||
import subprocess | ||
|
||
subprocess.check_call( |
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.
doesnt pip have a python package? This for instance would not work on my environment becauee I use pip3.7 for instance
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.
@numb3r3 could you throw some light here? i think you did something similar in hub.uses(from_source)
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 did this specifically because Pip says so: https://pip.pypa.io/en/latest/user_guide/#using-pip-from-your-program
Usually pip
should be an alias to whatever pip version you are using, no?
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.
same method is utilized in hub.uses(...)
. [sys.executorable, '-m', 'pip']
always use the executable pip associated with the current python version you are using.
This closes #4194
Upgrading from Jina 2.x to 3.x is broken because pip will install first the new
docarray
pip package and then remove the old docarray package (which was part of jina repo). Because both are installed in the same folder, this will leave the newdocarray
package in some invalid state.This change to the setup introduces a hack to rescue those cases: My code is checking if
docarray
can be imported correctly (by checking access to the version, this fails for master now). If this failsdocarray
is reinstalled via pip.In non upgrading cases we will not enter the exception handler and my hack will not do anything (when installing jina in a new venv).