"git@developer.sourcefind.cn:tianlh/lightgbm-dcu.git" did not exist on "920bd5acbf207f8d67e08b41def900fb3d6f4861"
Unverified Commit 5fe84f8f authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[python-package] make it possible to build wheels without internet connection (fixes #5979) (#6042)

parent c60bc739
...@@ -48,6 +48,9 @@ ...@@ -48,6 +48,9 @@
# Compile with MinGW. # Compile with MinGW.
# --mpi # --mpi
# Compile MPI version. # Compile MPI version.
# --no-isolation
# Assume all build and install dependencies are already installed,
# don't go to the internet to get them.
# --nomp # --nomp
# Compile version without OpenMP support. # Compile version without OpenMP support.
# --precompile # --precompile
...@@ -159,6 +162,10 @@ while [ $# -gt 0 ]; do ...@@ -159,6 +162,10 @@ while [ $# -gt 0 ]; do
--mpi) --mpi)
BUILD_ARGS="${BUILD_ARGS} --config-setting=cmake.define.USE_MPI=ON" BUILD_ARGS="${BUILD_ARGS} --config-setting=cmake.define.USE_MPI=ON"
;; ;;
--no-isolation)
BUILD_ARGS="${BUILD_ARGS} --no-isolation"
PIP_INSTALL_ARGS="${PIP_INSTALL_ARGS} --no-build-isolation"
;;
--nomp) --nomp)
BUILD_ARGS="${BUILD_ARGS} --config-setting=cmake.define.USE_OPENMP=OFF" BUILD_ARGS="${BUILD_ARGS} --config-setting=cmake.define.USE_OPENMP=OFF"
;; ;;
...@@ -337,6 +344,7 @@ if test "${BUILD_SDIST}" = true; then ...@@ -337,6 +344,7 @@ if test "${BUILD_SDIST}" = true; then
python -m build \ python -m build \
--sdist \ --sdist \
--outdir ../dist \ --outdir ../dist \
${BUILD_ARGS} \
. .
fi fi
......
...@@ -256,7 +256,14 @@ If you get any errors during installation or due to any other reasons, you may w ...@@ -256,7 +256,14 @@ If you get any errors during installation or due to any other reasons, you may w
Build Wheel File Build Wheel File
**************** ****************
You can use ``sh ./build-python.sh install bdist_wheel`` instead of ``sh ./build-python.sh install`` to build wheel file and use it for installation later. This might be useful for systems with restricted or completely without network access. You can use ``sh ./build-python.sh install bdist_wheel`` to build a wheel file but not install it.
That script requires some dependencies like ``build``, ``scikit-build-core``, and ``wheel``.
In environments with restricted or no internt access, install those tools and then pass ``--no-isolation``.
.. code:: sh
sh ./build-pythoon.sh bdist_wheel --no-isolation
Build With MSBuild Build With MSBuild
****************** ******************
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment