message: Fix how header files are updated and ran pylint
diff: @@ -22,6 +22,9 @@ _TF_NEED_TENSORRT = "TF_NEED_TENSORRT"
  _TF_TENSORRT_LIBS = ["nvinfer", "nvinfer_plugin"]
  _TF_TENSORRT_HEADERS = ["NvInfer.h", "NvUtils.h", "NvInferPlugin.h"]
  +_TF_TENSORRT_HEADERS_V2 = ["NvInfer.h", "NvUtils.h", "NvInferPlugin.h",
  + "NvInferVersion.h", "NvInferRTSafe.h",
  + "NvInferRTExt.h", "NvInferPluginUtils.h"]
  _DEFINE_TENSORRT_SONAME_MAJOR = "#define NV_TENSORRT_SONAME_MAJOR"
  _DEFINE_TENSORRT_SONAME_MINOR = "#define NV_TENSORRT_SONAME_MINOR"
  @@ -32,18 +35,10 @@ def _at_least_version(actual_version, required_version):
  required = [int(v) for v in required_version.split(".")]
  return actual >= required
  -def _update_tensorrt_headers(tensorrt_version):
  - if not _at_least_version(tensorrt_version, "6"):
  - return
  - _TF_TENSORRT_HEADERS = [
  - "NvInferVersion.h",
  - "NvInfer.h",
  - "NvUtils.h",
  - "NvInferPlugin.h",
  - "NvInferRTSafe.h",
  - "NvInferRTExt.h",
  - "NvInferPluginUtils.h",
  - ]
  +def _get_tensorrt_headers(tensorrt_version):
  + if _at_least_version(tensorrt_version, "6"):
  + return _TF_TENSORRT_HEADERS_V2
  + return _TF_TENSORRT_HEADERS
  def _tpl(repository_ctx, tpl, substitutions):
  repository_ctx.template(
  @@ -87,11 +82,10 @@ def _tensorrt_configure_impl(repository_ctx):
  cpu_value = get_cpu_value(repository_ctx)
  # Copy the library and header files.
  - _update_tensorrt_headers(trt_version)
  libraries = [lib_name(lib, cpu_value, trt_version) for lib in _TF_TENSORRT_LIBS]
  library_dir = config["tensorrt_library_dir"] + "/"
  - headers = _TF_TENSORRT_HEADERS
  include_dir = config["tensorrt_include_dir"] + "/"
  + headers = _get_tensorrt_headers(trt_version)
  copy_rules = [
  make_copy_files_rule(
  repository_ctx,
  