Python 3.x 使用Python3运行Bazel(语法错误)

Python 3.x 使用Python3运行Bazel(语法错误),python-3.x,bazel,Python 3.x,Bazel,我正在尝试使用Bazel:运行此代码。这是相关的Bazel构建文件(我添加了相应的Bazel python规则,包括“py_运行时”解释器路径、“默认_python_版本”和“srcs_版本”(如果适用)): 我还编辑了存储库“models”文件夹中的第二个构建文件: package(default_visibility = ["//visibility:public"]) py_runtime( name="python-3.5.2", files=[], inter

我正在尝试使用Bazel:运行此代码。这是相关的Bazel构建文件(我添加了相应的Bazel python规则,包括“py_运行时”解释器路径、“默认_python_版本”和“srcs_版本”(如果适用)):

我还编辑了存储库“models”文件夹中的第二个构建文件:

package(default_visibility = ["//visibility:public"])

py_runtime(
    name="python-3.5.2",
    files=[],
    interpreter_path="/usr/bin/python3.5"
)

py_library(
    name = "model_util",
    srcs = ["model_util.py"],
    deps = [
        "//isl:tensorcheck",
        "//isl:util",
    ],
    srcs_version="PY3",
)

py_library(
    name = "fovea",
    srcs = ["fovea.py"],
    deps = [
        ":model_util",
        "//isl:tensorcheck",
        "//isl:util",
    ],
    srcs_version="PY3",
)

py_library(
    name = "concordance",
    srcs = ["concordance.py"],
    deps = [
        ":model_util",
        "//isl:tensorcheck",
        "//isl:util",
    ],
    srcs_version="PY3",
)

py_test(
    name = "model_test",
    size = "large",
    srcs = ["model_test.py"],
    deps = [
        ":fovea",
        ":model_util",
        "//isl:controller",
        "//isl:test_util",
    ],
    default_python_version="PY3",
    srcs_version="PY3",
)
但是,通过Bazel运行程序时出现以下错误:

bazel run isl:launch -- \ --alsologtostderr \ --base_directory $BASE_DIRECTORY \ --mode EVAL_EVAL \ --metric INFER_FULL \ --stitch_crop_size 150 \ restore_directory $/data1/adamw/insilico_labeling/checkpoints \ read_pngs \ dataset_eval_directory $/data1/adamw/insilico_labeling/data_sample/condition_b_sample \ infer_channel_whitelist DAPI_CONFOCAL,MAP2_CONFOCAL,NFH_CONFOCAL
INFO: Analysed target //isl:launch (1 packages loaded).
INFO: Found 1 target...
Target //isl:launch up-to-date:
  bazel-out/k8-py3-fastbuild/bin/isl/launch
INFO: Elapsed time: 0.318s, Critical Path: 0.00s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-out/k8-py3-fastbuild/bin/isl/launch ' --alsologtostderr' ' --base_directory' ' --mode' EVAL_EVAL ' --metric' INFER_FULL ' --stitch_crop_size' 150 ' restore_directory' '$/data1/adamw/insilico_labeling/checkpoints' ' read_pngs' ' dataset_eval_directory' '$/data1/adamw/insilico_labeling/data_sample/condition_b_sample' ' infer_cINFO: Build completed successfully, 1 total action
  File "/home/adam/.cache/bazel/_bazel_adam/3c24d2105da2efbf30d96eb3fd97126b/execroot/__main__/bazel-out/k8-py3-fastbuild/bin/isl/launch.runfiles/__main__/isl/launch.py", line 199
    def get_z_values() -> List[float]:
                       ^
SyntaxError: invalid syntax
生成文件或命令行中是否缺少某些内容?我已经看到“-force_python”可能会被弃用,但还没有尝试将其与python规则结合使用

bazel run isl:launch -- \ --alsologtostderr \ --base_directory $BASE_DIRECTORY \ --mode EVAL_EVAL \ --metric INFER_FULL \ --stitch_crop_size 150 \ restore_directory $/data1/adamw/insilico_labeling/checkpoints \ read_pngs \ dataset_eval_directory $/data1/adamw/insilico_labeling/data_sample/condition_b_sample \ infer_channel_whitelist DAPI_CONFOCAL,MAP2_CONFOCAL,NFH_CONFOCAL
INFO: Analysed target //isl:launch (1 packages loaded).
INFO: Found 1 target...
Target //isl:launch up-to-date:
  bazel-out/k8-py3-fastbuild/bin/isl/launch
INFO: Elapsed time: 0.318s, Critical Path: 0.00s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-out/k8-py3-fastbuild/bin/isl/launch ' --alsologtostderr' ' --base_directory' ' --mode' EVAL_EVAL ' --metric' INFER_FULL ' --stitch_crop_size' 150 ' restore_directory' '$/data1/adamw/insilico_labeling/checkpoints' ' read_pngs' ' dataset_eval_directory' '$/data1/adamw/insilico_labeling/data_sample/condition_b_sample' ' infer_cINFO: Build completed successfully, 1 total action
  File "/home/adam/.cache/bazel/_bazel_adam/3c24d2105da2efbf30d96eb3fd97126b/execroot/__main__/bazel-out/k8-py3-fastbuild/bin/isl/launch.runfiles/__main__/isl/launch.py", line 199
    def get_z_values() -> List[float]:
                       ^
SyntaxError: invalid syntax