#NEWLINE# def __init__( self , address = None , payload = None , sources = None , resources = None , resource_targets = None , provides = None , compatibility = None , **kwargs ) : #NEWLINE# #INDENT# '\n    :param dependencies: Other targets that this target depends on.\n      These dependencies may\n      be ``python_library``-like targets (``python_library``,\n      ``python_thrift_library``, ``python_antlr_library`` and so forth) or\n      ``python_requirement_library`` targets.\n    :type dependencies: List of target specs\n    :param sources: Files to "include". Paths are relative to the\n      BUILD file\'s directory.\n    :type sources: ``Fileset`` or list of strings\n    :param resources: non-Python resources, e.g. templates, keys, other data\n      (it is\n      recommended that your application uses the pkgutil package to access these\n      resources in a .zip-module friendly way.)\n    :param provides:\n      The `setup_py <#setup_py>`_ to publish that represents this\n      target outside the repo.\n    :param compatibility: either a string or list of strings that represents\n      interpreter compatibility for this target, using the Requirement-style\n      format, e.g. ``\'CPython>=3\', or just [\'>=2.7\',\'<3\']`` for requirements\n      agnostic to interpreter class.\n    ' #NEWLINE# self . address = address #NEWLINE# payload = ( payload or Payload ( ) ) #NEWLINE# payload . add_fields ( { #NEWLINE# #INDENT# 'sources' : self . create_sources_field ( sources , address . spec_path , key_arg = 'sources' ) , #NEWLINE# 'resources' : self . create_sources_field ( resources , address . spec_path , key_arg = 'resources' ) , #NEWLINE# 'provides' : provides , #NEWLINE# 'compatibility' : PrimitiveField ( maybe_list ( ( compatibility or ( ) ) ) ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# super ( PythonTarget , self ) . __init__ ( address = address , payload = payload , ** kwargs ) #NEWLINE# self . _resource_target_specs = resource_targets #NEWLINE# self . add_labels ( 'python' ) #NEWLINE# if ( provides and ( not isinstance ( provides , PythonArtifact ) ) ) : #NEWLINE# #INDENT# raise TargetDefinitionException ( self , "Target must provide a valid pants setup_py object. Received a '{}' object instead." . format ( provides . __class__ . __name__ ) ) #NEWLINE# #UNINDENT# self . _provides = provides #NEWLINE# for req in self . payload . compatibility : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# PythonIdentity . parse_requirement ( req ) #NEWLINE# #UNINDENT# except ValueError as e : #NEWLINE# #INDENT# raise TargetDefinitionException ( resources , str ( e ) )