mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
Re-organize directory structure (#4971)
See discussion in #2491 Co-authored-by: Ivan Levkivskyi <ilevkivskyi@dropbox.com>
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
#!/bin/bash
|
||||
# Some of the proto .pyi stubs in third_party/2and3/google/protobuf/
|
||||
# Some of the proto .pyi stubs in stubs/protobuf/
|
||||
# are autogenerated using the mypy-protobuf project on the
|
||||
# latest `.proto` files shipped with protoc.
|
||||
#
|
||||
# When run, this script will autogenerate the _pb2.pyi stubs to
|
||||
# third_party/2and3/google/protobuf. It should be run any time there's
|
||||
# stubs/protobuf. It should be run any time there's
|
||||
# a meaningful update to either PROTOBUF_VERSION or MYPY_PROTOBUF_VERSION,
|
||||
# followed by committing the changes to typeshed
|
||||
#
|
||||
@@ -46,7 +46,7 @@ source $VENV/bin/activate
|
||||
python3 -m pip install git+https://github.com/dropbox/mypy-protobuf@${MYPY_PROTOBUF_VERSION}#subdirectory=python
|
||||
|
||||
# Remove existing pyi
|
||||
find $REPO_ROOT/third_party/2and3/ -name "*_pb2.pyi" -delete
|
||||
find $REPO_ROOT/stubs/protobuf/ -name "*_pb2.pyi" -delete
|
||||
|
||||
# Roughly reproduce the subset of .proto files on the public interface as described
|
||||
# by find_package_modules in the protobuf setup.py.
|
||||
@@ -65,4 +65,4 @@ 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/third_party/2and3 $PROTO_FILES
|
||||
protoc_install/bin/protoc --proto_path=$PYTHON_PROTOBUF_DIR/src --mypy_out=$REPO_ROOT/stubs/protobuf $PROTO_FILES
|
||||
|
||||
Reference in New Issue
Block a user