mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-10-18 12:01:26 +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:
1 parent
33ecb68603
commit
470ea31ccd
9 files changed
+51
-49
No files matched your search
@@ -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