diff --git a/src/python/grpcio/README.rst b/src/python/grpcio/README.rst index f047243f82d..04a3bcbc204 100644 --- a/src/python/grpcio/README.rst +++ b/src/python/grpcio/README.rst @@ -8,8 +8,8 @@ Installation gRPC Python is available for Linux, macOS, and Windows. -From PyPI -~~~~~~~~~ +Installing From PyPI +~~~~~~~~~~~~~~~~~~~~ If you are installing locally... @@ -37,8 +37,8 @@ n.b. On Windows and on Mac OS X one *must* have a recent release of :code:`pip` to retrieve the proper wheel from PyPI. Be sure to upgrade to the latest version! -From Source -~~~~~~~~~~~ +Installing From Source +~~~~~~~~~~~~~~~~~~~~~~ Building from source requires that you have the Python headers (usually a package named :code:`python-dev`). diff --git a/tools/distrib/python/grpcio_tools/README.rst b/tools/distrib/python/grpcio_tools/README.rst index 32873b291fa..17816deff61 100644 --- a/tools/distrib/python/grpcio_tools/README.rst +++ b/tools/distrib/python/grpcio_tools/README.rst @@ -9,8 +9,8 @@ Installation The gRPC Python tools package is available for Linux, Mac OS X, and Windows running Python 2.7. -From PyPI -~~~~~~~~~ +Installing From PyPI +~~~~~~~~~~~~~~~~~~~~ If you are installing locally... @@ -42,8 +42,8 @@ You might also need to install Cython to handle installation via the source distribution if gRPC Python's system coverage with wheels does not happen to include your system. -From Source -~~~~~~~~~~~ +Installing From Source +~~~~~~~~~~~~~~~~~~~~~~ Building from source requires that you have the Python headers (usually a package named :code:`python-dev`) and Cython installed. It further requires a diff --git a/tools/run_tests/artifacts/build_artifact_python.bat b/tools/run_tests/artifacts/build_artifact_python.bat index 795e80dc40d..c946cd98061 100644 --- a/tools/run_tests/artifacts/build_artifact_python.bat +++ b/tools/run_tests/artifacts/build_artifact_python.bat @@ -46,6 +46,10 @@ pushd tools\distrib\python\grpcio_tools python setup.py bdist_wheel || goto :error popd +@rem Ensure the generate artifacts are valid. +python -m pip install twine +python -m twine check dist\* tools\distrib\python\grpcio_tools\dist\* || goto :error + xcopy /Y /I /S dist\* %ARTIFACT_DIR% || goto :error xcopy /Y /I /S tools\distrib\python\grpcio_tools\dist\* %ARTIFACT_DIR% || goto :error diff --git a/tools/run_tests/artifacts/build_artifact_python.sh b/tools/run_tests/artifacts/build_artifact_python.sh index e451ced338f..c5e380fe5dc 100755 --- a/tools/run_tests/artifacts/build_artifact_python.sh +++ b/tools/run_tests/artifacts/build_artifact_python.sh @@ -130,5 +130,11 @@ then cp -r src/python/grpcio_status/dist/* "$ARTIFACT_DIR" fi +# Ensure the generated artifacts are valid. +"${PYTHON}" -m virtualenv venv || { "${PYTHON}" -m pip install virtualenv && "${PYTHON}" -m virtualenv venv; } +venv/bin/python -m pip install twine +venv/bin/python -m twine check dist/* tools/distrib/python/grpcio_tools/dist/* +rm -rf venv/ + cp -r dist/* "$ARTIFACT_DIR" cp -r tools/distrib/python/grpcio_tools/dist/* "$ARTIFACT_DIR"