Global options
Options to control the overall behavior of Pants.
Backend: pants.core
Config section: [GLOBAL]
Basic options
level
-l=<LogLevel>, --level=<LogLevel>
PANTS_LEVEL
trace, debug, info, warn, error
default:
info
Set the logging level.
spec_files
--spec-files="['<str>', '<str>', ...]"
PANTS_SPEC_FILES
[]
Read additional specs (target addresses, files, and/or globs), one per line, from these files.
pantsd
--[no-]pantsd
PANTS_PANTSD
True
Enables use of the Pants daemon (pantsd). pantsd can significantly improve runtime performance by lowering per-run startup cost, and by memoizing filesystem operations and rule execution.
concurrent
--[no-]concurrent
PANTS_CONCURRENT
False
Enable concurrent runs of Pants. Without this enabled, Pants will start up all concurrent invocations (e.g. in other terminals) without pantsd. Enabling this option requires parallel Pants invocations to block on the first.
local_cache
--[no-]local-cache
PANTS_LOCAL_CACHE
True
Whether to cache process executions in a local cache persisted to disk at --local-store-dir
.
process_cleanup
--[no-]process-cleanup
PANTS_PROCESS_CLEANUP
True
If false, Pants will not clean up local directories used as chroots for running processes. Pants will log their location so that you can inspect the chroot, and run the __run.sh
script to recreate the process using the same argv and environment variables used by Pants. This option is useful for debugging.
keep_sandboxes
--keep-sandboxes=<KeepSandboxes>
PANTS_KEEP_SANDBOXES
always, on_failure, never
default:
never
Controls whether Pants will clean up local directories used as chroots for running processes.
Pants will log their location so that you can inspect the chroot, and run the __run.sh
script to recreate the process using the same argv and environment variables used by Pants. This option is useful for debugging.
remote_execution
--[no-]remote-execution
PANTS_REMOTE_EXECUTION
False
Enables remote workers for increased parallelism. (Alpha)
Alternatively, you can use --remote-cache-read
and --remote-cache-write
to still run everything locally, but to use a remote cache.
remote_cache_read
--[no-]remote-cache-read
PANTS_REMOTE_CACHE_READ
False
Whether to enable reading from a remote cache.
This cannot be used at the same time as --remote-execution
.
remote_cache_write
--[no-]remote-cache-write
PANTS_REMOTE_CACHE_WRITE
False
Whether to enable writing results to a remote cache.
This cannot be used at the same time as --remote-execution
.
colors
--[no-]colors
PANTS_COLORS
False
Whether Pants should use colors in output or not. This may also impact whether some tools Pants runs use color.
When unset, this value defaults based on whether the output destination supports color.
dynamic_ui
--[no-]dynamic-ui
PANTS_DYNAMIC_UI
True
Display a dynamically-updating console UI as Pants runs. This is true by default if Pants detects a TTY and there is no 'CI' environment variable indicating that Pants is running in a continuous integration environment.
dynamic_ui_renderer
--dynamic-ui-renderer=<DynamicUIRenderer>
PANTS_DYNAMIC_UI_RENDERER
indicatif-spinner, experimental-prodash
default:
indicatif-spinner
If --dynamic-ui
is enabled, selects the renderer.
tag
--tag="[[+-]tag1,tag2,..., [+-]tag1,tag2,..., ...]"
PANTS_TAG
[]
Include only targets with these tags (optional '+' prefix) or without these tags ('-' prefix). See https://www.pantsbuild.org/v2.13/docs/advanced-target-selection.
loop
--[no-]loop
PANTS_LOOP
False
Run goals continuously as file changes are detected.
use_deprecated_directory_cli_args_semantics
--[no-]use-deprecated-directory-cli-args-semantics
PANTS_USE_DEPRECATED_DIRECTORY_CLI_ARGS_SEMANTICS
True
If true, Pants will use the old, deprecated semantics for directory arguments like /home/josh/work/scie-pants/dist/scie-pants-linux-x86_64 test dir
: directories are shorthand for the target dir:dir
, i.e. the target that leaves off name=
.
If false, Pants will use the new semantics: directory arguments will match all files and targets in the directory, e.g. /home/josh/work/scie-pants/dist/scie-pants-linux-x86_64 test dir
will run all tests in dir
.
The new semantics will become the default in Pants 2.14, and the old semantics will be removed in 2.15.
This also impacts the behavior of the tailor
goal. If this option is true, /home/josh/work/scie-pants/dist/scie-pants-linux-x86_64 tailor
without additional arguments will run over the whole project, and /home/josh/work/scie-pants/dist/scie-pants-linux-x86_64 tailor dir
will run over dir
and all recursive sub-directories. If false, you must specify arguments, like /home/josh/work/scie-pants/dist/scie-pants-linux-x86_64 tailor ::
to run over the whole project; specifying a directory will only add targets for that directory.
use_deprecated_pex_binary_run_semantics
--[no-]use-deprecated-pex-binary-run-semantics
PANTS_USE_DEPRECATED_PEX_BINARY_RUN_SEMANTICS
True
If true
, run
ning a pex_binary
will run your firstparty code by copying sources to a sandbox (while still using a PEX for thirdparty dependencies). Additionally, you can refer to the pex_binary
using the value of its entry_point
field (if it is a filename).
If false
, run
ning a pex_binary
will build the PEX via package
and run it directly. This makes run
equivalent to using package
and running the artifact. Additionally, the binary must be run
using the pex_binary
's address, as passing a filename to run
will run the python_source
.
Note that support has been added to Pants to allow you to run
any python_source
, so setting this to true
should be reserved for maintaining backwards-compatibility with previous versions of Pants. Additionally, you can remove any pex_binary
targets that exist solely for running Python code (and aren't meant to be packaged).