types-protobuf: Bump the rev of protobuf supported to 4.21.8 (#8937)

This commit is contained in:
Nipunn Koorapati
2022-10-20 15:23:53 -07:00
committed by GitHub
parent 918f2266da
commit bcad078264
3 changed files with 11 additions and 12 deletions

View File

@@ -11,7 +11,8 @@ set -ex -o pipefail
# followed by committing the changes to typeshed
#
# Update these two variables when rerunning script
PROTOBUF_VERSION=3.20.1
PROTOBUF_VERSION=21.8
PYTHON_PROTOBUF_VERSION=4.21.8
MYPY_PROTOBUF_VERSION=v3.3.0
if uname -a | grep Darwin; then
@@ -22,7 +23,7 @@ else
fi
REPO_ROOT="$(realpath "$(dirname "${BASH_SOURCE[0]}")"/..)"
TMP_DIR="$(mktemp -d)"
PYTHON_PROTOBUF_FILENAME="protobuf-python-${PROTOBUF_VERSION}.zip"
PYTHON_PROTOBUF_FILENAME="protobuf-python-${PYTHON_PROTOBUF_VERSION}.zip"
PROTOC_FILENAME="protoc-${PROTOBUF_VERSION}-${PLAT}-x86_64.zip"
PROTOC_URL="https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/$PROTOC_FILENAME"
PYTHON_PROTOBUF_URL="https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/$PYTHON_PROTOBUF_FILENAME"
@@ -38,7 +39,7 @@ unzip "$PROTOC_FILENAME" -d protoc_install
# Fetch protoc-python (which contains all the .proto files)
wget "$PYTHON_PROTOBUF_URL"
unzip "$PYTHON_PROTOBUF_FILENAME"
PYTHON_PROTOBUF_DIR="protobuf-$PROTOBUF_VERSION"
PYTHON_PROTOBUF_DIR="protobuf-$PYTHON_PROTOBUF_VERSION"
# Prepare virtualenv
VENV=venv
@@ -76,4 +77,4 @@ isort "$REPO_ROOT/stubs/protobuf"
black "$REPO_ROOT/stubs/protobuf"
sed -i "" "s/mypy-protobuf [^\"]*/mypy-protobuf ${MYPY_PROTOBUF_VERSION}/" "$REPO_ROOT/stubs/protobuf/METADATA.toml"
sed -i "" "s/version = .*$/version = \"$(echo ${PROTOBUF_VERSION} | cut -d. -f1-2)\.\*\"/" "$REPO_ROOT/stubs/protobuf/METADATA.toml"
sed -i "" "s/version = .*$/version = \"$(echo ${PYTHON_PROTOBUF_VERSION} | cut -d. -f1-2)\.\*\"/" "$REPO_ROOT/stubs/protobuf/METADATA.toml"