-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[ci] ask pip to always install local artifact but not download package from PyPI #6574
Conversation
@@ -362,9 +362,10 @@ if test "${INSTALL}" = true; then | |||
# ref for use of '--find-links': https://stackoverflow.com/a/52481267/3986677 | |||
pip install \ | |||
${PIP_INSTALL_ARGS} \ | |||
--ignore-installed \ |
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.
--ignore-installed
was added in #6526 for the following reason:
It also proposes remove the
pip uninstall lightgbm
in that script with passing--ignore-installed
topip install
... that way the locally-built version overwrites the already-installed one every time, without generating a log message like "WARNING: Skipping lightgbm as it is not installed."
But it seems that the right flag is --force-reinstall
for that.
--ignore-installed
may mix old and new lightgbm installations which can result in corrupted installation. Refer to the detailed explanation here: https://stackoverflow.com/a/51916623.
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.
You're right, --force-reinstall
is preferable now that we are also using --no-deps
here (#6256).
I'd previously not wanted to use it because it applies to all dependencies, not just to the package being installed, and that led to an existing numpy
or scipy
being force-reinstalled too.
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.
Thanks for this. I tested locally to be sure sh build-python.sh install --precompile
works as well, and it did.
I agree, this is an improvement! Not having the ability to silently fall back to installing from PyPI is really important for ensuring that CI tests what we think it's testing.
Funny enough, I recently worked through similar issues over in RAPIDS:
- Remove uses of 'pip --find-links' in CI rapidsai/build-planning#69
- explore 'pip --no-index' to more tightly control wheel builds rapidsai/build-planning#79
Never thought about how build-python.sh
here could be in need of similar changes.
Thanks very much!!
Initially I was trying to use the following pip flag:
https://pip.pypa.io/en/stable/cli/pip_install/#cmdoption-no-index
to prohibit pip to install LightGBM from PyPI like here:
But unfortunately that flag cannot be used without
--no-build-isolation
flag because pip needssetuptools
during installation:So I found that being more precise with
*.tar.gz
/*.whl
extension is enough to prevent pip from downloading wheel file from PyPI.