//python:features.bzl

Allows detecting of rules_python features that aren’t easily detected.

typedef features

Information about features rules_python has implemented.

features.targets: dict[str, bool]

A map of public API targets available in rules_python for feature detection purposes.

Added in version 1.9.0.

features.headers_abi3: bool

True if the @rules_python//python/cc:current_py_cc_headers_abi3 target is available.

Added in version 1.7.0.

features.precompile: bool

True if the precompile attributes are available.

Added in version 0.33.0.

True if the PyInfo.venv_symlinks field is available.

Added in version 1.5.0.

features.uses_builtin_rules: bool

True if the rules are using the Bazel-builtin implementation.

Added in version 1.1.0.

features.version: str

The rules_python version. This is a semver format, e.g. X.Y.Z with optional trailing -rcN. For unreleased versions, it is an empty string.

Added in version 0.38.0.

features.zipapp_rules: bool

Whether the rules_python version has the py_zipapp_* rules

Added in version 1.9.0.