Fixed Python release script to upload using twine instead of distutils. (#7571)

pull/7580/head
Joshua Haberman 5 years ago committed by GitHub
parent 678da4f76e
commit 0ff639994d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      python/release.sh

@ -80,14 +80,16 @@ python setup.py build
python setup.py test
# Deploy source package to testing PyPI
python setup.py sdist upload -r https://test.pypi.org/legacy/
python setup.py sdist
twine upload --skip-existing -r testpypi -u protobuf-wheel-test dist/*
# Test locally with different python versions.
run_install_test ${TESTING_VERSION} python2.7 https://test.pypi.org/simple
run_install_test ${TESTING_VERSION} python3 https://test.pypi.org/simple
# Deploy egg/wheel packages to testing PyPI and test again.
python setup.py bdist_egg bdist_wheel upload -r https://test.pypi.org/legacy/
python setup.py clean build bdist_wheel
twine upload --skip-existing -r testpypi -u protobuf-wheel-test dist/*
run_install_test ${TESTING_VERSION} python2.7 https://test.pypi.org/simple
run_install_test ${TESTING_VERSION} python3 https://test.pypi.org/simple
@ -103,13 +105,15 @@ if [ $TESTING_ONLY -eq 0 ]; then
echo "Publishing to PyPI..."
# Be sure to run build before sdist, because otherwise sdist will not include
# well-known types.
python setup.py clean build sdist upload
python setup.py clean build sdist
twine upload --skip-existing -u protobuf-packages dist/*
# Be sure to run clean before bdist_xxx, because otherwise bdist_xxx will
# include files you may not want in the package. E.g., if you have built
# and tested with --cpp_implemenation, bdist_xxx will include the _message.so
# file even when you no longer pass the --cpp_implemenation flag. See:
# https://github.com/protocolbuffers/protobuf/issues/3042
python setup.py clean build bdist_egg bdist_wheel upload
python setup.py clean build bdist_wheel
twine upload --skip-existing -u protobuf-packages dist/*
else
# Set the version number back (i.e., remove dev suffix).
sed -i -r "s/__version__ = '.*'/__version__ = '${VERSION}'/" google/protobuf/__init__.py

Loading…
Cancel
Save