From 2f274443ed3ecbfa395fb3896b92d1ec8eac47b1 Mon Sep 17 00:00:00 2001 From: Lucian Carata Date: Tue, 11 Jul 2023 10:46:39 +0100 Subject: [PATCH] Fix build-wheels.sh error when copying to output path (#1286) --- hack/build-wheels.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/hack/build-wheels.sh b/hack/build-wheels.sh index 786a264fe..045d4abfb 100755 --- a/hack/build-wheels.sh +++ b/hack/build-wheels.sh @@ -15,24 +15,29 @@ fi _buildWheel() { local _srcPath=$1 local _outputPath=$2 - local _currentDir=$PWD # Poetry doesn't let us send the output to a separate folder so we'll `cd` # into the folder and them move the wheels out # https://github.com/python-poetry/poetry/issues/3586 pushd $_srcPath poetry build - cp ./dist/* $_outputPath + # Only copy files if destination is different from source + local _currentDistPath=$PWD/dist + if ! [[ "$_currentDistPath" = "$_outputPath" ]]; then + cp $_currentDistPath/* $_outputPath + fi popd } _main() { # Convert any path into an absolute path local _outputPath=$1 + mkdir -p $_outputPath if ! [[ "$_outputPath" = /* ]]; then - _outputPath="$PWD/$_outputPath" + pushd $_outputPath + _outputPath="$PWD" + popd fi - mkdir -p $_outputPath # Build MLServer echo "---> Building MLServer wheel"