Skip to content

Commit

Permalink
Fixed tests for Python 2 in python/release.sh
Browse files Browse the repository at this point in the history
Setuptools 45.0 removed support for Python 2, so to keep these tests
working for Python 2 I updated the script to install an older setuptools
version.
  • Loading branch information
acozzette committed Aug 14, 2020
1 parent 1498286 commit 2ad43bf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@ function run_install_test() {
local PYTHON=$2
local PYPI=$3

virtualenv -p `which $PYTHON` test-venv
# Setuptools 45.0 removed support for Python 2, so to test with Python 2 we
# pass --no-setuptools here and then install an older setuptools version
# below.
virtualenv -p `which $PYTHON` --no-setuptools test-venv

# Intentionally put a broken protoc in the path to make sure installation
# doesn't require protoc installed.
touch test-venv/bin/protoc
chmod +x test-venv/bin/protoc

source test-venv/bin/activate
pip install "setuptools<45"
pip install -i ${PYPI} protobuf==${VERSION} --no-cache-dir
deactivate
rm -fr test-venv
Expand Down

0 comments on commit 2ad43bf

Please sign in to comment.