Skip to content

Python 3 support #1580

@abergmeier-dsfishlabs

Description

@abergmeier-dsfishlabs

I would like for this issue to collect all issues concerning Python 3.

As far as I know there are multiple problems:

  1. The supported values for srcs_version are PY2, PY3, PY2AND3, PY2ONLY, PY3ONLY.
    • PY3 is documented wrong. It actually handles similar to PY2, which is fine.
    • PY3ONLY is not even documented, although it mostly is what a lot of Python 3 users want.
  2. By default Bazel always executes Python 2. Which might be an ok choice for now for PY2, PY3, PY2AND3 and PY2ONLY. It is however totally wrong for PY3ONLY. (Python 3 support? #1406)
    It seems like checkSourceIsCompatible is used instead of a hypothetical selectPythonVersionForSource.
    • Question there would be why it is not using Python 3.
    • How big is Googles interest in Python 3 support on a scale of 0 (want it now) to 5 (who cares)?
    • Would anyone inside of Google be available for mentorship for extending Python 3 support?
  3. Is there a way for Bazel to use a Python version embedded into a repository?
  4. --force_python and --host_force_python are given to users, yet they are not documented.
  5. py_binary wrapper uses Python 2 although it may not even be present (python stub_template.txt shouldn't assume /usr/bin/python always exists #544)
  6. py_binary wrapper spawns a new process for executing python scripts. I do know that we are not talking about great performance with Python but that seems a bit excessive.
  7. pkg_tar seems to internally use Python2 only. Does not work with 3.
  8. Python cannot be used as a label (Make --python3_path accept a label #2244)
  9. pyd cannot be created straight-forward (#2497)
  10. Support embeddable Python for Windows (Support embeddable Python #2509)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3We're not considering working on this, but happy to review a PR. (No assignee)team-Rules-PythonNative rules for Pythontype: process

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions