From 1d4b02e5e23e5f90995715c6f2973df9419d2e50 Mon Sep 17 00:00:00 2001 From: Yu Shi Date: Tue, 8 Aug 2023 06:15:23 +0000 Subject: [PATCH 1/5] fix build-python.sh to install locally built version --- build-python.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-python.sh b/build-python.sh index e535eeb06abc..32615188da18 100755 --- a/build-python.sh +++ b/build-python.sh @@ -359,7 +359,7 @@ if test "${INSTALL}" = true; then --force-reinstall \ --no-cache-dir \ --find-links=. \ - lightgbm + lightgbm-*.tar.gz cd ../ fi From b10bc4233f29e19b1b1d9b885cbd4fc4c4c71f0b Mon Sep 17 00:00:00 2001 From: Yu Shi Date: Tue, 8 Aug 2023 06:33:35 +0000 Subject: [PATCH 2/5] consider building approach when installation --- build-python.sh | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/build-python.sh b/build-python.sh index 32615188da18..f9eb44185622 100755 --- a/build-python.sh +++ b/build-python.sh @@ -354,12 +354,22 @@ if test "${INSTALL}" = true; then echo "--- installing lightgbm ---" # ref for use of '--find-links': https://stackoverflow.com/a/52481267/3986677 cd ../dist - pip install \ - ${PIP_INSTALL_ARGS} \ - --force-reinstall \ - --no-cache-dir \ - --find-links=. \ - lightgbm-*.tar.gz + if test "${BUILD_SDIST}" = true; then + pip install \ + ${PIP_INSTALL_ARGS} \ + --force-reinstall \ + --no-cache-dir \ + --find-links=. \ + lightgbm-*.tar.gz + fi + if test "${BUILD_WHEEL}" = true; then + pip install \ + ${PIP_INSTALL_ARGS} \ + --force-reinstall \ + --no-cache-dir \ + --find-links=. \ + lightgbm-*.whl + fi cd ../ fi From a4608b0682837d60975a5e9c18321c131964bb50 Mon Sep 17 00:00:00 2001 From: Yu Shi Date: Tue, 8 Aug 2023 09:25:56 +0000 Subject: [PATCH 3/5] simplify code --- build-python.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/build-python.sh b/build-python.sh index f9eb44185622..b295e78bc338 100755 --- a/build-python.sh +++ b/build-python.sh @@ -354,6 +354,7 @@ if test "${INSTALL}" = true; then echo "--- installing lightgbm ---" # ref for use of '--find-links': https://stackoverflow.com/a/52481267/3986677 cd ../dist +<<<<<<< Updated upstream if test "${BUILD_SDIST}" = true; then pip install \ ${PIP_INSTALL_ARGS} \ @@ -370,6 +371,20 @@ if test "${INSTALL}" = true; then --find-links=. \ lightgbm-*.whl fi +======= + LGB_VER=$(head -n 1 ../VERSION.txt) + if test "${BUILD_SDIST}" = true; then + SUFFIX="tar.gz" + elif test "${BUILD_WHEEL}" = true; then + SUFFIX="whl" + fi + pip install \ + ${PIP_INSTALL_ARGS} \ + --force-reinstall \ + --no-cache-dir \ + --find-links=. \ + lightgbm-${LGB_VER}-*.${SUFFIX} +>>>>>>> Stashed changes cd ../ fi From 51f93eb345966391fe6bc06ce9145e922b775da1 Mon Sep 17 00:00:00 2001 From: Yu Shi Date: Tue, 8 Aug 2023 09:26:48 +0000 Subject: [PATCH 4/5] resolve conflict --- build-python.sh | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/build-python.sh b/build-python.sh index b295e78bc338..03fbbb5e22f6 100755 --- a/build-python.sh +++ b/build-python.sh @@ -354,24 +354,6 @@ if test "${INSTALL}" = true; then echo "--- installing lightgbm ---" # ref for use of '--find-links': https://stackoverflow.com/a/52481267/3986677 cd ../dist -<<<<<<< Updated upstream - if test "${BUILD_SDIST}" = true; then - pip install \ - ${PIP_INSTALL_ARGS} \ - --force-reinstall \ - --no-cache-dir \ - --find-links=. \ - lightgbm-*.tar.gz - fi - if test "${BUILD_WHEEL}" = true; then - pip install \ - ${PIP_INSTALL_ARGS} \ - --force-reinstall \ - --no-cache-dir \ - --find-links=. \ - lightgbm-*.whl - fi -======= LGB_VER=$(head -n 1 ../VERSION.txt) if test "${BUILD_SDIST}" = true; then SUFFIX="tar.gz" @@ -384,7 +366,6 @@ if test "${INSTALL}" = true; then --no-cache-dir \ --find-links=. \ lightgbm-${LGB_VER}-*.${SUFFIX} ->>>>>>> Stashed changes cd ../ fi From fee388777e0cd840993b6e7c2d58a6bd05c9139f Mon Sep 17 00:00:00 2001 From: Yu Shi Date: Tue, 8 Aug 2023 09:27:37 +0000 Subject: [PATCH 5/5] fix install for sdist --- build-python.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-python.sh b/build-python.sh index 03fbbb5e22f6..77e9ab0ac950 100755 --- a/build-python.sh +++ b/build-python.sh @@ -365,7 +365,7 @@ if test "${INSTALL}" = true; then --force-reinstall \ --no-cache-dir \ --find-links=. \ - lightgbm-${LGB_VER}-*.${SUFFIX} + lightgbm-${LGB_VER}*.${SUFFIX} cd ../ fi