[ci] ask pip to always install local artifact but not download package from PyPI#6574
[ci] ask pip to always install local artifact but not download package from PyPI#6574
Conversation
| # 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.
--ignore-installed was added in #6526 for the following reason:
It also proposes remove the
pip uninstall lightgbmin that script with passing--ignore-installedtopip 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.
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.
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:
Never thought about how build-python.sh here could be in need of similar changes.
Thanks very much!!
|
This pull request has been automatically locked since there has not been any recent activity since it was closed. |
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-isolationflag because pip needssetuptoolsduring installation:So I found that being more precise with
*.tar.gz/*.whlextension is enough to prevent pip from downloading wheel file from PyPI.