class_docstr: A C/C++ extension that is defined as a Bazel BUILD target.
class_docstr_tok: ["A","C\/C++","extension","that","is","defined","as","a","Bazel","BUILD","target","."]
code: def __init__(self, bazel_target, target_name=""):
      self.bazel_target = bazel_target
      self.relpath, self.target_name = posixpath.relpath(
          bazel_target, "//"
      ).split(":")
      if target_name:
          self.target_name = target_name
      ext_name = os.path.join(
          self.relpath.replace(posixpath.sep, os.path.sep),
          self.target_name,
      )
      setuptools.Extension.__init__(self, ext_name, sources=[])
  
imports: import glob
  import os
  import platform
  import posixpath
  import re
  import shlex
  import shutil
  import subprocess
  import sys
  import setuptools
  from setuptools.command import build_ext
  from setuptools.command import build_py
  from setuptools.command import install
label_desc: Use image node_id 1 to create a new BazelExtension object from inherited base classes: setuptools with example: obj = BazelExtension(bazel_target, target_name)