@@ -758,45 +758,90 @@ def _pip_impl(module_ctx):
758758 return None
759759
760760_default_attrs = {
761- "arch_name" : attr .string (),
762- "constraint_values" : attr .label_list (),
763- "os_name" : attr .string (),
764- "platform" : attr .string (),
761+ "arch_name" : attr .string (
762+ doc = """\
763+ The CPU architecture name to be used.
764+
765+ :::{note}
766+ Either this or {attr}`env_platform_machine` should be specified.
767+ :::
768+ """ ,
769+ ),
770+ "constraint_values" : attr .label_list (
771+ doc = """\
772+ The list of labels to {obj}`constraint_value` that will be used in the `hub repository` when
773+ including python packages that are compatible with this platform.
774+ """ ,
775+ ),
776+ "os_name" : attr .string (
777+ doc = """\
778+ The OS name to be used.
779+
780+ :::{note}
781+ Either this or the appropriate `env_*` attributes should be specified.
782+ :::
783+ """ ,
784+ ),
785+ "platform" : attr .string (
786+ doc = """\
787+ A platform identifier which will be used as the unique identifier within the extension evaluation.
788+ If you are defining custom platforms in your project and don't want things to clash, use extension
789+ [isolation] feature.
790+
791+ [isolation]: https://bazel.build/rules/lib/globals/module#use_extension.isolate
792+ """ ,
793+ ),
765794 # TODO @aignas 2025-05-19: use the following
766795 "target_settings" : attr .label_list (
767796 doc = """\
768- A list of config_settings that must be satisfied by the target configuration in order for this
769- platform to be matched during analysis phase.
797+ A list of labels to {obj}`config_setting` targets that must be satisfied by the target
798+ configuration in order for this platform to be matched during analysis phase.
799+ """ ,
800+ ),
801+ "whl_limit" : attr .int (
802+ default = 1 ,
803+ doc = """\
804+ The limit of wheels that we are going to include per platform.
805+ """ ,
806+ ),
807+ "whl_platforms" : attr .string_list (
808+ doc = """\
809+ The platform_tag values to consider as supported for the target platforms.
810+
811+ For `manylinux` and `musllinux` platform tags, please use the `manylinux_x_y_<arch>`
812+ or `musllinux_x_y_<arch>` syntax.
770813""" ,
771814 ),
772815} | {
773816 # The values for PEP508 env marker evaluation during the lock file parsing
774- "env_implementation_name" : attr .string (),
775- "env_os_name" : attr .string (doc = "default will be inferred from {obj}`os_name`" ),
776- "env_platform_machine" : attr .string (doc = "default will be inferred from {obj}`arch_name`" ),
777- "env_platform_release" : attr .string (),
778- "env_platform_system" : attr .string (doc = "default will be inferred from {obj}`os_name`" ),
779- "env_platform_version" : attr .string (),
780- "env_sys_platform" : attr .string (),
817+ "env_implementation_name" : attr .string (
818+ doc = "Value for `implementation_name` to evaluate environment markers. Defaults to `cpython`." ,
819+ ),
820+ "env_os_name" : attr .string (
821+ doc = "Value for `os_name` to evaluate environment markers. Defaults to a value inferred from the {attr}`os_name`." ,
822+ ),
823+ "env_platform_machine" : attr .string (
824+ doc = "Value for `platform_machine` to evaluate environment markers. Defaults to a value inferred from the {attr}`arch_name`." ,
825+ ),
826+ "env_platform_release" : attr .string (
827+ doc = "Value for `platform_machine` to evaluate environment markers. Defaults to an empty value." ,
828+ ),
829+ "env_platform_system" : attr .string (
830+ doc = "Value for `platform_system` to evaluate environment markers. Defaults to a value inferred from the {attr}`os_name`." ,
831+ ),
832+ "env_platform_version" : attr .string (
833+ doc = "Value for `platform_machine` to evaluate environment markers. Defaults to `0`." ,
834+ ),
835+ "env_sys_platform" : attr .string (
836+ doc = "Value for `sys_platform` to evaluate environment markers. Defaults to a value inferred from the {attr}`os_name`." ,
837+ ),
781838 # TODO @aignas 2025-05-19: add wiring for the following
782839} | AUTH_ATTRS | {
783840 # TODO @aignas 2025-05-19: add wiring for the following
784- "extra_index_urls" : attr .string_list (),
785- "index_url" : attr .string (),
786- "index_url_overrides" : attr .string_dict (),
787- "simpleapi_skip" : attr .string_list (
788- doc = """\
789- The list of packages to skip fetching metadata for from SimpleAPI index. You should
790- normally not need this attribute, but in case you do, please report this as a bug
791- to `rules_python` and use this attribute until the bug is fixed.
792-
793- EXPERIMENTAL: this may be removed without notice.
794-
795- :::{versionadded} 1.4.0
796- :::
797- """ ,
798- ),
799- "whls_limit" : attr .int (default = - 1 ),
841+ # "extra_index_urls": attr.string_list(),
842+ # "index_url": attr.string(),
843+ # "index_url_overrides": attr.string_dict(),
844+ # "simpleapi_skip": attr.string_list(),
800845}
801846
802847# _configure_attrs = _default_attrs | {
@@ -1067,6 +1112,13 @@ the BUILD files for wheels.
10671112 This tag class allows for more customization of how the configuration for the hub repositories is built.
10681113
10691114This is still experimental and may be changed or removed without any notice.
1115+
1116+ :::{seealso}
1117+ The [environment markers][environment_markers] specification for the explanation of the
1118+ terms used in this extension.
1119+
1120+ [environment_markers]: https://packaging.python.org/en/latest/specifications/dependency-specifiers/#environment-markers
1121+ :::
10701122""" ,
10711123 ),
10721124 "override" : _override_tag ,
0 commit comments