Public API

file_exists

Check whether a file exists.

Useful in macros to set defaults for a configuration file if it is present. This can only be called during the loading phase, not from a rule implementation.

PARAMETERS

NameDescriptionDefault Value
patha label, or a string which is a path relative to this packagenone

glob_directories

PARAMETERS

NameDescriptionDefault Value
include - none
kwargs - none

is_external_label

Returns True if the given Label (or stringy version of a label) represents a target outside of the workspace

PARAMETERS

NameDescriptionDefault Value
parama string or labelnone

RETURNS

a bool

path_to_workspace_root

Returns the path to the workspace root under bazel

RETURNS

Path to the workspace root

propagate_well_known_tags

Returns a list of tags filtered from the input set that only contains the ones that are considered “well known”

These are listed in Bazel's documentation: https://docs.bazel.build/versions/main/test-encyclopedia.html#tag-conventions https://docs.bazel.build/versions/main/be/common-definitions.html#common-attributes

PARAMETERS

NameDescriptionDefault Value
tagsList of tags to filter[]

RETURNS

List of tags that only contains the well known set

to_label

Converts a string to a Label. If Label is supplied, the same label is returned.

PARAMETERS

NameDescriptionDefault Value
parama string representing a label or a Labelnone

RETURNS

a Label