mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-03-16 03:24:54 +08:00
Use relax_strict_optional_primitives on protobuf generated code (#7038)
Per the suggestion in https://github.com/dropbox/mypy-protobuf/issues/344 This generates more permissive constructors (which protobuf itself actually accepts). Philosophically, I think it makes sense for the generated code hosted on typeshed to be most permissive, while the generated code of individual projects can make individual decisions (defaulting to less permissive).
This commit is contained in:
@@ -69,7 +69,7 @@ PROTO_FILES=$(grep "generate_proto.*google" $PYTHON_PROTOBUF_DIR/python/setup.py
|
||||
)
|
||||
|
||||
# And regenerate!
|
||||
protoc_install/bin/protoc --proto_path="$PYTHON_PROTOBUF_DIR/src" --mypy_out="$REPO_ROOT/stubs/protobuf" $PROTO_FILES
|
||||
protoc_install/bin/protoc --proto_path="$PYTHON_PROTOBUF_DIR/src" --mypy_out="relax_strict_optional_primitives:$REPO_ROOT/stubs/protobuf" $PROTO_FILES
|
||||
|
||||
isort "$REPO_ROOT/stubs/protobuf"
|
||||
black "$REPO_ROOT/stubs/protobuf"
|
||||
|
||||
Reference in New Issue
Block a user