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"
|