Skip to content

[Backport r0.8] Fix label of macos version in wheels #1124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions build_deps/build_pip_pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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}"
Expand Down