Skip to main content
Version: 2.23 (prerelease)

pex


How Pants uses Pex to run Python subprocesses.

Backend: pants.backend.python.lint.yapf

Config section: [pex]

Basic options

emit_warnings

--[no-]pex-emit-warnings
PANTS_PEX_EMIT_WARNINGS
pants.toml
[pex]
emit_warnings = <bool>
default: False

If warnings from Pex should be logged by Pants to the console.

Note: Pants uses Pex internally in some ways that trigger some warnings at the moment, so enabling this may result in warnings not related to your code. See #20577 and #20586.

Advanced options

executable_search_paths

--pex-executable-search-paths="[<binary-paths>, <binary-paths>, ...]"
PANTS_PEX_EXECUTABLE_SEARCH_PATHS
pants.toml
[pex]
executable_search_paths = [
<binary-paths>,
<binary-paths>,
...,
]
default:
[
  "<PATH>"
]

The PATH value that will be used by the PEX subprocess and any subprocesses it spawns.

The special string "<PATH>" will expand to the contents of the PATH env var.

Can be overriden by fieldpex_executable_search_paths on local_environment, docker_environment, or remote_environmenttargets.
--[no-]pex-venv-use-symlinks
PANTS_PEX_VENV_USE_SYMLINKS
pants.toml
[pex]
venv_use_symlinks = <bool>
default: False

When possible, use venvs whose site-packages directories are populated with symlinks.

Enabling this can save space in the --named-caches-dir directory and lead to slightly faster execution times for Pants Python goals. Some distributions do not work with symlinked venvs though, so you may not be able to enable this optimization as a result.

verbosity

--pex-verbosity=<int>
PANTS_PEX_VERBOSITY
pants.toml
[pex]
verbosity = <int>
default: 0

Set the verbosity level of PEX logging, from 0 (no logging) up to 9 (max logging).

Deprecated options

None

None