python-setup
A Python environment.
Backend: ``
Config section: [python-setup]
Basic options
None
Advanced options
interpreter_constraints
--python-setup-interpreter-constraints="[<requirement>, <requirement>, ...]"
PANTS_PYTHON_SETUP_INTERPRETER_CONSTRAINTS
[python-setup]
interpreter_constraints = [
<requirement>,
<requirement>,
...,
]
[ "CPython>=3.6" ]
Constrain the selected Python interpreter. Specify with requirement syntax, e.g. 'CPython>=2.7,<3' (A CPython interpreter with version >=2.7 AND version <3)or 'PyPy' (A pypy interpreter of any version). Multiple constraint strings will be ORed together. These constraints are used as the default value for the compatibility
field of Python targets.
interpreter_search_paths
--python-setup-interpreter-search-paths="[<binary-paths>, <binary-paths>, ...]"
PANTS_PYTHON_SETUP_INTERPRETER_SEARCH_PATHS
[python-setup]
interpreter_search_paths = [
<binary-paths>,
<binary-paths>,
...,
]
[ "<PYENV>", "<PATH>" ]
A list of paths to search for Python interpreters that match your project's interpreter constraints. You can specify absolute paths to interpreter binaries and/or to directories containing interpreter binaries. The order of entries does not matter. The following special strings are supported:
- "<PATH>", the contents of the PATH env var
- "<PYENV>", all Python versions under $(pyenv root)/versions
- "<PYENV_LOCAL>", the Pyenv interpreter with the version in BUILD_ROOT/.python-version
- "<PEXRC>", paths in the PEX_PYTHON_PATH variable in /etc/pexrc or ~/.pexrc
requirement_constraints
--python-setup-requirement-constraints=<file_option>
PANTS_PYTHON_SETUP_REQUIREMENT_CONSTRAINTS
[python-setup]
requirement_constraints = <file_option>
None
When resolving third-party requirements, use this constraints file to determine which versions to use. See https://pip.pypa.io/en/stable/user_guide/#constraints-files for more information on the format of constraint files and how constraints are applied in Pex and pip.
resolve_all_constraints
--python-setup-resolve-all-constraints=<ResolveAllConstraintsOption>
PANTS_PYTHON_SETUP_RESOLVE_ALL_CONSTRAINTS
[python-setup]
resolve_all_constraints = <ResolveAllConstraintsOption>
never, nondeployables, always
default:
nondeployables
If set, and the requirements of the code being operated on are a subset of the constraints file, then the entire constraints file will be used instead of the subset. If unset, or any requirement of the code being operated on is not in the constraints file, each subset will be independently resolved as needed, which is more correct - work is only invalidated if a requirement it actually depends on changes - but also a lot slower, due to the extra resolving.
never
will always use proper subsets, regardless of the goal being run.nondeployables
will use proper subsets for./pants package
, but otherwise attempt to use a single resolve.always
will always attempt to use a single resolve.
Requires [python-setup].requirement_constraints to be set.
resolver_http_cache_ttl
--python-setup-resolver-http-cache-ttl=<int>
PANTS_PYTHON_SETUP_RESOLVER_HTTP_CACHE_TTL
[python-setup]
resolver_http_cache_ttl = <int>
3600
The maximum time (in seconds) for items in the HTTP cache. When the cache expires,the PEX resolver will make network requests to see if new versions of your requirements are available.
resolver_jobs
--python-setup-resolver-jobs=<int>
PANTS_PYTHON_SETUP_RESOLVER_JOBS
[python-setup]
resolver_jobs = <int>
32
The maximum number of concurrent jobs to build wheels with. Because Pants can run multiple subprocesses in parallel, the maximum total parallelism will be --process-execution-{local,remote}-parallelism x --python-setup-resolver-jobs
. Setting this option higher may result in better parallelism, but, if set too high, may result in starvation and Out of Memory errors.
resolver_manylinux
--python-setup-resolver-manylinux=<str>
PANTS_PYTHON_SETUP_RESOLVER_MANYLINUX
[python-setup]
resolver_manylinux = <str>
manylinux2014
Whether to allow resolution of manylinux wheels when resolving requirements for foreign linux platforms. The value should be a manylinux platform upper bound, e.g.: 'manylinux2010', or else the string 'no' to disallow.
Deprecated options
interpreter_cache_dir
--python-setup-interpreter-cache-dir=<dir>
PANTS_PYTHON_SETUP_INTERPRETER_CACHE_DIR
[python-setup]
interpreter_cache_dir = <dir>
None
Deprecated, will be removed in version: 2.1.0.dev0.
The option `--python-setup-interpreter-cache-dir` does not do anything anymore.Instead, use the global option `--named-caches-dir`.
The parent directory for the interpreter cache. If unspecified, a standard path under the workdir is used.
platforms
--python-setup-platforms="[<platform>, <platform>, ...]"
PANTS_PYTHON_SETUP_PLATFORMS
[python-setup]
platforms = [
<platform>,
<platform>,
...,
]
[ "current" ]
Deprecated, will be removed in version: 2.1.0.dev0.
The option `--python-setup-platforms` does not do anything anymore. Instead, explicitly set the `platforms` field on each `pex_binary` target.
A list of platforms to be supported by this Python environment. Each platformis a string, as returned by pkg_resources.get_supported_platform().
resolver_allow_prereleases
--[no-]python-setup-resolver-allow-prereleases
PANTS_PYTHON_SETUP_RESOLVER_ALLOW_PRERELEASES
[python-setup]
resolver_allow_prereleases = <bool>
None
Deprecated, will be removed in version: 2.1.0.dev0.
The option `--python-setup-resolver-allow-prereleases` does not no anything. To use a pre-release, explicitly use that pre-release version in your requirement string, e.g. `my_dist==99.0.dev0`.
Whether to include pre-releases when resolving requirements.
resolver_cache_dir
--python-setup-resolver-cache-dir=<dir>
PANTS_PYTHON_SETUP_RESOLVER_CACHE_DIR
[python-setup]
resolver_cache_dir = <dir>
None
Deprecated, will be removed in version: 2.1.0.dev0.
The option `--python-setup-resolver-cache-dir` does not do anything anymore. Instead, use the global option `--named-caches-dir`.
The parent directory for the requirement resolver cache. If unspecified, a standard path under the workdir is used.
Related subsystems
None