You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/01/19 17:50:01 UTC

[jira] [Commented] (BEAM-3142) Fix proto generation in Python 3

    [ https://issues.apache.org/jira/browse/BEAM-3142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16332633#comment-16332633 ] 

ASF GitHub Bot commented on BEAM-3142:
--------------------------------------

aaltay closed pull request #4077: [BEAM-3142] Apply futurize on gen_protos
URL: https://github.com/apache/beam/pull/4077
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/sdks/python/gen_protos.py b/sdks/python/gen_protos.py
index f5aa0993ef5..aa7c093a510 100644
--- a/sdks/python/gen_protos.py
+++ b/sdks/python/gen_protos.py
@@ -112,6 +112,15 @@ def generate_proto_files(force=False):
             '%s' % ret_code)
 
 
+    if sys.version_info[0] >= 3:
+      ret_code = subprocess.call(
+        ["futurize", "--both-stages", "--write", "--verbose", "--no-diff", out_dir])
+
+      if ret_code:
+        raise RuntimeError(
+          'Error applying futurize to generated protobuf python files.')
+
+
 # Though wheels are available for grpcio-tools, setup_requires uses
 # easy_install which doesn't understand them.  This means that it is
 # compiled from scratch (which is expensive as it compiles the full


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Fix proto generation in Python 3
> --------------------------------
>
>                 Key: BEAM-3142
>                 URL: https://issues.apache.org/jira/browse/BEAM-3142
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-py-core
>            Reporter: holdenk
>            Priority: Major
>
> The generated Python code uses relative imports, fix this to be usable in Python 3.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)