Doc updates, refactor code layout, python package

This commit is contained in:
Daniel G. Taylor
2019-10-18 21:07:12 -07:00
parent 811b54cabb
commit 7fe64ad8fe
9 changed files with 270 additions and 22 deletions

View File

@@ -1,7 +1,12 @@
#!/usr/bin/env python
import os
# Force pure-python implementation instead of C++, otherwise imports
# break things because we can't properly reset the symbol database.
os.environ["PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION"] = "python"
import importlib
import json
import os # isort: skip
import subprocess
import sys
from typing import Generator, Tuple
@@ -10,12 +15,6 @@ from google.protobuf import symbol_database
from google.protobuf.descriptor_pool import DescriptorPool
from google.protobuf.json_format import MessageToJson, Parse
# Force pure-python implementation instead of C++, otherwise imports
# break things because we can't properly reset the symbol database.
os.environ["PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION"] = "python"
root = os.path.dirname(os.path.realpath(__file__))
@@ -55,7 +54,7 @@ if __name__ == "__main__":
f"protoc --python_out=. {os.path.basename(filename)}", shell=True
)
subprocess.run(
f"protoc --plugin=protoc-gen-custom=../../protoc-gen-betterpy.py --custom_out=. {os.path.basename(filename)}",
f"protoc --plugin=protoc-gen-custom=../plugin.py --custom_out=. {os.path.basename(filename)}",
shell=True,
)