From 2ce92ab7c5ef0aa41857f3387620679877c4a8d4 Mon Sep 17 00:00:00 2001 From: bot-of-gabrieldemarmiesse <47452237+bot-of-gabrieldemarmiesse@users.noreply.github.com> Date: Sat, 22 Feb 2020 15:55:24 +0100 Subject: [PATCH] Fix label of macos version in wheels (#1124) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- build_deps/build_pip_pkg.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/build_deps/build_pip_pkg.sh b/build_deps/build_pip_pkg.sh index 481d06c37c..5c619a0b6b 100755 --- a/build_deps/build_pip_pkg.sh +++ b/build_deps/build_pip_pkg.sh @@ -23,6 +23,10 @@ function is_windows() { [[ "${PLATFORM}" =~ msys_nt*|mingw*|cygwin*|uwin* ]] } +function is_macos() { + [[ "${PLATFORM}" == "darwin" ]] +} + if is_windows; then PIP_FILE_PREFIX="bazel-bin/build_pip_pkg.exe.runfiles/__main__/" else @@ -37,7 +41,7 @@ function abspath() { function main() { DEST=${1} - BUILD_FLAG=${2} + NIGHTLY_FLAG=${2} if [[ -z ${DEST} ]]; then echo "No destination dir provided" @@ -77,11 +81,17 @@ function main() { pushd ${TMPDIR} echo $(date) : "=== Building wheel" - if [[ -z ${BUILD_FLAG} ]]; then + + BUILD_CMD="setup.py bdist_wheel" + if is_macos; then + BUILD_CMD="${BUILD_CMD} --plat-name macosx_10_13_x86_64" + fi + + if [[ -z ${NIGHTLY_FLAG} ]]; then # Windows has issues with locking library files for deletion so do not fail here - ${_PYTHON_BINARY} setup.py bdist_wheel || true + ${_PYTHON_BINARY} ${BUILD_CMD} || true else - ${_PYTHON_BINARY} setup.py bdist_wheel "${2}" || true + ${_PYTHON_BINARY} ${BUILD_CMD} ${NIGHTLY_FLAG} || true fi cp dist/*.whl "${DEST}"