Pants BUILD Dictionary
A BUILD
file defines one or more build targets.
A target represents a set of source files, dependencies or other 'nouns' that
build commands can act on. The type of a target determines what actions
apply to it. For example, a jvm_binary
target can be compiled and run.
Target Types
-
_python_requirements_file
: A requirements.txt file.-
The python_requirements macro generates python_requirement_library targets and makes them depend
on a _python_requirements_file() target, so that pantsd knows to invalidate correctly when the
requirements.txt file changes. We don't want to use a regular files() target for this, as we
don't want to consider the requirements.txt a source for the purpose of building pexes (e.g., we
don't want whitespace changes to requirements.txt to invalidate the sources pex).
-
dependencies = ..., (default: []) description = ..., (default: None) name = ..., no_cache = ..., (default: False) sources = ..., Files to "include". Paths are relative to the BUILD file's directory. (default: None) tags = ..., (default: None)
-
-
alias
: A target that gets replaced by its dependencies.-
dependencies = ..., (default: []) description = ..., (default: None) name = ..., no_cache = ..., (default: False) tags = ..., (default: None)
-
-
annotation_processor
: A Java library containing annotation processors.-
:API: public
-
= ..., class:`pants.backend.jvm.artifact.Artifact` provides: (default: None) *args = ..., None compiler_option_sets = ..., A list of compiler_option_sets keys for the target. Platform dependent. (default: None) dependencies = ..., (default: []) description = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) exports = ..., A list of exported targets, which will be accessible to dependents even with strict_deps turned on. A common use case is for library targets to to export dependencies that it knows its dependents will need. Then any dependents of that library target will have access to those dependencies even when strict_deps is True. Note: exports is transitive, which means dependents have access to the closure of exports. An example will be that if A exports B, and B exports C, then any targets that depends on A will have access to both B and C. (default: None) javac_plugin_args = ..., Map from javac plugin name to list of arguments for that plugin. (default: None) javac_plugins = ..., names of compiler plugins to use when compiling this target with javac. (default: None) name = ..., no_cache = ..., (default: False) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) processors = ..., A list of the fully qualified class names of the annotation processors this library exports. (default: None) provides = ..., (default: None) scalac_plugin_args = ..., Map from scalac plugin name to list of arguments for that plugin. (default: None) scalac_plugins = ..., names of compiler plugins to use when compiling this target with scalac. (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) tags = ..., (default: None) zinc_file_manager = ..., Whether to use zinc provided file manager that allows transactional rollbacks, but in certain cases may conflict with user libraries. (default: None)
-
-
benchmark
: A caliper benchmark.-
Run it with the ``bench`` goal.
-
compiler_option_sets = ..., A list of compiler_option_sets keys for the target. Platform dependent. (default: None) dependencies = ..., (default: []) description = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) exports = ..., A list of exported targets, which will be accessible to dependents even with strict_deps turned on. A common use case is for library targets to to export dependencies that it knows its dependents will need. Then any dependents of that library target will have access to those dependencies even when strict_deps is True. Note: exports is transitive, which means dependents have access to the closure of exports. An example will be that if A exports B, and B exports C, then any targets that depends on A will have access to both B and C. (default: None) javac_plugin_args = ..., Map from javac plugin name to list of arguments for that plugin. (default: None) javac_plugins = ..., names of compiler plugins to use when compiling this target with javac. (default: None) name = ..., no_cache = ..., (default: False) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) provides = ..., (default: None) runtime_platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for runtime (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_runtime_platform specified for jvm-platform, (2) the platform that would be used for the platform kwarg. (default: None) scalac_plugin_args = ..., Map from scalac plugin name to list of arguments for that plugin. (default: None) scalac_plugins = ..., names of compiler plugins to use when compiling this target with scalac. (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) tags = ..., (default: None) zinc_file_manager = ..., Whether to use zinc provided file manager that allows transactional rollbacks, but in certain cases may conflict with user libraries. (default: None)
-
-
contrib_plugin
: <Add description>-
compatibility = ..., either a string that represents interpreter compatibility for this target using the Requirement-style format, e.g. ``'CPython>=2.7,<3'`` (Select a CPython interpreter with version ``>=2.7`` AND version ``<3``) or a list of Requirement-style strings which will be OR'ed together. If the compatibility requirement is agnostic to interpreter class, using the example above, a Requirement-style compatibility constraint like '>=2.7,<3' (N.B.: not prefixed with CPython) can be used. (default: None) dependencies = ..., The addresses of targets that this target depends on. These dependencies may be ``python_library``-like targets (``python_library``, ``python_thrift_library``, ``resources`` and so forth) or ``python_requirement_library`` targets. (default: None) description = ..., (default: None) name = ..., no_cache = ..., (default: False) provides = ..., The `setup_py <#setup_py>`_ to publish that represents this target outside the repo. (default: None) sources = ..., Files to "include". Paths are relative to the BUILD file's directory. (default: None) tags = ..., (default: None)
-
-
credentials
: <Add description>-
dependencies = ..., (default: []) description = ..., (default: None) name = ..., The name of these credentials. (default: None) no_cache = ..., (default: False) password = ..., A constant password value. (default: None) tags = ..., (default: None) username = ..., A constant username value. (default: None)
-
-
ctypes_compatible_c_library
: <Add description>-
compiler_option_sets = ..., (default: None) ctypes_native_library = ..., (default: None) dependencies = ..., (default: []) description = ..., (default: None) fatal_warnings = ..., (default: None) name = ..., no_cache = ..., (default: False) sources = ..., (default: None) strict_deps = ..., (default: None) tags = ..., (default: None) toolchain_variant = ..., (default: None)
-
-
ctypes_compatible_cpp_library
: <Add description>-
compiler_option_sets = ..., (default: None) ctypes_native_library = ..., (default: None) dependencies = ..., (default: []) description = ..., (default: None) fatal_warnings = ..., (default: None) name = ..., no_cache = ..., (default: False) sources = ..., (default: None) strict_deps = ..., (default: None) tags = ..., (default: None) toolchain_variant = ..., (default: None)
-
-
external_native_library
: A set of Conan package strings to be passed to the Conan package manager.-
dependencies = ..., (default: []) description = ..., (default: None) name = ..., no_cache = ..., (default: False) packages = ..., the `ConanRequirement`s to resolve into a `packaged_native_library()` target. (default: None) tags = ..., (default: None)
-
-
files
: A collection of loose files.-
dependencies = ..., (default: []) description = ..., (default: None) name = ..., no_cache = ..., (default: False) sources = ..., Files to "include". Paths are relative to the BUILD file's directory. (default: None) tags = ..., (default: None)
-
-
go_binary
: A local Go main package.-
build_flags = ..., Build flags to pass to Go compiler. (default: None) dependencies = ..., (default: []) description = ..., (default: None) name = ..., no_cache = ..., (default: False) sources = ..., (default: None) tags = ..., (default: None)
-
-
go_library
: A local Go package.-
dependencies = ..., (default: []) description = ..., (default: None) name = ..., no_cache = ..., (default: False) sources = ..., (default: None) tags = ..., (default: None)
-
-
go_protobuf_library
: A Go library generated from Protobuf IDL files.-
dependencies = ..., (default: []) description = ..., (default: None) name = ..., no_cache = ..., (default: False) protoc_plugins = ..., (default: None) sources = ..., protobuf source files (default: None) tags = ..., (default: None)
-
-
go_remote_libraries
: A remote Go package.-
dependencies = ..., (default: []) description = ..., (default: None) name = ..., no_cache = ..., (default: False) pkg = ..., The package import path within the remote library; by default the root package path (equivalent to passing `pkg='.'` or `pkg=''`). (default: ) rev = ..., Identifies which version of the remote library to download. This could be a commit SHA (git), node id (hg), etc. If left unspecified the version will default to the latest available. It's highly recommended to not accept the default and instead pin the rev explicitly for repeatable builds. (default: ) tags = ..., (default: None)
-
-
go_remote_library
: A remote Go package.-
dependencies = ..., (default: []) description = ..., (default: None) name = ..., no_cache = ..., (default: False) pkg = ..., The package import path within the remote library; by default the root package path (equivalent to passing `pkg='.'` or `pkg=''`). (default: ) rev = ..., Identifies which version of the remote library to download. This could be a commit SHA (git), node id (hg), etc. If left unspecified the version will default to the latest available. It's highly recommended to not accept the default and instead pin the rev explicitly for repeatable builds. (default: ) tags = ..., (default: None)
-
-
go_thrift_library
: A Go library generated from Thrift IDL files.-
dependencies = ..., (default: []) description = ..., (default: None) name = ..., no_cache = ..., (default: False) sources = ..., thrift source files (default: None) tags = ..., (default: None)
-
-
jar_library
: A set of external JAR files.-
:API: public
-
dependencies = ..., (default: []) description = ..., (default: None) jars = ..., List of `jar <#jar>`_\s to depend upon. (default: None) managed_dependencies = ..., Address of a managed_jar_dependencies() target to use. If omitted, uses the default managed_jar_dependencies() target set by --jar-dependency-management-default-target. (default: None) name = ..., no_cache = ..., (default: False) tags = ..., (default: None)
-
-
java_agent
: A Java agent entrypoint.-
= ..., class:`pants.backend.jvm.artifact.Artifact` provides: (default: None) *args = ..., None agent_class = ..., If an implementation supports a mechanism to start agents sometime after the VM has started then this attribute specifies the agent class. Exactly one of ``premain`` or ``agent_class`` must be specified. (default: None) can_redefine = ..., `True` if the ability to redefine classes is needed by this agent; `False` by default. (default: False) can_retransform = ..., `True` if the ability to retransform classes is needed by this agent; `False` by default. (default: False) can_set_native_method_prefix = ..., `True` if the ability to set he native method prefix is needed by this agent; `False` by default. (default: False) compiler_option_sets = ..., A list of compiler_option_sets keys for the target. Platform dependent. (default: None) dependencies = ..., (default: []) description = ..., (default: None) excludes = ..., (default: None) exports = ..., A list of exported targets, which will be accessible to dependents even with strict_deps turned on. A common use case is for library targets to to export dependencies that it knows its dependents will need. Then any dependents of that library target will have access to those dependencies even when strict_deps is True. Note: exports is transitive, which means dependents have access to the closure of exports. An example will be that if A exports B, and B exports C, then any targets that depends on A will have access to both B and C. (default: None) javac_plugin_args = ..., Map from javac plugin name to list of arguments for that plugin. (default: None) javac_plugins = ..., names of compiler plugins to use when compiling this target with javac. (default: None) name = ..., no_cache = ..., (default: False) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) premain = ..., When an agent is specified at JVM launch time this attribute specifies the agent class. Exactly one of ``premain`` or ``agent_class`` must be specified. (default: None) provides = ..., (default: None) scalac_plugin_args = ..., Map from scalac plugin name to list of arguments for that plugin. (default: None) scalac_plugins = ..., names of compiler plugins to use when compiling this target with scalac. (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) sources = ..., (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) tags = ..., (default: None) zinc_file_manager = ..., Whether to use zinc provided file manager that allows transactional rollbacks, but in certain cases may conflict with user libraries. (default: None)
-
-
java_library
: A Java library.-
Normally has conceptually-related sources; invoking the ``compile`` goal
on this target compiles Java and generates classes. Invoking the ``jar``
goal on this target creates a ``.jar``; but that's an unusual thing to do.
Instead, a ``jvm_binary`` might depend on this library; that binary is a
more sensible thing to bundle.
:API: public
-
= ..., class:`pants.backend.jvm.artifact.Artifact` provides: (default: None) *args = ..., None compiler_option_sets = ..., A list of compiler_option_sets keys for the target. Platform dependent. (default: None) dependencies = ..., (default: []) description = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) exports = ..., A list of exported targets, which will be accessible to dependents even with strict_deps turned on. A common use case is for library targets to to export dependencies that it knows its dependents will need. Then any dependents of that library target will have access to those dependencies even when strict_deps is True. Note: exports is transitive, which means dependents have access to the closure of exports. An example will be that if A exports B, and B exports C, then any targets that depends on A will have access to both B and C. (default: None) javac_plugin_args = ..., Map from javac plugin name to list of arguments for that plugin. (default: None) javac_plugins = ..., names of compiler plugins to use when compiling this target with javac. (default: None) name = ..., no_cache = ..., (default: False) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) provides = ..., (default: None) scalac_plugin_args = ..., Map from scalac plugin name to list of arguments for that plugin. (default: None) scalac_plugins = ..., names of compiler plugins to use when compiling this target with scalac. (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) tags = ..., (default: None) zinc_file_manager = ..., Whether to use zinc provided file manager that allows transactional rollbacks, but in certain cases may conflict with user libraries. (default: None)
-
-
java_protobuf_library
: A Java library generated from Protocol Buffer IDL files.-
compiler_option_sets = ..., A list of compiler_option_sets keys for the target. Platform dependent. (default: None) dependencies = ..., (default: []) description = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) exports = ..., A list of exported targets, which will be accessible to dependents even with strict_deps turned on. A common use case is for library targets to to export dependencies that it knows its dependents will need. Then any dependents of that library target will have access to those dependencies even when strict_deps is True. Note: exports is transitive, which means dependents have access to the closure of exports. An example will be that if A exports B, and B exports C, then any targets that depends on A will have access to both B and C. (default: None) javac_plugin_args = ..., Map from javac plugin name to list of arguments for that plugin. (default: None) javac_plugins = ..., names of compiler plugins to use when compiling this target with javac. (default: None) name = ..., no_cache = ..., (default: False) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) provides = ..., (default: None) scalac_plugin_args = ..., Map from scalac plugin name to list of arguments for that plugin. (default: None) scalac_plugins = ..., names of compiler plugins to use when compiling this target with scalac. (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) tags = ..., (default: None) zinc_file_manager = ..., Whether to use zinc provided file manager that allows transactional rollbacks, but in certain cases may conflict with user libraries. (default: None)
-
-
java_thrift_library
: A Java library generated from Thrift IDL files.-
:API: public
-
compiler = ..., The compiler used to compile the thrift files. The default is defined in the global options under ``--thrift-default-compiler``. (default: None) compiler_args = ..., Extra arguments to the compiler. (default: None) compiler_option_sets = ..., A list of compiler_option_sets keys for the target. Platform dependent. (default: None) default_java_namespace = ..., The namespace used for Java generated code when a Java namespace is not explicitly specified in the IDL. The default is defined in the global options under ``--thrift-default-default-java-namespace``. (default: None) dependencies = ..., (default: []) description = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) exports = ..., A list of exported targets, which will be accessible to dependents even with strict_deps turned on. A common use case is for library targets to to export dependencies that it knows its dependents will need. Then any dependents of that library target will have access to those dependencies even when strict_deps is True. Note: exports is transitive, which means dependents have access to the closure of exports. An example will be that if A exports B, and B exports C, then any targets that depends on A will have access to both B and C. (default: None) include_paths = ..., (default: None) javac_plugin_args = ..., Map from javac plugin name to list of arguments for that plugin. (default: None) javac_plugins = ..., names of compiler plugins to use when compiling this target with javac. (default: None) language = ..., The language used to generate the output files. The default is defined in the global options under ``--thrift-default-language``. (default: None) name = ..., namespace_map = ..., An optional dictionary of namespaces to remap {old: new} (default: None) no_cache = ..., (default: False) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) provides = ..., (default: None) scalac_plugin_args = ..., Map from scalac plugin name to list of arguments for that plugin. (default: None) scalac_plugins = ..., names of compiler plugins to use when compiling this target with scalac. (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) tags = ..., (default: None) thrift_linter_strict = ..., If True, fail if thrift linter produces any warnings. (default: None) zinc_file_manager = ..., Whether to use zinc provided file manager that allows transactional rollbacks, but in certain cases may conflict with user libraries. (default: None)
-
-
javac_plugin
: A Java compiler plugin.-
= ..., class:`pants.backend.jvm.artifact.Artifact` provides: (default: None) *args = ..., None classname = ..., The fully qualified plugin class name - required. (default: None) compiler_option_sets = ..., A list of compiler_option_sets keys for the target. Platform dependent. (default: None) dependencies = ..., (default: []) description = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) exports = ..., A list of exported targets, which will be accessible to dependents even with strict_deps turned on. A common use case is for library targets to to export dependencies that it knows its dependents will need. Then any dependents of that library target will have access to those dependencies even when strict_deps is True. Note: exports is transitive, which means dependents have access to the closure of exports. An example will be that if A exports B, and B exports C, then any targets that depends on A will have access to both B and C. (default: None) javac_plugin_args = ..., Map from javac plugin name to list of arguments for that plugin. (default: None) javac_plugins = ..., names of compiler plugins to use when compiling this target with javac. (default: None) name = ..., no_cache = ..., (default: False) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) plugin = ..., The name of the plugin. Defaults to name if not supplied. These are the names passed to javac's -Xplugin flag. (default: None) provides = ..., (default: None) scalac_plugin_args = ..., Map from scalac plugin name to list of arguments for that plugin. (default: None) scalac_plugins = ..., names of compiler plugins to use when compiling this target with scalac. (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) tags = ..., (default: None) zinc_file_manager = ..., Whether to use zinc provided file manager that allows transactional rollbacks, but in certain cases may conflict with user libraries. (default: None)
-
-
junit_tests
: JUnit tests.-
:API: public
-
compiler_option_sets = ..., A list of compiler_option_sets keys for the target. Platform dependent. (default: None) concurrency = ..., One of 'SERIAL', 'PARALLEL_CLASSES', 'PARALLEL_METHODS', or 'PARALLEL_CLASSES_AND_METHODS'. Overrides the setting of --test-junit-default-concurrency. (default: None) cwd = ..., working directory (relative to the build root) for the tests under this target. If unspecified (None), the working directory will be controlled by junit_run's --cwd and --chroot options. (default: None) dependencies = ..., (default: []) description = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) exports = ..., A list of exported targets, which will be accessible to dependents even with strict_deps turned on. A common use case is for library targets to to export dependencies that it knows its dependents will need. Then any dependents of that library target will have access to those dependencies even when strict_deps is True. Note: exports is transitive, which means dependents have access to the closure of exports. An example will be that if A exports B, and B exports C, then any targets that depends on A will have access to both B and C. (default: None) extra_env_vars = ..., A map of environment variables to set when running the tests, e.g. { 'FOOBAR': 12 }. Using `None` as the value will cause the variable to be unset. (default: None) extra_jvm_options = ..., A list of options to be passed to the jvm when running the tests. Example: ['-Dexample.property=1', '-DMyFlag', '-Xmx4g'] If unspecified, no extra jvm options will be added. (default: None) javac_plugin_args = ..., Map from javac plugin name to list of arguments for that plugin. (default: None) javac_plugins = ..., names of compiler plugins to use when compiling this target with javac. (default: None) name = ..., no_cache = ..., (default: False) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) provides = ..., (default: None) runtime_platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for runtime (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_runtime_platform specified for jvm-platform, (2) the platform that would be used for the platform kwarg. (default: None) scalac_plugin_args = ..., Map from scalac plugin name to list of arguments for that plugin. (default: None) scalac_plugins = ..., names of compiler plugins to use when compiling this target with scalac. (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) tags = ..., (default: None) threads = ..., Use the specified number of threads when running the test. Overrides the setting of --test-junit-parallel-threads. (default: None) timeout = ..., A timeout (in seconds) which covers the total runtime of all tests in this target. Only applied if `--test-junit-timeouts` is set to True. (default: None) zinc_file_manager = ..., Whether to use zinc provided file manager that allows transactional rollbacks, but in certain cases may conflict with user libraries. (default: None)
-
-
jvm_app
: A deployable JVM application.-
Invoking the ``bundle`` goal on one of these targets creates a
self-contained artifact suitable for deployment on some other machine.
The artifact contains the executable jar, its dependencies, and
extra files like config files, startup scripts, etc.
:API: public
-
archive = ..., Create an archive of this type from the bundle. (default: None) basename = ..., Name of this application, if different from the ``name``. Optionally pants uses this in the ``bundle`` goal to name the distribution artifact. Note this is unsafe because of the possible conflict when multiple bundles are built. (default: None) binary = ..., Target spec of the ``jvm_binary`` or the ``python_binary`` that contains the app main. (default: None) bundles = ..., One or more ``bundle``\s describing "extra files" that should be included with this app (e.g.: config files, startup scripts). (default: None) dependencies = ..., (default: []) deployjar = ..., If True, pack all 3rdparty and internal jar classfiles into a single deployjar in the bundle's root dir. If unset, all jars will go into the bundle's libs directory, the root will only contain a synthetic jar with its manifest's Class-Path set to those jars. (default: None) description = ..., (default: None) name = ..., (default: None) no_cache = ..., (default: False) tags = ..., (default: None)
-
-
jvm_binary
: A JVM binary.-
Below are a summary of how key goals affect targets of this type:
* ``bundle`` - Creates a self-contained directory with the binary and all
its dependencies, optionally archived, suitable for deployment.
* ``binary`` - Create an executable jar of the binary. On the JVM
this means the jar has a manifest specifying the main class.
* ``run`` - Executes the main class of this binary locally.
:API: public
-
basename = ..., Base name for the generated ``.jar`` file, e.g., ``'hello'``. (By default, uses ``name`` param) Note this is unsafe because of the possible conflict when multiple binaries are built. (default: None) compiler_option_sets = ..., A list of compiler_option_sets keys for the target. Platform dependent. (default: None) dependencies = ..., Targets (probably ``java_library`` and ``scala_library`` targets) to "link" in. (default: None) deploy_excludes = ..., List of `exclude <#exclude>`_\s to apply at deploy time. If you, for example, deploy a java servlet that has one version of ``servlet.jar`` onto a Tomcat environment that provides another version, they might conflict. ``deploy_excludes`` gives you a way to build your code but exclude the conflicting ``jar`` when deploying. (default: None) deploy_jar_rules = ..., `Jar rules <#jar_rules>`_ for packaging this binary in a deploy jar. (default: None) description = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) exports = ..., A list of exported targets, which will be accessible to dependents even with strict_deps turned on. A common use case is for library targets to to export dependencies that it knows its dependents will need. Then any dependents of that library target will have access to those dependencies even when strict_deps is True. Note: exports is transitive, which means dependents have access to the closure of exports. An example will be that if A exports B, and B exports C, then any targets that depends on A will have access to both B and C. (default: None) extra_jvm_options = ..., A list of options to be passed to the jvm when running the binary. Example: ['-Dexample.property=1', '-DMyFlag', '-Xmx4G'] If unspecified, no extra jvm options will be added. (default: None) javac_plugin_args = ..., Map from javac plugin name to list of arguments for that plugin. (default: None) javac_plugins = ..., names of compiler plugins to use when compiling this target with javac. (default: None) main = ..., The name of the ``main`` class, e.g., ``'org.pantsbuild.example.hello.main.HelloMain'``. This class may be present as the source of this target or depended-upon library. (default: None) manifest_entries = ..., dict that specifies entries for `ManifestEntries <#manifest_entries>`_ for adding to MANIFEST.MF when packaging this binary. (default: None) name = ..., (default: None) no_cache = ..., (default: False) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) provides = ..., (default: None) runtime_platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for runtime (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_runtime_platform specified for jvm-platform, (2) the platform that would be used for the platform kwarg. (default: None) scalac_plugin_args = ..., Map from scalac plugin name to list of arguments for that plugin. (default: None) scalac_plugins = ..., names of compiler plugins to use when compiling this target with scalac. (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) shading_rules = ..., Optional list of shading rules to apply when building a shaded (aka monolithic aka fat) binary jar. The order of the rules matters: the first rule which matches a fully-qualified class name is used to shade it. See shading_relocate(), shading_exclude(), shading_relocate_package(), and shading_exclude_package(). (default: None) sources = ..., Zero or one source files. If more than one source is required, they should be put in a library target which should be added to dependencies. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) tags = ..., (default: None) zinc_file_manager = ..., Whether to use zinc provided file manager that allows transactional rollbacks, but in certain cases may conflict with user libraries. (default: None)
-
-
jvm_prep_command
: A command (defined in a Java target) that must be run before other tasks in a goal.-
For example, you can use `jvm_prep_command()` to execute a script that sets up tunnels to database
servers. These tunnels could then be leveraged by integration tests.
You can define a jvm_prep_command() target as follows:
jvm_prep_command(
name='foo',
goal='test',
mainclass='com.example.myproject.BeforeTestMain',
args=['--foo', 'bar'],
jvm_options=['-Xmx256M', '-Dmy.property=baz'],
dependencies=[
'myproject/src/main/java:lib',
],
)
Pants will execute the `jvm_prep_command()` when processing the specified goal. They will be
triggered when running targets that depend on the `prep_command()` target or when the
target is referenced from the command line.
See also prep_command for running shell commands.
:API: public
-
args = ..., A list of command-line args to the executable. (default: None) compiler_option_sets = ..., A list of compiler_option_sets keys for the target. Platform dependent. (default: None) dependencies = ..., (default: []) description = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) exports = ..., A list of exported targets, which will be accessible to dependents even with strict_deps turned on. A common use case is for library targets to to export dependencies that it knows its dependents will need. Then any dependents of that library target will have access to those dependencies even when strict_deps is True. Note: exports is transitive, which means dependents have access to the closure of exports. An example will be that if A exports B, and B exports C, then any targets that depends on A will have access to both B and C. (default: None) goal = ..., Pants goal to run this command in [test, binary or compile]. If not specified, runs in 'test' (default: None) javac_plugin_args = ..., Map from javac plugin name to list of arguments for that plugin. (default: None) javac_plugins = ..., names of compiler plugins to use when compiling this target with javac. (default: None) jvm_options = ..., extra options to pass the JVM (default: None) mainclass = ..., The path to the executable that should be run. (default: None) name = ..., no_cache = ..., (default: False) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) provides = ..., (default: None) runtime_platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for runtime (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_runtime_platform specified for jvm-platform, (2) the platform that would be used for the platform kwarg. (default: None) scalac_plugin_args = ..., Map from scalac plugin name to list of arguments for that plugin. (default: None) scalac_plugins = ..., names of compiler plugins to use when compiling this target with scalac. (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) tags = ..., (default: None) zinc_file_manager = ..., Whether to use zinc provided file manager that allows transactional rollbacks, but in certain cases may conflict with user libraries. (default: None)
-
-
managed_jar_dependencies
: A set of pinned external artifact versions to apply transitively.-
artifacts = ..., List of `jar <#jar>`_\s or specs to jar_library targets with pinned versions. Versions are pinned per (org, name, classifier, ext) artifact coordinate (excludes, etc are ignored for the purposes of pinning). (default: None) dependencies = ..., (default: []) description = ..., (default: None) name = ..., no_cache = ..., (default: False) tags = ..., (default: None)
-
-
netrc_credentials
: A Credentials subclass that uses a Netrc file to compute credentials.-
dependencies = ..., (default: []) description = ..., (default: None) name = ..., no_cache = ..., (default: False) tags = ..., (default: None)
-
-
node_bundle
: A bundle of node modules.-
archive = ..., a string, select from tar, tgz, tbz2, default to tgz (default: tgz) dependencies = ..., a list of node_modules (default: None) description = ..., (default: None) name = ..., no_cache = ..., (default: False) node_module = ..., (default: None) package_name = ..., The remote module package name, if not supplied the target name is used. (default: None) tags = ..., (default: None)
-
-
node_module
: A Node module.-
bin_executables = ..., A map of executable names to local file name. If a single executable is specified (a string), the package name will be the executable name and the value will be the local file name per package.json rules. (default: None) build_script = ..., build script name as defined in package.json. All files that are needed for the build script must be included in sources. The script should output build results in the directory specified by output_dir. If build_script is not supplied, the node installation results will be considered as output. The output can be archived or included as resources for JVM target. (default: None) dependencies = ..., (default: []) description = ..., (default: None) dev_dependency = ..., boolean value. Default is False. If a node_module is used as parts of devDependencies and thus should not be included in the final bundle or JVM binaries, set this value to True. (default: False) name = ..., no_cache = ..., (default: False) node_scope = ..., Groups related packages together by adding a scope. The `@` symbol is typically used for specifying scope in the package name in `package.json`. However pants target addresses do not allow for `@` in the target address. A repo-level default scope can be added with the --node-distribution-node-scope option. Any target-level node_scope will override the global node-scope. (default: None) output_dir = ..., relative path to assets generated by build script. The path will be preserved in the created JAR if the target is used as a JVM target dependency. (default: dist) package_manager = ..., choose among supported package managers (npm or yarn). (default: None) package_name = ..., The remote module package name, if not supplied the target name is used. (default: None) sources = ..., Javascript and other source code files that make up this module; paths are relative to the BUILD file's directory. (default: None) style_ignore_path = ..., relative path to file specifying patterns of files to ignore. The syntax supported is the same as the .eslintignore/.gitignore syntax. (default: .eslintignore) tags = ..., (default: None)
-
-
node_preinstalled_module
: A NodeModule which resolves deps by downloading an archived node_modules directory.-
This is basically an example, to demonstrate how additional types of NodeModule targets with
their own resolvers (in this case NodePreinstalledModuleResolver), which still work with
NodeTest, can be registered. To be generally correct, this target type and associated resolver
would have to use platform- and Node-version-specific node_modules archives, rather than just a
single dependencies_archive_url used verbatim. Consider NodePreinstalledModule and
NodePreinstalledModuleResolver subject to future change or removal for now.
-
bin_executables = ..., A map of executable names to local file name. If a single executable is specified (a string), the package name will be the executable name and the value will be the local file name per package.json rules. (default: None) build_script = ..., build script name as defined in package.json. All files that are needed for the build script must be included in sources. The script should output build results in the directory specified by output_dir. If build_script is not supplied, the node installation results will be considered as output. The output can be archived or included as resources for JVM target. (default: None) dependencies = ..., (default: []) dependencies_archive_url = ..., (default: None) description = ..., (default: None) dev_dependency = ..., boolean value. Default is False. If a node_module is used as parts of devDependencies and thus should not be included in the final bundle or JVM binaries, set this value to True. (default: False) name = ..., no_cache = ..., (default: False) node_scope = ..., Groups related packages together by adding a scope. The `@` symbol is typically used for specifying scope in the package name in `package.json`. However pants target addresses do not allow for `@` in the target address. A repo-level default scope can be added with the --node-distribution-node-scope option. Any target-level node_scope will override the global node-scope. (default: None) output_dir = ..., relative path to assets generated by build script. The path will be preserved in the created JAR if the target is used as a JVM target dependency. (default: dist) package_manager = ..., choose among supported package managers (npm or yarn). (default: None) package_name = ..., The remote module package name, if not supplied the target name is used. (default: None) sources = ..., (default: None) style_ignore_path = ..., relative path to file specifying patterns of files to ignore. The syntax supported is the same as the .eslintignore/.gitignore syntax. (default: .eslintignore) tags = ..., (default: None) url = ..., The location of a tar.gz file containing containing a node_modules directory. (default: None)
-
-
node_remote_module
: A remote Node module.-
dependencies = ..., (default: []) description = ..., (default: None) name = ..., no_cache = ..., (default: False) package_name = ..., The remote module package name, if not supplied the target name is used. (default: None) tags = ..., (default: None) version = ..., The version constraint for the remote node module. Any of the forms accepted by npm including '' or '*' for unconstrained (the default) are acceptable. See: https://docs.npmjs.com/files/package.json#dependencies (default: None)
-
-
node_test
: Javascript tests run via a script specified in a package.json file.-
dependencies = ..., (default: []) description = ..., (default: None) name = ..., no_cache = ..., (default: False) script_name = ..., The tests script name in package.json. Defaults to "test". (default: None) tags = ..., (default: None) timeout = ..., The test target timeout. (default: None)
-
-
packaged_native_library
: A container for headers and libraries from external sources.-
This target type is intended to be generated by a codegen task to wrap various sources of C/C++
packages in a homogenous container. It can also be used to wrap native libraries which are
checked into the repository -- the `sources` argument does not allow files outside of the
buildroot.
-
dependencies = ..., (default: []) description = ..., (default: None) include_relpath = ..., The path where C/C++ headers are located, relative to this target's directory. Libraries depending on this target will be able to #include files relative to this directory. (default: None) lib_relpath = ..., The path where native libraries are located, relative to this target's directory. (default: None) name = ..., native_lib_names = ..., Strings containing the libraries to add to the linker command line. These libraries become `-l<name>` arguments, so they must exist and be named `lib<name>.so` (or `lib<name>.dylib` depending on the platform) or the linker will exit with an error. This field may also be a dict mapping the OS name ('darwin' or 'linux') to a list of such strings. (default: None) no_cache = ..., (default: False) sources = ..., Files owned by this target. (default: None) tags = ..., (default: None)
-
-
page
: A documentation page.-
Here is an example, that shows a markdown page providing a wiki page on an Atlassian Confluence
wiki: ::
page(name='mypage',
sources=['mypage.md'],
provides=[
wiki_artifact(wiki=Wiki('foozle', <url builder>),
space='my_space',
title='my_page',
parent='my_parent'),
],
)
A ``page`` can have more than one ``wiki_artifact`` in its ``provides``
(there might be more than one place to publish it).
-
dependencies = ..., (default: []) description = ..., (default: None) format = ..., Page's format, ``md`` or ``rst``. By default, Pants infers from ``source`` file extension: ``.rst`` is ReStructured Text; anything else is Markdown. (default: None) links = ..., Other ``page`` targets that this `page` links to. (default: None) name = ..., no_cache = ..., (default: False) provides = ..., Optional "Addresses" at which this page is published. E.g., a wiki location. (default: None) sources = ..., Page source file. Exactly one will be present. tags = ..., (default: None)
-
-
prep_command
: A shell command to be run prior to running a goal.-
For example, you can use `prep_command()` to execute a script that sets up tunnels to database
servers. These tunnels could then be leveraged by integration tests.
Pants will only execute the `prep_command()` under the specified goal, when processing targets
that depend on the `prep_command()` target. If not otherwise specified, prep_commands
execute in the test goal.
See also jvm_prep_command for running tasks defined by a JVM language.
:API: public
-
dependencies = ..., (default: []) description = ..., (default: None) goals = ..., One or more pants goals to run this command in [test, binary or compile]. If not specified, runs in the 'test' goal. (default: None) name = ..., no_cache = ..., (default: False) prep_args = ..., A list of command-line args to the executable. (default: None) prep_environ = ..., If True, the output of the command will be treated as a \\0-separated list of key=value pairs to insert into the environment. Note that this will pollute the environment for all future tests, so avoid it if at all possible. (default: False) prep_executable = ..., The path to the executable that should be run. (default: None) tags = ..., (default: None)
-
-
python_app
: A deployable Python application.-
Invoking the ``bundle`` goal on one of these targets creates a
self-contained artifact suitable for deployment on some other machine.
The artifact contains the executable pex, its dependencies, and
extra files like config files, startup scripts, etc.
:API: public
-
archive = ..., Create an archive of this type from the bundle. (default: None) basename = ..., Name of this application, if different from the ``name``. Optionally pants uses this in the ``bundle`` goal to name the distribution artifact. Note this is unsafe because of the possible conflict when multiple bundles are built. (default: None) binary = ..., Target spec of the ``jvm_binary`` or the ``python_binary`` that contains the app main. (default: None) bundles = ..., One or more ``bundle``\s describing "extra files" that should be included with this app (e.g.: config files, startup scripts). (default: None) dependencies = ..., (default: []) description = ..., (default: None) name = ..., (default: None) no_cache = ..., (default: False) tags = ..., (default: None)
-
-
python_awslambda
: <Add description>-
dependencies = ..., (default: []) description = ..., (default: None) handler = ..., (default: None) name = ..., no_cache = ..., (default: False) runtime = ..., (default: None) sources = ..., (default: ()) tags = ..., (default: None)
-
-
python_binary
: A Python binary.-
Python binaries are pex files, self-contained executable shell
scripts that contain a complete Python environment capable of
running the target. For more information about pex files see
http://pantsbuild.github.io/python-readme.html#how-pex-files-work.
:API: public
-
always_write_cache = ..., whether or not the .deps cache of this PEX file should always be written to disk. (default: False) compatibility = ..., either a string that represents interpreter compatibility for this target using the Requirement-style format, e.g. ``'CPython>=2.7,<3'`` (Select a CPython interpreter with version ``>=2.7`` AND version ``<3``) or a list of Requirement-style strings which will be OR'ed together. If the compatibility requirement is agnostic to interpreter class, using the example above, a Requirement-style compatibility constraint like '>=2.7,<3' (N.B.: not prefixed with CPython) can be used. (default: None) dependencies = ..., The addresses of targets that this target depends on. These dependencies may be ``python_library``-like targets (``python_library``, ``python_thrift_library``, ``resources`` and so forth) or ``python_requirement_library`` targets. (default: None) description = ..., (default: None) emit_warnings = ..., Whether or not to emit pex warnings. (default: None) entry_point = ..., the default entry point for this binary. if None, drops into the entry point that is defined by source. Something like "pants.bin.pants_exe:main", where "pants.bin.pants_exe" is the package name and "main" is the function name (if omitted, the module is executed directly, presuming it has a ``__main.py__``). (default: None) ignore_errors = ..., should we ignore inability to resolve dependencies? (default: False) inherit_path = ..., inherit the sys.path of the environment that this binary runs in (default: False) name = ..., no_cache = ..., (default: False) platforms = ..., extra platforms to target when building this binary. If this is, e.g., ``['current', 'linux-x86_64', 'macosx-10.4-x86_64']``, then when building the pex, then for any platform-dependent modules, Pants will include ``egg``\s for Linux (64-bit Intel), Mac OS X (version 10.4 or newer), and the current platform (whatever is being used when making the PEX). (default: ()) provides = ..., The `setup_py <#setup_py>`_ to publish that represents this target outside the repo. (default: None) shebang = ..., Use this shebang for the generated pex. (default: None) sources = ..., Zero or one source files. If more than one file is required, it should be put in a python_library which should be added to dependencies. (default: None) tags = ..., (default: None) zip_safe = ..., whether or not this binary is safe to run in compacted (zip-file) form (default: True)
-
-
python_dist
: A Python distribution target that accepts a user-defined setup.py.-
compatibility = ..., either a string that represents interpreter compatibility for this target using the Requirement-style format, e.g. ``'CPython>=2.7,<3'`` (Select a CPython interpreter with version ``>=2.7`` AND version ``<3``) or a list of Requirement-style strings which will be OR'ed together. If the compatibility requirement is agnostic to interpreter class, using the example above, a Requirement-style compatibility constraint like '>=2.7,<3' (N.B.: not prefixed with CPython) can be used. (default: None) dependencies = ..., The addresses of targets that this target depends on. These dependencies may be ``python_library``-like targets (``python_library``, ``python_thrift_library``, ``resources`` and so forth) or ``python_requirement_library`` targets. (default: None) description = ..., (default: None) name = ..., no_cache = ..., (default: False) provides = ..., The `setup_py <#setup_py>`_ to publish that represents this target outside the repo. (default: None) setup_requires = ..., A list of python requirements to provide during the invocation of setup.py. (default: None) sources = ..., Files to "include". Paths are relative to the BUILD file's directory. (default: None) tags = ..., (default: None)
-
-
python_grpcio_library
: A Python library generated from Protocol Buffer IDL files.-
compatibility = ..., either a string that represents interpreter compatibility for this target using the Requirement-style format, e.g. ``'CPython>=2.7,<3'`` (Select a CPython interpreter with version ``>=2.7`` AND version ``<3``) or a list of Requirement-style strings which will be OR'ed together. If the compatibility requirement is agnostic to interpreter class, using the example above, a Requirement-style compatibility constraint like '>=2.7,<3' (N.B.: not prefixed with CPython) can be used. (default: None) dependencies = ..., The addresses of targets that this target depends on. These dependencies may be ``python_library``-like targets (``python_library``, ``python_thrift_library``, ``resources`` and so forth) or ``python_requirement_library`` targets. (default: None) description = ..., (default: None) name = ..., no_cache = ..., (default: False) provides = ..., The `setup_py <#setup_py>`_ to publish that represents this target outside the repo. (default: None) sources = ..., (default: None) tags = ..., (default: None)
-
-
python_library
: A Python library.-
:API: public
-
compatibility = ..., either a string that represents interpreter compatibility for this target using the Requirement-style format, e.g. ``'CPython>=2.7,<3'`` (Select a CPython interpreter with version ``>=2.7`` AND version ``<3``) or a list of Requirement-style strings which will be OR'ed together. If the compatibility requirement is agnostic to interpreter class, using the example above, a Requirement-style compatibility constraint like '>=2.7,<3' (N.B.: not prefixed with CPython) can be used. (default: None) dependencies = ..., The addresses of targets that this target depends on. These dependencies may be ``python_library``-like targets (``python_library``, ``python_thrift_library``, ``resources`` and so forth) or ``python_requirement_library`` targets. (default: None) description = ..., (default: None) name = ..., no_cache = ..., (default: False) provides = ..., The `setup_py <#setup_py>`_ to publish that represents this target outside the repo. (default: None) sources = ..., Files to "include". Paths are relative to the BUILD file's directory. (default: None) tags = ..., (default: None)
-
-
python_requirement_library
: A set of pip requirements.-
:API: public
-
dependencies = ..., (default: []) description = ..., (default: None) name = ..., no_cache = ..., (default: False) requirements = ..., pip requirements as `python_requirement <#python_requirement>`_\s. (default: None) tags = ..., (default: None)
-
-
python_tests
: Python tests.-
:API: public
-
compatibility = ..., either a string that represents interpreter compatibility for this target using the Requirement-style format, e.g. ``'CPython>=2.7,<3'`` (Select a CPython interpreter with version ``>=2.7`` AND version ``<3``) or a list of Requirement-style strings which will be OR'ed together. If the compatibility requirement is agnostic to interpreter class, using the example above, a Requirement-style compatibility constraint like '>=2.7,<3' (N.B.: not prefixed with CPython) can be used. (default: None) coverage = ..., the module(s) whose coverage should be generated, e.g. 'twitter.common.log' or ['twitter.common.log', 'twitter.common.http'] (default: None) dependencies = ..., The addresses of targets that this target depends on. These dependencies may be ``python_library``-like targets (``python_library``, ``python_thrift_library``, ``resources`` and so forth) or ``python_requirement_library`` targets. (default: None) description = ..., (default: None) name = ..., no_cache = ..., (default: False) provides = ..., The `setup_py <#setup_py>`_ to publish that represents this target outside the repo. (default: None) sources = ..., Files to "include". Paths are relative to the BUILD file's directory. (default: None) tags = ..., (default: None) timeout = ..., A timeout (in seconds) which covers the total runtime of all tests in this target. Only applied if `--test-pytest-timeouts` is set to True. (default: None)
-
-
python_thrift_library
: A Python library generated from Thrift IDL files.-
:API: public
-
compatibility = ..., either a string that represents interpreter compatibility for this target using the Requirement-style format, e.g. ``'CPython>=2.7,<3'`` (Select a CPython interpreter with version ``>=2.7`` AND version ``<3``) or a list of Requirement-style strings which will be OR'ed together. If the compatibility requirement is agnostic to interpreter class, using the example above, a Requirement-style compatibility constraint like '>=2.7,<3' (N.B.: not prefixed with CPython) can be used. (default: None) dependencies = ..., The addresses of targets that this target depends on. These dependencies may be ``python_library``-like targets (``python_library``, ``python_thrift_library``, ``resources`` and so forth) or ``python_requirement_library`` targets. (default: None) description = ..., (default: None) name = ..., no_cache = ..., (default: False) provides = ..., The `setup_py <#setup_py>`_ to publish that represents this target outside the repo. (default: None) sources = ..., thrift source files (If more than one tries to use the same namespace, beware https://issues.apache.org/jira/browse/THRIFT-515) (default: None) tags = ..., (default: None)
-
-
remote_sources
: A target that generates a synthetic target using deferred sources.-
This provides a mechanism for using the contents of a jar as sources for another target. The jar
where the sources are specified from is given via the `sources_target` parameter, and the type
for the target that should be created with those sources is given via the `dest` parameter. Any
additional arguments for the new target go into the `args` parameter.
-
args = ..., Any additional arguments necessary to construct the synthetic destination target (sources and dependencies are supplied automatically). (default: None) dependencies = ..., (default: []) description = ..., (default: None) dest = ..., The target type of the synthetic target to generate (eg, java_library). (default: None) name = ..., no_cache = ..., (default: False) sources_target = ..., The address of the (typically unpacked_jars) target to get sources from. (default: None) tags = ..., (default: None)
-
-
resources
: Resource files.-
Looking for loose files in your JVM application bundle? Those are `bundle <#bundle>`_\s.
Resources are files included in deployable units like Java jars or Python wheels and accessible
via language-specific APIs.
:API: public
-
dependencies = ..., (default: []) description = ..., (default: None) name = ..., no_cache = ..., (default: False) sources = ..., Files to "include". Paths are relative to the BUILD file's directory. (default: None) tags = ..., (default: None)
-
-
scala_library
: A Scala library.-
Normally has conceptually-related sources; invoking the ``compile`` goal
on this target compiles scala and generates classes. Invoking the ``bundle``
goal on this target creates a ``.jar``; but that's an unusual thing to do.
Instead, a ``jvm_binary`` might depend on this library; that binary is a
more sensible thing to bundle.
:API: public
-
= ..., class:`pants.backend.jvm.artifact.Artifact` provides: (default: None) *args = ..., None compiler_option_sets = ..., (default: None) dependencies = ..., (default: []) description = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) exports = ..., A list of exported targets, which will be accessible to dependents even with strict_deps turned on. A common use case is for library targets to to export dependencies that it knows its dependents will need. Then any dependents of that library target will have access to those dependencies even when strict_deps is True. Note: exports is transitive, which means dependents have access to the closure of exports. An example will be that if A exports B, and B exports C, then any targets that depends on A will have access to both B and C. (default: None) java_sources = ..., Java libraries this library has a *circular* dependency on. If you don't have the particular problem of circular dependencies forced by splitting interdependent java and scala into multiple targets, don't use this at all. Prefer using ``dependencies`` to express non-circular dependencies. (default: None) javac_plugin_args = ..., Map from javac plugin name to list of arguments for that plugin. (default: None) javac_plugins = ..., names of compiler plugins to use when compiling this target with javac. (default: None) name = ..., no_cache = ..., (default: False) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) provides = ..., (default: None) scalac_plugin_args = ..., (default: None) scalac_plugins = ..., (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) tags = ..., (default: None) zinc_file_manager = ..., Whether to use zinc provided file manager that allows transactional rollbacks, but in certain cases may conflict with user libraries. (default: None)
-
-
scalac_plugin
: A Scala compiler plugin.-
= ..., class:`pants.backend.jvm.artifact.Artifact` provides: (default: None) *args = ..., None classname = ..., The fully qualified plugin class name - required. (default: None) compiler_option_sets = ..., (default: None) dependencies = ..., (default: []) description = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) exports = ..., A list of exported targets, which will be accessible to dependents even with strict_deps turned on. A common use case is for library targets to to export dependencies that it knows its dependents will need. Then any dependents of that library target will have access to those dependencies even when strict_deps is True. Note: exports is transitive, which means dependents have access to the closure of exports. An example will be that if A exports B, and B exports C, then any targets that depends on A will have access to both B and C. (default: None) java_sources = ..., Java libraries this library has a *circular* dependency on. If you don't have the particular problem of circular dependencies forced by splitting interdependent java and scala into multiple targets, don't use this at all. Prefer using ``dependencies`` to express non-circular dependencies. (default: None) javac_plugin_args = ..., Map from javac plugin name to list of arguments for that plugin. (default: None) javac_plugins = ..., names of compiler plugins to use when compiling this target with javac. (default: None) name = ..., no_cache = ..., (default: False) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) plugin = ..., The name of the plugin. Defaults to name if not supplied. (default: None) provides = ..., (default: None) scalac_plugin_args = ..., (default: None) scalac_plugins = ..., (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) tags = ..., (default: None) zinc_file_manager = ..., Whether to use zinc provided file manager that allows transactional rollbacks, but in certain cases may conflict with user libraries. (default: None)
-
-
target
: A generic target used to group dependencies.-
The baseclass for all pants targets.
Handles registration of a target amongst all parsed targets as well as location of the target
parse context.
:API: public
-
dependencies = ..., (default: []) description = ..., (default: None) name = ..., no_cache = ..., (default: False) tags = ..., (default: None)
-
-
unpacked_jars
: A set of sources extracted from JAR files.-
:API: public
-
dependencies = ..., (default: []) description = ..., (default: None) exclude_patterns = ..., fileset patterns to exclude from the archive. Exclude patterns are processed before include_patterns. (default: None) include_patterns = ..., fileset patterns to include from the archive (default: None) intransitive = ..., Whether to unpack all resolved dependencies of the jars, or just the jars themselves. (default: False) libraries = ..., addresses of jar_library targets that specify the jars you want to unpack (default: None) name = ..., no_cache = ..., (default: False) tags = ..., (default: None)
-
-
unpacked_whls
: A set of sources extracted from wheel files.-
NB: Currently, wheels are always resolved for the 'current' platform.
:API: public
-
compatibility = ..., Python interpreter constraints used to create the pex for the requirement target. If unset, the default interpreter constraints are used. This argument is unnecessary unless the native code depends on libpython. (default: None) dependencies = ..., (default: []) description = ..., (default: None) exclude_patterns = ..., fileset patterns to exclude from the archive. Exclude patterns are processed before include_patterns. (default: None) include_patterns = ..., fileset patterns to include from the archive (default: None) libraries = ..., addresses of python_requirement_library targets that specify the wheels you want to unpack (default: None) module_name = ..., The name of the specific python module containing headers and/or libraries to extract (e.g. 'tensorflow'). name = ..., no_cache = ..., (default: False) tags = ..., (default: None) within_data_subdir = ..., If True, descend into '<name>-<version>.data/' when matching `include_patterns`. For python wheels which declare any non-code data, this is usually needed to extract that without manually specifying the relative path, including the package version. For example, when `data_files` is used in a setup.py, `within_data_subdir=True` will allow specifying `include_patterns` matching exactly what is specified in the setup.py. (default: None)
-
Other BUILD Symbols
-
DirectoryReMapper
: A mapper that maps files relative to a base directory into a destination directory.-
base = ..., the relative path to get_buildroot() dest = ..., the dest path in the bundle
-
-
Duplicate
: A rule that indicates how duplicate entries should be handled when building a jar.-
apply_pattern = ..., A regular expression that matches duplicate jar entries this rule applies to. action = ..., An action to take to handle one or more duplicate entries. Must be one of: ``Duplicate.SKIP``, ``Duplicate.REPLACE``, ``Duplicate.CONCAT``, ``Duplicate.CONCAT_TEXT``, or ``Duplicate.FAIL``.
-
-
Skip
: A rule that skips adding matched entries to a jar.-
apply_pattern = ..., payload = ..., (default: None)
-
-
Wiki
: Identifies a wiki where pages can be published.-
name = ..., url_builder = ..., Function that accepts a page target and an optional wiki config dict.
-
-
artifact
: Represents a publishable jvm artifact ala maven or ivy.-
Used in the ``provides`` parameter to *jvm*\_library targets.
:API: public
-
org = ..., Organization of this artifact, or groupId in maven parlance. name = ..., Name of the artifact, or artifactId in maven parlance. repo = ..., The ``repo`` this artifact is published to. publication_metadata = ..., Optional extra publication metadata required by the ``repo``. (default: None)
-
-
buildfile_path
: <Add description> -
-
bundle
: A set of files to include in an application bundle.-
To learn about application bundles, see
`bundles <JVMProjects.html#jvm-bundles>`_.
Looking for Java-style resources accessible via the ``Class.getResource`` API?
Those are `resources <build_dictionary.html#resources>`_.
Files added to the bundle will be included when bundling an application target.
By default relative paths are preserved. For example, to include ``config``
and ``scripts`` directories: ::
bundles=[
bundle(fileset=[config/**/*', 'scripts/**/*', 'my.cfg']),
]
To include files relative to some path component use the ``relative_to`` parameter.
The following places the contents of ``common/config`` in a ``config`` directory
in the bundle. ::
bundles=[
bundle(relative_to='common', fileset=['common/config/*'])
]
-
rel_path = ..., Base path of the "source" file paths. By default, path of the BUILD file. Useful for assets that don't live in the source code repo. (default: None) mapper = ..., Function that takes a path string and returns a path string. Takes a path in the source tree, returns a path to use in the resulting bundle. By default, an identity mapper. (default: None) relative_to = ..., Set up a simple mapping from source path to bundle path. (default: None) fileset = ..., The set of files to include in the bundle. A string filename or a list of filenames/globs. E.g., ``relative_to='common'`` removes that prefix from all files in the application bundle. (default: None)
-
-
conan_requirement
: A specification for a conan package to be resolved against a remote repository.-
Example `pkg_spec`: 'lzo/2.10@twitter/stable'
The include and lib dirs default to 'include/' and 'lib/', but as this is a convention, they can
be overridden for the specific package to be resolved. See
https://docs.conan.io/en/latest/using_packages/conanfile_txt.html#imports for more info.
-
*args = ..., None pkg_spec = ..., A string specifying a conan package at a specific version, as per https://docs.conan.io/en/latest/using_packages/conanfile_txt.html#requires (default: None) include_relpath = ..., The relative path from the package root directory to where C/C++ headers are located. (default: None) lib_relpath = ..., The relative path from the package root directory to where native libraries are located. (default: None) lib_names = ..., Strings containing the libraries to add to the linker command line. Collected into the `native_lib_names` field of a `packaged_native_library()` target. (default: None)
-
-
contrib_setup_py
: <Add description>-
*args = ..., None
-
-
developer
: Corresponds to the maven POM <developer/> element.-
Refer to the schema here: http://maven.apache.org/maven-v4_0_0.xsd
-
user_id = ..., The user id of the developer; typically the one used to access the scm. (default: None) name = ..., The developer's full name. (default: None) email = ..., the developer's email address. (default: None) url = ..., An optional url pointing to more information about the developer. (default: None) organization = ..., An optional name for the organization the developer works on the library for. (default: None) organization_url = ..., An optional url pointing to more information about the developer's organization. (default: None) roles = ..., An optional list of role names that apply to this developer on this project. (default: None)
-
-
exclude
: Represents a dependency exclude pattern to filter transitive dependencies against.-
:API: public
-
org = ..., Organization of the artifact to filter, known as groupId in Maven parlance. name = ..., Name of the artifact to filter in the org, or filter everything if unspecified. (default: None)
-
-
get_buildroot
: Returns the Pants build root, calculating it if needed.-
:API: public
-
-
-
github
: Creates an `Scm` for a github repo.-
user = ..., The github user or organization name the repo is hosted under. repo = ..., The repository name.
-
-
intransitive
: Creates a dependency which is intransitive.-
This dependency will not be seen by dependees of this target. The syntax for this feature is
experimental and may change in the future.
-
address = ...,
-
-
jar
: A pre-built Maven repository dependency.-
Examples:
# The typical use case.
jar('com.puppycrawl.tools', 'checkstyle', '1.2')
# Test external dependency locally.
jar('org.foobar', 'foobar', '1.2-SNAPSHOT',
url='file:///Users/pantsdev/workspace/project/jars/checkstyle/checkstyle.jar')
# Test external dependency locally using relative path (with respect to the path
# of the belonging BUILD file)
jar('org.foobar', 'foobar', '1.2-SNAPSHOT',
url='file:../checkstyle/checkstyle.jar')
-
org = ..., The Maven ``groupId`` of this dependency. name = ..., The Maven ``artifactId`` of this dependency. rev = ..., The Maven ``version`` of this dependency. If unspecified the latest available version is used. (default: None) force = ..., Force this specific artifact revision even if other transitive dependencies specify a different revision. This requires specifying the ``rev`` parameter. (default: False) ext = ..., Extension of the artifact if different from the artifact type. This is sometimes needed for artifacts packaged with Maven bundle type but stored as jars. (default: None) url = ..., URL of this artifact, if different from the Maven repo standard location (specifying this parameter is unusual). Path of file URL can be either absolute or relative to the belonging BUILD file. (default: None) apidocs = ..., URL of existing javadocs, which if specified, pants-generated javadocs will properly hyperlink {\ @link}s. (default: None) classifier = ..., Classifier specifying the artifact variant to use. (default: None) mutable = ..., Inhibit caching of this mutable artifact. A common use is for Maven -SNAPSHOT style artifacts in an active development/integration cycle. (default: None) intransitive = ..., Declares this Dependency intransitive, indicating only the jar for the dependency itself should be downloaded and placed on the classpath (default: False) excludes = ..., Transitive dependencies of this jar to exclude. (default: None)
-
-
jar_rules
: A set of rules for packaging up a deploy jar.-
Deploy jars are executable jars with fully self-contained classpaths and as such, assembling them
presents problems given jar semantics.
One issue is signed jars that must be included on the
classpath. These have a signature that depends on the jar contents and assembly of the deploy jar
changes the content of the jar, breaking the signatures. For cases like these the signed jars
must be verified and then the signature information thrown away. The `Skip <#Skip>`_
rule supports this sort of issue by allowing outright entry exclusion in the final deploy jar.
Another issue is duplicate jar entries. Although the underlying zip format supports these, the
java jar tool and libraries do not. As such some action must be taken for each duplicate entry
such that there are no duplicates in the final deploy jar. The four
`Duplicate <#Duplicate>`_ rules support resolution of these cases by allowing 1st wins,
last wins, concatenation of the duplicate entry contents or raising an exception.
:API: public
-
rules = ..., One or more rules that will be applied in order to jar entries being packaged in a deploy jar. `Skip <#Skip>`_ rules can go here. (default: None) default_dup_action = ..., The default action to take when a duplicate entry is encountered and no explicit rules apply to the entry. (default: SKIP)
-
-
license
: Corresponds to the maven POM <license/> element.-
Refer to the schema here: http://maven.apache.org/maven-v4_0_0.xsd
-
name = ..., The full official name of the license. url = ..., An url pointing to the license text. comments = ..., Optional comments clarifying the license. (default: None)
-
-
managed_jar_libraries
: Creates a managed_jar_dependencies(), and also generates a jar_library for each artifact.-
Using this factory saves a lot of duplication. For example, this: ::
managed_jar_libraries(name='managed',
artifacts=[
jar('org.foobar', 'foobar', '1.2'),
jar('com.example', 'example', '8'),
],
)
Is equivalent to: ::
managed_jar_dependencies(name='managed',
artifacts=[
jar('org.foobar', 'foobar', '1.2'),
jar('com.example', 'example', '8'),
],
)
jar_library(name='org.foobar.foobar',
jars=[jar('org.foobar', 'foobar')],
managed_dependencies=':managed',
)
jar_library(name='com.example.example',
jars=[jar('com.example', 'example')],
managed_dependencies=':managed',
)
Which is also equivalent to: ::
managed_jar_dependencies(name='managed',
artifacts=[
':org.foobar.foobar',
':com.example.example',
],
)
jar_library(name='org.foobar.foobar',
jars=[jar('org.foobar', 'foobar')],
managed_dependencies=':managed',
)
jar_library(name='com.example.example',
jars=[jar('com.example', 'example')],
managed_dependencies=':managed',
)
-
name = ..., The optional name of the generated managed_jar_dependencies() target. (default: None) artifacts = ..., List of `jar <#jar>`_\s or specs to jar_library targets with pinned versions. Versions are pinned per (org, name, classifier, ext) artifact coordinate (excludes, etc are ignored for the purposes of pinning). (default: None)
-
-
native_artifact
: A BUILD file object declaring a target can be exported to other languages with a native-
ABI.
-
lib_name = ...,
-
-
netrc
: Fetches username and password from ~/.netrc for logged in user. -
-
ossrh
: Corresponds to the Sonatype required fields for jars published to OSSRH.-
See: http://central.sonatype.org/pages/requirements.html#sufficient-metadata
-
description = ..., A description of the library. url = ..., An url pointing to more information about the library. licenses = ..., The licenses that apply to the library. developers = ..., The developers who work on the library. scm = ..., The primary scm system hosting the library source code. name = ..., The optional full name of the library. If not supplied an appropriate name will be synthesized. (default: None)
-
-
pants_library
: <Add description>-
description = ...,
-
-
pants_requirement
: Exports a `python_requirement_library` pointing at the active pants' corresponding sdist.-
This requirement is useful for custom plugin authors who want to build and test their plugin with
pants itself. Using the resulting target as a dependency of their plugin target ensures the
dependency stays true to the surrounding repo's version of pants.
NB: The requirement generated is for official pants releases on pypi; so may not be appropriate
for use in a repo that tracks `pantsbuild/pants` or otherwise uses custom pants sdists.
:API: public
-
name = ..., The name to use for the target, defaults to the dist name if specified and otherwise the parent dir name. (default: None) dist = ..., The pants dist to create a requirement for. This must be a 'pantsbuild.pants*' distribution; eg: 'pantsbuild.pants.contrib.python.checks'. (default: None)
-
-
pants_setup_py
: Creates the setup_py for a Pants artifact.-
name = ..., The name of the package. description = ..., A brief description of what the package provides. additional_classifiers = ..., Any additional trove classifiers that apply to the package, see: https://pypi.org/pypi?%3Aaction=list_classifiers (default: None) kwargs = ..., Any additional keyword arguments to be passed to `setuptools.setup <https://pythonhosted.org/setuptools/setuptools.html>`_. (default: None)
-
-
pants_version
: Returns the pants semantic version number as a string: http://semver.org/ -
-
provided
: Creates an intransitive dependency with scope='compile test'.-
This mirrors the behavior of the "provided" scope found in other build systems, such as Gradle,
Maven, and IntelliJ.
The syntax for this feature is experimental and may change in the future.
-
address = ...,
-
-
public
: An artifact repository, such as a maven repo.-
:API: public
-
-
-
python_artifact
: Represents a Python setup.py-based project.-
kwargs = ..., Passed to `setuptools.setup <https://pythonhosted.org/setuptools/setuptools.html>`_. (default: None)
-
-
python_requirement
: A Pants wrapper around pkg_resources.Requirement.-
Describes an external dependency as understood by `pip`. It takes a single non-keyword argument
of the `Requirement`-style string, e.g.
python_requirement('django-celery')
python_requirement('tornado==2.2')
python_requirement('kombu>=2.1.1,<3.0')
Pants resolves the dependency _and_ its transitive closure*. For example, `django-celery` also
pulls down its dependencies: `celery>=2.5.1`, `django-picklefield>=0.2.0`, `ordereddict`,
`python-dateutil`, `kombu>=2.1.1,<3.0`, `anyjson>=0.3.1`, `importlib`, and `amqplib>=1.0`.
To let other Targets depend on this `python_requirement`, put it in a
`python_requirement_library`.
You may specify which modules the requirement provides through the `modules` parameter. If
unspecified, it will default to the name of the requirement, normalized to comply with Python
module names. This setting is important for Pants to know how to convert your import
statements back into your dependencies. For example:
python_requirement('ansicolors==1.0.0', modules=['colors'])
python_requirement('Django>2.0') # Defaults to `modules=['django']`.
:API: public
-
requirement = ..., name = ..., (default: None) repository = ..., (default: None) use_2to3 = ..., (default: False) compatibility = ..., (default: None)
-
-
python_requirements
: Translates a pip requirements file into an equivalent set of `python_requirement_library`-
targets.
If the `requirements.txt` file has lines `foo>=3.14` and `bar>=2.7`,
then this will translate to:
python_requirement_library(
name="foo",
requirements=[python_requirement("foo>=3.14")],
)
python_requirement_library(
name="bar",
requirements=[python_requirement("bar>=2.7")],
)
Note that some requirements files can't be unambiguously translated due to issues like multiple
find links. For these files, a ValueError will be raised that points out the issue.
See the requirements file spec here:
https://pip.pypa.io/en/latest/reference/pip_install.html#requirements-file-format
You may also use the parameter `module_mapping` to teach Pants what modules each of your
requirements provide. For any requirement unspecified, Pants will default to the name of the
requirement. This setting is important for Pants to know how to convert your import
statements back into your dependencies. For example:
python_requirements(
module_mapping={
"ansicolors": ["colors"],
"setuptools": ["pkg_resources"],
}
)
-
requirements_relpath = ..., The relpath from this BUILD file to the requirements file. Defaults to a `requirements.txt` file sibling to the BUILD file. (default: requirements.txt) module_mapping = ..., a mapping of requirement names to a list of the modules they provide. For example, `{"ansicolors": ["colors"]}`. Any unspecified requirements will use the requirement name as the default module, e.g. "Django" will default to `modules=["django"]`. (default: None)
-
-
repository
: An artifact repository, such as a maven repo.-
:API: public
-
name = ..., (default: None) url = ..., Optional URL of the repository. (default: None) push_db_basedir = ..., Push history file base directory. (default: None)
-
-
scala_artifact
: Extends Artifact to append the configured Scala version.-
:API: public
-
org = ..., Organization of this artifact, or groupId in maven parlance. name = ..., Name of the artifact, or artifactId in maven parlance. repo = ..., The ``repo`` this artifact is published to. publication_metadata = ..., Optional extra publication metadata required by the ``repo``. (default: None)
-
-
scala_exclude
: Similar to its superclass, represents a (set of) jar coordinates to exclude.-
Overrides the `name` of the exclusion to append the '--scala-platform-version'. This allows
for more natural consumption of cross-published scala libraries, which have their scala
version/platform appended to the artifact name.
:API: public
-
org = ..., Organization of the artifact to filter, known as groupId in Maven parlance. name = ..., Name of the artifact to filter in the org, or filter everything if unspecified. (default: None)
-
-
scala_jar
: A JarDependency with the configured '--scala-platform-version' automatically appended.-
This allows for more natural consumption of cross-published scala libraries, which have their
scala version/platform appended to the artifact name.
-
*args = ..., None
-
-
scm
: Corresponds to the maven POM <scm/> element.-
Refer to the schema here: http://maven.apache.org/maven-v4_0_0.xsd
-
connection = ..., The scm connection string for read-only access to the scm. developer_connection = ..., The scm connection string for read-write access to the scm. url = ..., An url pointing to a browseable web interface for the scm. tag = ..., An optional tag corresponding to the published release. This will be populated by pants during publish runs. (default: None)
-
-
scoped
: Creates a dependency with the given scope.-
For example, this makes the syntax:
```
jar_library(name='gson',
jars=[...],
)
target(name='foo',
dependencies=[
scoped(':gson', scope='runtime'),
],
)
```
Equivalent to:
```
jar_library(name='gson',
jars=[...],
)
target(name='gson-runtime',
dependencies=[
':gson',
],
scope='runtime',
)
target(name='foo',
dependencies=[
':gson-runtime',
],
)
```
The syntax for this feature is experimental and may change in the future.
-
address = ..., A target address. scope = ..., The scope of this dependency. (default: None)
-
-
setup_py
: Represents a Python setup.py-based project.-
kwargs = ..., Passed to `setuptools.setup <https://pythonhosted.org/setuptools/setuptools.html>`_. (default: None)
-
-
shading_exclude
: Creates a rule which excludes the given pattern from shading.-
Examples: ::
# Don't shade the org.foobar.example.Main class
shading_exclude('org.foobar.example.Main')
# Don't shade anything under org.foobar.example
shading_exclude('org.foobar.example.**')
-
pattern = ..., Any fully-qualified classname which matches this pattern will NOT be shaded. '*' is a wildcard that matches any individual package component, and '**' is a wildcard that matches any trailing pattern (ie the rest of the string).
-
-
shading_exclude_package
: Convenience constructor for a package exclusion rule.-
Essentially equivalent to just using ``shading_exclude('package_name.**')``.
-
package_name = ..., Package name to exclude (eg, ``org.pantsbuild.example``). recursive = ..., Whether to exclude everything under any subpackage of ``package_name``, or just direct children of the package. (Defaults to True). (default: True)
-
-
shading_keep
: Creates a rule which marks classes matching the given pattern as roots.-
If any keep rules are set, all classes that are not reachable from roots are removed from the
jar.
Examples: ::
# Only include classes reachable from Main.
shading_keep('org.foobar.example.Main')
# Only keep classes reachable from the example package.
shading_keep('org.foobar.example.*')
-
pattern = ..., Any fully-qualified classname which matches this pattern will be kept as a root. '*' is a wildcard that matches any individual package component, and '**' is a wildcard that matches any trailing pattern (ie the rest of the string).
-
-
shading_keep_package
: Convenience constructor for a package keep rule.-
Essentially equivalent to just using ``shading_keep('package_name.**')``.
-
package_name = ..., Package name to keep (eg, ``org.pantsbuild.example``). recursive = ..., Whether to keep everything under any subpackage of ``package_name``, or just direct children of the package. (Defaults to True). (default: True)
-
-
shading_relocate
: Creates a rule which shades jar entries from one pattern to another.-
Examples: ::
# Rename everything in the org.foobar.example package
# to __shaded_by_pants__.org.foobar.example.
shading_relocate('org.foobar.example.**')
# Rename org.foobar.example.Main to __shaded_by_pants__.org.foobar.example.Main
shading_relocate('org.foobar.example.Main')
# Rename org.foobar.example.Main to org.foobar.example.NotMain
shading_relocate('org.foobar.example.Main', 'org.foobar.example.NotMain')
# Rename all 'Main' classes under any direct subpackage of org.foobar.
shading_relocate('org.foobar.*.Main')
# Rename org.foobar package to com.barfoo package
shading_relocate('org.foobar.**', 'com.barfoo.@1')
# Rename everything in org.foobar.example package to __hello__.org.foobar.example
shading_relocate('org.foobar.example.**', shade_prefix='__hello__')
-
from_pattern = ..., Any fully-qualified classname which matches this pattern will be shaded. '*' is a wildcard that matches any individual package component, and '**' is a wildcard that matches any trailing pattern (ie the rest of the string). shade_pattern = ..., The shaded pattern to use, where ``@1``, ``@2``, ``@3``, etc are references to the groups matched by wildcards (groups are numbered from left to right). If omitted, this pattern is inferred from the input pattern, prefixed by the ``shade_prefix`` (if provided). (Eg, a ``from_pattern`` of ``com.*.foo.bar.**`` implies a default ``shade_pattern`` of ``__shaded_by_pants__.com.@1.foo.@2``) (default: None) shade_prefix = ..., Prefix to prepend when generating a ``shade_pattern`` (if a ``shade_pattern`` is not provided by the user). Defaults to '``__shaded_by_pants__.``'. (default: None)
-
-
shading_relocate_package
: Convenience constructor for a package relocation rule.-
Essentially equivalent to just using ``shading_relocate('package_name.**')``.
-
package_name = ..., Package name to shade (eg, ``org.pantsbuild.example``). shade_prefix = ..., Optional prefix to apply to the package. Defaults to ``__shaded_by_pants__.``. (default: None) recursive = ..., Whether to rename everything under any subpackage of ``package_name``, or just direct children of the package. (Defaults to True). (default: True)
-
-
shading_zap
: Creates a rule which removes matching classes from the jar.-
Examples: ::
# Remove the main class.
shading_zap('org.foobar.example.Main')
# Remove everything in the example package.
shading_keep('org.foobar.example.*')
-
pattern = ..., Any fully-qualified classname which matches this pattern will removed from the jar. '*' is a wildcard that matches any individual package component, and '**' is a wildcard that matches any trailing pattern (ie the rest of the string).
-
-
shading_zap_package
: Convenience constructor for a package zap rule.-
Essentially equivalent to just using ``shading_zap('package_name.**')``.
-
package_name = ..., Package name to remove (eg, ``org.pantsbuild.example``). recursive = ..., Whether to remove everything under any subpackage of ``package_name``, or just direct children of the package. (Defaults to True). (default: True)
-
-
testing
: An artifact repository, such as a maven repo.-
:API: public
-
-
-
wiki_artifact
: Binds a single documentation page to a wiki instance.-
This object allows you to specify which wiki a page should be published to, along with
additional wiki-specific parameters, such as the title, parent page, etc.
-
wiki = ..., target spec of a ``wiki``. kwargs = ..., a dictionary that may contain configuration directives for your particular wiki. For example, the following keys are supported for Atlassian's Confluence: * ``space`` -- A wiki space in which to place the page (used in Confluence) * ``title`` -- A title for the wiki page * ``parent`` -- The title of a wiki page that will denote this page as a child. (default: None)
-
Generated by publish_docs
from dist/reference/build_dictionary_body.html 2022-12-03T01:08:59.397831