Environment Variables
- RULES_PYTHON_ADDITIONAL_INTERPRETER_ARGS
This variable allows for additional arguments to be provided to the Python interpreter at bootstrap time when the
bashbootstrap is used. IfRULES_PYTHON_ADDITIONAL_INTERPRETER_ARGSwere provided as-Xaaa, then the command would be:python -Xaaa /path/to/file.py
This feature is useful for the integration of debuggers. For example, it would be possible to configure
RULES_PYTHON_ADDITIONAL_INTERPRETER_ARGSto be set to/path/to/debugger.py --port 12344 --file, resulting in the command executed being:python /path/to/debugger.py --port 12345 --file /path/to/file.py
Added in version 1.3.0.
Changed in version 1.7.0: Support added for .
- RULES_PYTHON_BOOTSTRAP_VERBOSE
When
1, debug information about bootstrapping of a program is printed to stderr.
- RULES_PYTHON_BZLMOD_DEBUG
When
1, bzlmod extensions will print debug information about what they’re doing. This is mostly useful for development to debug errors.
- RULES_PYTHON_DEPRECATION_WARNINGS
When
1,rules_pythonwill warn users about deprecated functionality that will be removed in a subsequent majorrules_pythonversion. Defaults to0if unset.
- RULES_PYTHON_ENABLE_PYSTAR
When
1, therules_pythonStarlark implementation of the core rules is used instead of the Bazel-builtin rules. Note that this requires Bazel 7+. Defaults to1.Added in version 0.26.0: Defaults to
0if unspecified.Changed in version 0.40.0: The default became
1if unspecified
- RULES_PYTHON_ENABLE_PIPSTAR
When
1, therules_pythonStarlark implementation of the PyPI/pip integration is used instead of the legacy Python scripts.Added in version 1.5.0.
Changed in version 1.7.0: Flipped to be enabled by default.
- RULES_PYTHON_EXTRACT_ROOT
Directory to use as the root for creating files necessary for bootstrapping so that a binary can run.
Only applicable when
--venvs_use_declare_symlink=nois used.When set, a binary will attempt to find a unique, reusable, location within this directory for the files it needs to create to aid startup. The files may not be deleted upon program exit; it is the responsibility of the caller to ensure cleanup.
Manually specifying the directory is useful to lower the overhead of extracting/creating files on every program execution. By using a location outside /tmp, longer lived programs don’t have to worry about files in /tmp being cleaned up by the OS.
If not set, then a temporary directory will be created and deleted upon program exit.
Added in version 1.2.0.
- RULES_PYTHON_GAZELLE_VERBOSE
When
1, debug information from Gazelle is printed to stderr.
- RULES_PYTHON_PIP_ISOLATED
Determines if
--isolatedis used with pip.Valid values:
0andfalsemean to not use isolated modeOther non-empty values mean to use isolated mode.
- RULES_PYTHON_REPO_DEBUG
When
1, repository rules will print debug information about what they’re doing. This is mostly useful for development to debug errors.
- RULES_PYTHON_REPO_DEBUG_VERBOSITY
Determines the verbosity of logging output for repo rules. Valid values:
DEBUGFAILINFOTRACE
- RULES_PYTHON_REPO_TOOLCHAIN_VERSION_OS_ARCH
Determines the Python interpreter platform to be used for a particular interpreter
(version, os, arch)triple to be used in repository rules. Replace theVERSION_OS_ARCHpart with actual values when using, e.g.,3_13_0_linux_x86_64. The version values must have_instead of.and the os, arch values are the same as the ones mentioned in the//python:versions.bzlfile.
- VERBOSE_COVERAGE
When
1, debug information about coverage behavior is printed to stderr.