Hey! These docs are for version 2.8, which is no longer officially supported. Click here for the latest version, 2.11!

dependencies

./pants dependencies [args]

List the dependencies of the input files/targets.

Config section: [dependencies]

Basic options

output_file

--dependencies-output-file=<path>
PANTS_DEPENDENCIES_OUTPUT_FILE
default: None

Output the goal's stdout to this file. If unspecified, outputs to stdout.


sep

--dependencies-sep=<separator>
PANTS_DEPENDENCIES_SEP
default: \n

String to use to separate lines in line-oriented output.


transitive

--[no-]dependencies-transitive
PANTS_DEPENDENCIES_TRANSITIVE
default: False

List all transitive dependencies. If unspecified, list direct dependencies only.


closed

--[no-]dependencies-closed
PANTS_DEPENDENCIES_CLOSED
default: False

Include the input targets in the output, along with the dependencies.


Advanced options

None

Deprecated options

type

--dependencies-type=<DependencyType>
PANTS_DEPENDENCIES_TYPE
one of: source, 3rdparty, source-and-3rdparty
default: source

Deprecated, will be removed in version: 2.9.0.dev0.
This option is misleading and not very useful. In the future there will be a more robust way of querying and filtering dependencies. Meanwhile you can get the list of requirement strings for a set of targets using something like

./pants dependencies ::
| xargs ./pants filter --target-type=python_requirement
| xargs ./pants peek | jq -r '.[][&quot;requirements&quot;][]'


Which types of dependencies to list, where source means source code dependencies and 3rdparty means third-party requirement strings.



Did this page help you?