@@ -80,12 +80,12 @@ def is_standalone_interpreter(rctx, python_interpreter_path, *, logger = None):
8080 """Query a python interpreter target for whether or not it's a rules_rust provided toolchain
8181
8282 Args:
83- rctx ( repository_ctx): The repository rule's context object.
84- python_interpreter_path ( path): A path representing the interpreter.
83+ rctx: {type}` repository_ctx` The repository rule's context object.
84+ python_interpreter_path: {type}` path` A path representing the interpreter.
8585 logger: Optional logger to use for operations.
8686
8787 Returns:
88- bool: Whether or not the target is from a rules_python generated toolchain.
88+ {type}` bool` Whether or not the target is from a rules_python generated toolchain.
8989 """
9090
9191 # Only update the location when using a hermetic toolchain.
@@ -563,42 +563,43 @@ For more information see the official bazel docs
563563def python_register_toolchains (
564564 name ,
565565 python_version ,
566- distutils = None ,
567- distutils_content = None ,
568566 register_toolchains = True ,
569567 register_coverage_tool = False ,
570568 set_python_version_constraint = False ,
571- tool_versions = TOOL_VERSIONS ,
569+ tool_versions = None ,
572570 ** kwargs ):
573571 """Convenience macro for users which does typical setup.
574572
575- - Create a repository for each built-in platform like "python_linux_amd64 " -
573+ - Create a repository for each built-in platform like "python_3_8_linux_amd64 " -
576574 this repository is lazily fetched when Python is needed for that platform.
577575 - Create a repository exposing toolchains for each platform like
578576 "python_platforms".
579577 - Register a toolchain pointing at each platform.
578+
580579 Users can avoid this macro and do these steps themselves, if they want more
581580 control.
581+
582582 Args:
583- name: base name for all created repos, like "python38 ".
584- python_version: the Python version.
585- distutils: see the distutils attribute in the python_repository repository rule .
586- distutils_content: see the distutils_content attribute in the python_repository repository rule.
587- register_toolchains: Whether or not to register the downloaded toolchains.
588- register_coverage_tool: Whether or not to register the downloaded coverage tool to the toolchains.
589- NOTE: Coverage support using the toolchain is only supported in Bazel 6 and higher.
590-
591- set_python_version_constraint: When set to true, target_compatible_with for the toolchains will include a version constraint.
592- tool_versions: a dict containing a mapping of version with SHASUM and platform info. If not supplied, the defaults
593- in python/versions.bzl will be used.
594- **kwargs: passed to each python_repositories call.
583+ name: {type}`str` base name for all created repos, e.g. "python_3_8 ".
584+ python_version: {type}`str` the Python version.
585+ register_toolchains: {type}`bool` Whether or not to register the downloaded toolchains .
586+ register_coverage_tool: {type}`bool` Whether or not to register the
587+ downloaded coverage tool to the toolchains.
588+ set_python_version_constraint: {type}`bool` When set to `True`,
589+ `target_compatible_with` for the toolchains will include a version
590+ constraint.
591+ tool_versions: {type}`dict` contains a mapping of version with SHASUM
592+ and platform info. If not supplied, the defaults in
593+ python/versions.bzl will be used.
594+ **kwargs: passed to each {obj}`python_repository` call.
595595 """
596596
597597 if BZLMOD_ENABLED :
598598 # you cannot used native.register_toolchains when using bzlmod.
599599 register_toolchains = False
600600
601601 base_url = kwargs .pop ("base_url" , DEFAULT_RELEASE_BASE_URL )
602+ tool_versions = tool_versions or TOOL_VERSIONS
602603
603604 python_version = full_version (python_version )
604605
@@ -656,8 +657,6 @@ def python_register_toolchains(
656657 python_version = python_version ,
657658 release_filename = release_filename ,
658659 urls = urls ,
659- distutils = distutils ,
660- distutils_content = distutils_content ,
661660 strip_prefix = strip_prefix ,
662661 coverage_tool = coverage_tool ,
663662 ** kwargs
@@ -709,11 +708,11 @@ def python_register_multi_toolchains(
709708 """Convenience macro for registering multiple Python toolchains.
710709
711710 Args:
712- name: base name for each name in python_register_toolchains call.
713- python_versions: the Python version .
714- default_version: the default Python version. If not set, the first version in
715- python_versions is used.
716- **kwargs: passed to each python_register_toolchains call.
711+ name: {type}`str` base name for each name in {obj}` python_register_toolchains` call.
712+ python_versions: {type}`list[str]` the Python versions .
713+ default_version: {type}`str` the default Python version. If not set,
714+ the first version in python_versions is used.
715+ **kwargs: passed to each {obj}` python_register_toolchains` call.
717716 """
718717 if len (python_versions ) == 0 :
719718 fail ("python_versions must not be empty" )
0 commit comments