Skip to content

Commit

Permalink
Fix macos
Browse files Browse the repository at this point in the history
  • Loading branch information
XuanWang-Amos committed Feb 27, 2024
1 parent 7ed32d5 commit ec550e2
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions tools/run_tests/artifacts/build_artifact_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,10 @@ then
"${PYTHON}" -m virtualenv venv || { "${PYTHON}" -m pip install virtualenv==20.0.23 && "${PYTHON}" -m virtualenv venv; }
# Ensure the generated artifacts are valid using "twine check"
venv/bin/python -m pip install "twine<=2.0" "readme_renderer<40.0"
venv/bin/python -m twine check dist/* tools/distrib/python/grpcio_tools/dist/* src/python/grpcio_observability/dist/*
venv/bin/python -m twine check dist/* tools/distrib/python/grpcio_tools/dist/*
if [ "$GRPC_BUILD_MAC" == "" ]; then
venv/bin/python -m twine check src/python/grpcio_observability/dist/*
fi
rm -rf venv/
fi

Expand Down Expand Up @@ -212,22 +215,30 @@ then
"${AUDITWHEEL}" repair "$wheel" --strip --wheel-dir "$ARTIFACT_DIR"
rm "$wheel"
done
for wheel in src/python/grpcio_observability/dist/*.whl; do
"${AUDITWHEEL}" show "$wheel" | tee /dev/stderr | grep -E -w "$AUDITWHEEL_PLAT"
"${AUDITWHEEL}" repair "$wheel" --strip --wheel-dir "$ARTIFACT_DIR"
rm "$wheel"
done
else
cp -r dist/*.whl "$ARTIFACT_DIR"
cp -r tools/distrib/python/grpcio_tools/dist/*.whl "$ARTIFACT_DIR"
cp -r src/python/grpcio_observability/dist/*.whl "$ARTIFACT_DIR"
fi

# grpcio, grpcio-tools and grpcio-observability have already been copied to artifact_dir
# grpcio and grpcio-tools have already been copied to artifact_dir
# by "auditwheel repair", now copy the .tar.gz source archives as well.
cp -r dist/*.tar.gz "$ARTIFACT_DIR"
cp -r tools/distrib/python/grpcio_tools/dist/*.tar.gz "$ARTIFACT_DIR"
cp -r src/python/grpcio_observability/dist/*.tar.gz "$ARTIFACT_DIR"


if [ "$GRPC_BUILD_MAC" == "" ]; then
if [ "$GRPC_RUN_AUDITWHEEL_REPAIR" != "" ]
then
for wheel in src/python/grpcio_observability/dist/*.whl; do
"${AUDITWHEEL}" show "$wheel" | tee /dev/stderr | grep -E -w "$AUDITWHEEL_PLAT"
"${AUDITWHEEL}" repair "$wheel" --strip --wheel-dir "$ARTIFACT_DIR"
rm "$wheel"
done
else
cp -r src/python/grpcio_observability/dist/*.whl "$ARTIFACT_DIR"
fi
cp -r src/python/grpcio_observability/dist/*.tar.gz "$ARTIFACT_DIR"
fi

# We need to use the built grpcio-tools/grpcio to compile the health proto
# Wheels are not supported by setup_requires/dependency_links, so we
Expand Down

0 comments on commit ec550e2

Please sign in to comment.