Skip to content

Python 3 support? #1406

@joshburkart

Description

@joshburkart

Here's my BUILD file:

py_library(
    name="basis",
    srcs=["basis.py"],
    srcs_version="PY3ONLY",
)

py_test(
    name="basis_test",
    srcs=["basis_test.py"],
    deps=[
        ":basis",
    ],
    srcs_version="PY3ONLY",
)

Unfortunately, when I execute bazel test basis_test, I get

ERROR: /blah/BUILD:7:1: in py_test rule //blah:basis_test: Rule '//blah:basis_test' can only be used with Python 3, and cannot be converted to Python 2.
ERROR: Analysis of target '//blah:basis_test' failed; build aborted.
INFO: Elapsed time: 1.560s
ERROR: Couldn't start the build. Unable to run tests.

Is there an easy workaround? I have Python 3 installed and all. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions