asottile commented on a change in pull request #15866:
URL: https://github.com/apache/beam/pull/15866#discussion_r746244961
##########
File path: sdks/python/gen_protos.py
##########
@@ -336,11 +336,19 @@ def generate_proto_files(force=False, log=None):
for path in MODEL_RESOURCES:
shutil.copy2(os.path.join(py_sdk_root, path), out_dir)
- ret_code = subprocess.call(
- ["futurize", "--both-stages", "--write", "--no-diff", out_dir])
- if ret_code:
- raise RuntimeError(
- 'Error applying futurize to generated protobuf python files.')
+ # see: https://github.com/protocolbuffers/protobuf/issues/1491
+ # force relative import paths for proto files
+ for filename in os.listdir(out_dir):
Review comment:
futurize did not pick up `.pyi` files -- so they were broken -- but them
being broken was hidden by a separate bug: they weren't included in the
distribution -- so I fixed that too:
https://github.com/apache/beam/pull/15866/files#diff-1275c48808de339ef6f282d844c83ec441b5cfa0debc373fdcb7dba497da4fc8R282
as for recursive, I believe the protos only generated 1-deep so I don't
think it's needed?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]