Module ImportFrom alias alias alias alias alias alias alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias alias ClassDef bases NameLoad body Expr Str decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return Call NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults TupleLoad Str body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad Return Call NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults TupleLoad Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults TupleLoad Str body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Return ListComp AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad NameLoad attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults TupleLoad Str body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Lambda arguments args NameParam defaults SubscriptLoad SubscriptLoad NameLoad Index Num Index Num NameLoad Assign NameStore Call NameLoad For TupleStore NameStore NameStore NameLoad body Assign TupleStore NameStore NameStore NameLoad If UnaryOpNot CompareIn NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad ListLoad Expr Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr NameLoad Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad NameLoad Return BoolOpOr CompareIs NameLoad NameLoad CompareIn NameLoad NameLoad decorator_list Assign NameStore BoolOpOr NameLoad Lambda arguments args NameParam defaults NameLoad Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Lambda arguments args NameParam defaults SubscriptLoad NameLoad Index Num Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body For TupleStore NameStore NameStore NameLoad body Expr Yield NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults TupleLoad Str body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad For NameStore Call AttributeLoad NameLoad attr NameLoad body Expr Yield NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str For NameStore NameLoad body If Call AttributeLoad NameLoad attr NameLoad body With Call NameLoad NameLoad keyword Str NameStore body For NameStore Call AttributeLoad NameLoad attr body Expr Yield NameLoad orelse If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad decorator_list For TupleStore NameStore NameStore NameStore Call NameLoad NameLoad body For NameStore NameLoad body Expr Yield Call AttributeLoad Str attr Call NameLoad NameLoad NameLoad For NameStore NameLoad body Expr Yield Call NameLoad NameLoad NameLoad orelse Pass decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str If UnaryOpNot Call AttributeLoad NameLoad attr Str body Return NameLoad Return Call AttributeLoad SubscriptLoad NameLoad Slice UnaryOpUSub Call NameLoad Str attr Str Str decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Return BoolOpAnd Call AttributeLoad NameLoad attr TupleLoad Str Str Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad Str attr keyword Call AttributeLoad NameLoad attr NameLoad Assign NameStore ListComp NameLoad comprehension NameStore Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If BoolOpOr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore NameLoad Assign NameStore Call AttributeLoad Str attr keyword NameLoad keyword AttributeLoad NameLoad attr If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list Assign NameStore BoolOpOr NameLoad Call NameLoad Assign NameStore ListLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call NameLoad For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body If NameLoad body Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad If CompareGt Call NameLoad NameLoad Num body Assign NameStore Call NameLoad NameLoad NameLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body If Call AttributeLoad NameLoad attr NameLoad body Continue If CompareIn NameLoad NameLoad body Continue Expr Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Str attr NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Raise Call NameLoad Call AttributeLoad Str attr keyword NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad If NameLoad body Assign NameStore ListComp AttributeLoad NameLoad attr comprehension NameStore NameLoad With Call NameLoad Call AttributeLoad Str attr NameLoad Str NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Return NameLoad decorator_list NameLoad decorator_list
N/A __future__ absolute_import division generators nested_scopes print_function unicode_literals with_statement N/A itertools N/A os N/A re collections OrderedDict twitter.common.collections OrderedSet pants.backend.jvm.tasks.classpath_products ClasspathEntry pants.util.contextutil open_zip pants.util.dirutil fast_relpath safe_delete safe_open safe_walk MissingClasspathEntryError N/A Exception N/A N/A Indicates an unexpected problem finding a classpath entry. N/A ClasspathUtil N/A object N/A compute_classpath N/A N/A cls targets classpath_products extra_classpath_tuples confs N/A N/A N/A Return the list of classpath entries for a classpath covering the passed targets.

    Filters and adds paths from extra_classpath_tuples to the end of the resulting list.

    :param targets: The targets to generate a classpath for.
    :param ClasspathProducts classpath_products: Product containing classpath elements.
    :param extra_classpath_tuples: Additional classpath entries.
    :param confs: The list of confs for use by this classpath.
    :returns: The classpath as a list of path elements.
    :rtype: list of string
     N/A classpath_iter N/A N/A cls _classpath_iter targets classpath_products confs confs N/A total_classpath N/A OrderedSet classpath_iter N/A filtered_extra_classpath_iter N/A N/A cls _filtered_classpath_by_confs_iter extra_classpath_tuples confs N/A extra_classpath_iter N/A N/A cls _entries_iter filtered_extra_classpath_iter N/A N/A N/A total_classpath update extra_classpath_iter N/A N/A list total_classpath N/A classmethod classpath N/A N/A cls targets classpath_products confs N/A N/A default N/A N/A Return the classpath as a list of paths covering all the passed targets.

    :param targets: Targets to build an aggregated classpath for.
    :param ClasspathProducts classpath_products: Product containing classpath elements.
    :param confs: The list of confs for use by this classpath.
    :returns: The classpath as a list of path elements.
    :rtype: list of string
     N/A classpath_iter N/A N/A cls _classpath_iter targets classpath_products confs confs N/A N/A list classpath_iter N/A classmethod _classpath_iter N/A N/A cls targets classpath_products confs N/A N/A default N/A N/A classpath_tuples N/A N/A classpath_products get_for_targets targets N/A filtered_tuples_iter N/A N/A cls _filtered_classpath_by_confs_iter classpath_tuples confs N/A N/A N/A cls _entries_iter filtered_tuples_iter N/A classmethod internal_classpath N/A N/A cls targets classpath_products confs N/A N/A default N/A N/A Return the list of internal classpath entries for a classpath covering all `targets`.

    Any classpath entries contributed by external dependencies will be omitted.

    :param targets: Targets to build an aggregated classpath for.
    :param ClasspathProducts classpath_products: Product containing classpath elements.
    :param confs: The list of confs for use by this classpath.
    :returns: The classpath as a list of path elements.
    :rtype: list of string
     N/A classpath_tuples N/A N/A classpath_products get_internal_classpath_entries_for_targets targets N/A filtered_tuples_iter N/A N/A cls _filtered_classpath_by_confs_iter classpath_tuples confs N/A N/A N/A entry path N/A entry N/A N/A cls _entries_iter filtered_tuples_iter N/A classmethod classpath_by_targets N/A N/A cls targets classpath_products confs N/A N/A default N/A N/A Return classpath entries grouped by their targets for the given `targets`.

    :param targets: The targets to lookup classpath products for.
    :param ClasspathProducts classpath_products: Product containing classpath elements.
    :param confs: The list of confs for use by this classpath.
    :returns: The ordered (target, classpath) mappings.
    :rtype: OrderedDict
     N/A classpath_target_tuples N/A N/A classpath_products get_product_target_mappings_for_targets targets N/A filtered_items_iter N/A N/A itertools ifilter N/A N/A cls _accept_conf_filter confs N/A N/A N/A x N/A N/A N/A x N/A 0 N/A 0 classpath_target_tuples N/A target_to_classpath N/A OrderedDict N/A N/A classpath_entry target filtered_items_iter N/A N/A N/A _ entry classpath_entry N/A N/A N/A target target_to_classpath N/A N/A N/A target_to_classpath N/A target N/A N/A N/A N/A N/A target_to_classpath N/A target append entry N/A target_to_classpath N/A classmethod _accept_conf_filter N/A N/A cls confs unpack_func N/A None N/A accept_conf_in_item N/A N/A item N/A N/A N/A conf N/A unpack_func item N/A N/A N/A confs None N/A conf confs N/A N/A unpack_func N/A unpack_func N/A N/A N/A x N/A x N/A accept_conf_in_item N/A classmethod _filtered_classpath_by_confs_iter N/A N/A cls classpath_tuples confs N/A N/A N/A filter_func N/A N/A cls _accept_conf_filter confs unpack_func N/A N/A N/A x N/A N/A x N/A 0 N/A N/A N/A itertools ifilter filter_func classpath_tuples N/A classmethod _entries_iter N/A N/A cls classpath N/A N/A N/A N/A conf entry classpath N/A N/A N/A entry N/A classmethod classpath_contents N/A N/A cls targets classpath_products confs N/A N/A default N/A N/A Provide a generator over the contents (classes/resources) of a classpath.

    :param targets: Targets to iterate the contents classpath for.
    :param ClasspathProducts classpath_products: Product containing classpath elements.
    :param confs: The list of confs for use by this classpath.
    :returns: An iterator over all classpath contents, one directory, class or resource relative
              path per iteration step.
    :rtype: :class:`collections.Iterator` of string
     N/A classpath_iter N/A N/A cls _classpath_iter targets classpath_products confs confs N/A f N/A N/A cls classpath_entries_contents classpath_iter N/A N/A N/A f N/A classmethod classpath_entries_contents N/A N/A cls classpath_entries N/A N/A N/A Provide a generator over the contents (classes/resources) of a classpath.

    Subdirectories are included and differentiated via a trailing forward slash (for symmetry
    across ZipFile.namelist and directory walks).

    :param classpath_entries: A sequence of classpath_entries. Non-jars/dirs are ignored.
    :returns: An iterator over all classpath contents, one directory, class or resource relative
              path per iteration step.
    :rtype: :class:`collections.Iterator` of string
     N/A entry classpath_entries N/A N/A N/A N/A cls is_jar entry N/A N/A N/A open_zip entry mode r jar N/A N/A name N/A N/A jar namelist N/A N/A N/A name N/A N/A N/A N/A N/A os path isdir entry N/A rel_walk_name N/A N/A abs_sub_dir name N/A N/A N/A N/A fast_relpath N/A N/A N/A os path join abs_sub_dir name entry N/A N/A N/A abs_sub_dir dirnames filenames N/A safe_walk entry N/A N/A name dirnames N/A N/A N/A N/A N/A {}/ format N/A rel_walk_name abs_sub_dir name N/A name filenames N/A N/A N/A N/A rel_walk_name abs_sub_dir name N/A N/A N/A classmethod classname_for_rel_classfile N/A N/A cls class_file_name N/A N/A N/A Return the class name for the given relative-to-a-classpath-entry file, or None. N/A N/A N/A N/A class_file_name endswith .class N/A N/A None N/A N/A N/A N/A class_file_name N/A N/A N/A len .class replace / . N/A classmethod is_jar N/A N/A cls path N/A N/A N/A True if the given path represents an existing jar or zip file. N/A N/A N/A N/A path endswith N/A .jar .zip N/A N/A N/A os path isfile path N/A classmethod is_dir N/A N/A cls path N/A N/A N/A True if the given path represents an existing directory. N/A N/A N/A N/A os path isdir path N/A classmethod create_canonical_classpath N/A N/A cls classpath_products targets basedir save_classpath_file internal_classpath_only excludes N/A False True None N/A N/A Create a stable classpath of symlinks with standardized names.

    By default symlinks are created for each target under `basedir` based on its `target.id`.
    Unique suffixes are added to further disambiguate classpath products from the same target.

    It also optionally saves the classpath products to be used externally (by intellij plugin),
    one output file for each target.

    Note calling this function will refresh the symlinks and output files for the target under
    `basedir` if they exist, but it will NOT delete/cleanup the contents for *other* targets.
    Caller wants that behavior can make the similar calls for other targets or just remove
    the `basedir` first.

    :param classpath_products: Classpath products.
    :param targets: Targets to create canonical classpath for.
    :param basedir: Directory to create symlinks.
    :param save_classpath_file: An optional file with original classpath entries that symlinks
      are created from.
    :param internal_classpath_only: whether to create symlinks just for internal classpath or
       all classpath.
    :param excludes: classpath entries should be excluded.

    :returns: Converted canonical classpath.
    :rtype: list of strings
     delete_old_target_output_files N/A N/A classpath_prefix N/A N/A N/A Delete existing output files or symlinks for target. N/A N/A directory basename N/A N/A N/A os path split classpath_prefix N/A pattern N/A N/A re compile N/A N/A ^{basename}(([0-9]+)(\.jar)?|classpath\.txt)$ format basename N/A N/A re escape basename N/A files N/A filename N/A filename N/A N/A os listdir directory N/A N/A pattern match filename N/A rel_path files N/A N/A path N/A N/A N/A os path join directory rel_path N/A N/A N/A N/A N/A os path islink path N/A N/A N/A os path isfile path N/A N/A N/A safe_delete path N/A prepare_target_output_folder N/A N/A basedir target N/A N/A N/A Prepare directory that will contain canonical classpath for the target.

      This includes creating directories if it does not already exist, cleaning up
      previous classpath output related to the target.
       N/A output_dir basedir N/A classpath_prefix_for_target N/A N/A {basedir}/{target_id}- format basedir basedir target_id N/A target id N/A N/A N/A N/A os path exists output_dir N/A N/A N/A delete_old_target_output_files classpath_prefix_for_target N/A N/A N/A N/A os makedirs output_dir N/A classpath_prefix_for_target N/A N/A excludes N/A excludes N/A set N/A canonical_classpath N/A N/A target_to_classpath N/A N/A cls classpath_by_targets targets classpath_products N/A processed_entries N/A set N/A N/A target classpath_entries_for_target N/A N/A target_to_classpath items N/A N/A internal_classpath_only N/A N/A classpath_entries_for_target N/A filter N/A ClasspathEntry is_internal_classpath_entry classpath_entries_for_target N/A N/A N/A len classpath_entries_for_target 0 N/A N/A classpath_prefix_for_target N/A prepare_target_output_folder basedir target N/A N/A index entry N/A enumerate classpath_entries_for_target N/A N/A N/A N/A entry is_excluded_by excludes N/A N/A N/A N/A entry processed_entries N/A N/A N/A N/A N/A processed_entries add entry N/A N/A _ ext N/A N/A N/A os path splitext N/A entry path N/A symlink_path N/A N/A {}{}{} format classpath_prefix_for_target index ext N/A real_entry_path N/A N/A N/A os path realpath N/A entry path N/A N/A N/A N/A N/A os path exists real_entry_path N/A N/A N/A MissingClasspathEntryError N/A N/A Could not find {realpath} when attempting to link {src} into {dst} format realpath real_entry_path src N/A entry path dst symlink_path N/A N/A N/A os symlink real_entry_path symlink_path N/A N/A N/A canonical_classpath append symlink_path N/A save_classpath_file N/A N/A classpath N/A N/A entry path N/A entry classpath_entries_for_target N/A N/A safe_open N/A N/A {}classpath.txt format classpath_prefix_for_target wb classpath_file N/A N/A N/A N/A classpath_file write N/A N/A N/A N/A N/A os pathsep join classpath encode utf-8 N/A N/A N/A classpath_file write N/A canonical_classpath N/A classmethod N/A