From f54b06a18f590be3cd08f3188dc72ba7bf27b613 Mon Sep 17 00:00:00 2001 From: thesayyn Date: Tue, 3 Sep 2024 10:05:19 -0700 Subject: [PATCH] docs --- docs/rules.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/rules.md b/docs/rules.md index e156893f..5d9d42ed 100644 --- a/docs/rules.md +++ b/docs/rules.md @@ -57,7 +57,7 @@ py_library_rule(name, name, binary, inject_env, python_shebang) +py_pex_binary(name, binary, inject_env, python_interpreter_constraints, python_shebang) Build a pex executable from a py_binary @@ -70,6 +70,7 @@ Build a pex executable from a py_binary | name | A unique name for this target. | Name | required | | | binary | - | Label | optional | None | | inject_env | Environment variables to set when running the pex binary. | Dictionary: String -> String | optional | {} | +| python_interpreter_constraints | Python interpreter versions this PEX binary is compatible with. A list of semver strings. The placeholder strings {major}, {minor}, {patch} can be used for gathering version information from the hermetic python toolchain.

For example, to enforce same interpreter version that Bazel uses, following can be used.

starlark py_pex_binary     python_interpreter_constraints = [       "CPython=={major}.{minor}.{patch}"     ] ) 
| List of strings | optional | ["CPython=={major}.{minor}.*"] | | python_shebang | - | String | optional | "#!/usr/bin/env python3" |