[
https://issues.apache.org/jira/browse/BEAM-6665?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16767516#comment-16767516
]
Valentyn Tymofieiev commented on BEAM-6665:
-------------------------------------------
Looking at gen_protos code, futurization of protobufs happens both on Python
2 and Python 3 versions, and in successful scenario it does.
I encountered a corner case where protocol bufferes were generated, but
futurization failed due to a pip error. The next time I re-ran sdist, the
gen_protos did not re-generate protocol buffers because they were already
generated, and futurization codepath was not exercised:
https://github.com/apache/beam/blob/d6dc3602c808ce1961f46098deb898e5c7480ad4/sdks/python/gen_protos.py#L76
> SDK source tarball is different when created on Python 2 and Python 3
> ---------------------------------------------------------------------
>
> Key: BEAM-6665
> URL: https://issues.apache.org/jira/browse/BEAM-6665
> Project: Beam
> Issue Type: Sub-task
> Components: sdk-py-core
> Reporter: Valentyn Tymofieiev
> Priority: Blocker
> Fix For: 2.11.0
>
>
> When we create a source tarball via `python setup.py sdist` on Python 2, the
> generated protocol buffer code includes relative imports.
> Because of that, a tarball created on Python 2 interpreter cannot be used on
> Python 3.
> AFAIK, we release only one source tarball to PyPi, so if possible we should
> make source distribution of Beam compatible both with Python 2 and Python 3.
> When we create a source tarball on Python 3, we call futurize on generated
> _.pb2.py files[1]. Looks like this does not happen on Python 2, which we can
> fix in this issue.
> [1]
> [[https://github.com/apache/beam/blob/d6dc3602c808ce1961f46098deb898e5c7480ad4/sdks/python/gen_protos.py#L122]
> cc [~altay], [[email protected]], [~RobbeSneyders]
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)