Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-1251 Python 3 Support
  3. BEAM-6665

SDK source tarball is different when created on Python 2 and Python 3

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.11.0
    • Component/s: sdk-py-core
    • Labels:
      None

      Description

      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 Ahmet Altay, Charles Chen, Robbe

        Attachments

          Activity

            People

            • Assignee:
              tvalentyn Valentyn Tymofieiev
              Reporter:
              tvalentyn Valentyn Tymofieiev
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: