chore: load specific bzl files instead of generic defs.bzl (#2483)

Update code and examples to load the object-specific bzl files instead
of the
generic `defs.bzl`. This is mostly for code hygiene, but came out of
trying to diagnose
why Bazel 9 workspace builds kept erroing with defs.bzl somehow related.
Removing
the internal usages of defs.bzl doesn't seem to fully fix it, but does
seem to eliminate
some errors, make some progress, and narrow down what's going on.

Work towards https://github.com/bazelbuild/rules_python/issues/2469
diff --git a/docs/getting-started.md b/docs/getting-started.md
index 9f52243..b3b5409 100644
--- a/docs/getting-started.md
+++ b/docs/getting-started.md
@@ -76,7 +76,7 @@
 load the core rules in your `BUILD` files with the following:
 
 ```starlark
-load("@rules_python//python:defs.bzl", "py_binary")
+load("@rules_python//python:py_binary.bzl", "py_binary")
 
 py_binary(
   name = "main",
diff --git a/docs/index.md b/docs/index.md
index 378aac2..dd2e147 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -67,7 +67,7 @@
 The core rules are currently available in Bazel as built-in symbols, but this
 form is deprecated. Instead, you should depend on rules_python in your
 `WORKSPACE` or `MODULE.bazel` file and load the Python rules from
-`@rules_python//python:defs.bzl` or load paths described in the API documentation.
+`@rules_python//python:<name>.bzl` or load paths described in the API documentation.
 
 A [buildifier](https://github.com/bazelbuild/buildtools/blob/master/buildifier/README.md)
 fix is available to automatically migrate `BUILD` and `.bzl` files to add the
diff --git a/examples/build_file_generation/BUILD.bazel b/examples/build_file_generation/BUILD.bazel
index 4d270dd..a378775 100644
--- a/examples/build_file_generation/BUILD.bazel
+++ b/examples/build_file_generation/BUILD.bazel
@@ -4,8 +4,10 @@
 # ruleset. When the symbol is loaded you can use the rule.
 load("@bazel_gazelle//:def.bzl", "gazelle")
 load("@pip//:requirements.bzl", "all_whl_requirements")
-load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test")
 load("@rules_python//python:pip.bzl", "compile_pip_requirements")
+load("@rules_python//python:py_binary.bzl", "py_binary")
+load("@rules_python//python:py_library.bzl", "py_library")
+load("@rules_python//python:py_test.bzl", "py_test")
 load("@rules_python_gazelle_plugin//manifest:defs.bzl", "gazelle_python_manifest")
 load("@rules_python_gazelle_plugin//modules_mapping:def.bzl", "modules_mapping")
 
diff --git a/examples/build_file_generation/random_number_generator/BUILD.bazel b/examples/build_file_generation/random_number_generator/BUILD.bazel
index 28370b4..c775500 100644
--- a/examples/build_file_generation/random_number_generator/BUILD.bazel
+++ b/examples/build_file_generation/random_number_generator/BUILD.bazel
@@ -1,4 +1,5 @@
-load("@rules_python//python:defs.bzl", "py_library", "py_test")
+load("@rules_python//python:py_library.bzl", "py_library")
+load("@rules_python//python:py_test.bzl", "py_test")
 
 py_library(
     name = "random_number_generator",
diff --git a/examples/bzlmod/BUILD.bazel b/examples/bzlmod/BUILD.bazel
index 054b957..df07385 100644
--- a/examples/bzlmod/BUILD.bazel
+++ b/examples/bzlmod/BUILD.bazel
@@ -9,7 +9,9 @@
 load("@pip//:requirements.bzl", "all_data_requirements", "all_requirements", "all_whl_requirements", "requirement")
 load("@python_3_9//:defs.bzl", py_test_with_transition = "py_test")
 load("@python_versions//3.10:defs.bzl", compile_pip_requirements_3_10 = "compile_pip_requirements")
-load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test")
+load("@rules_python//python:py_binary.bzl", "py_binary")
+load("@rules_python//python:py_library.bzl", "py_library")
+load("@rules_python//python:py_test.bzl", "py_test")
 
 # This stanza calls a rule that generates targets for managing pip dependencies
 # with pip-compile for a particular python version.
diff --git a/examples/bzlmod/entry_points/tests/BUILD.bazel b/examples/bzlmod/entry_points/tests/BUILD.bazel
index 5a65e9e..3c6e02a 100644
--- a/examples/bzlmod/entry_points/tests/BUILD.bazel
+++ b/examples/bzlmod/entry_points/tests/BUILD.bazel
@@ -1,5 +1,5 @@
 load("@bazel_skylib//rules:run_binary.bzl", "run_binary")
-load("@rules_python//python:defs.bzl", "py_test")
+load("@rules_python//python:py_test.bzl", "py_test")
 
 # Below are targets for testing the `py_console_script_binary` feature and are
 # not part of the example how to use the feature.
diff --git a/examples/bzlmod/libs/my_lib/BUILD.bazel b/examples/bzlmod/libs/my_lib/BUILD.bazel
index 2679d0e..77a0595 100644
--- a/examples/bzlmod/libs/my_lib/BUILD.bazel
+++ b/examples/bzlmod/libs/my_lib/BUILD.bazel
@@ -1,5 +1,5 @@
 load("@pip//:requirements.bzl", "requirement")
-load("@rules_python//python:defs.bzl", "py_library")
+load("@rules_python//python:py_library.bzl", "py_library")
 
 py_library(
     name = "my_lib",
diff --git a/examples/bzlmod/other_module/other_module/pkg/BUILD.bazel b/examples/bzlmod/other_module/other_module/pkg/BUILD.bazel
index 021c969..4fe3928 100644
--- a/examples/bzlmod/other_module/other_module/pkg/BUILD.bazel
+++ b/examples/bzlmod/other_module/other_module/pkg/BUILD.bazel
@@ -2,7 +2,7 @@
     "@python_3_11//:defs.bzl",
     py_binary_311 = "py_binary",
 )
-load("@rules_python//python:defs.bzl", "py_library")
+load("@rules_python//python:py_library.bzl", "py_library")
 
 py_library(
     name = "lib",
diff --git a/examples/bzlmod/runfiles/BUILD.bazel b/examples/bzlmod/runfiles/BUILD.bazel
index add56b3..11a8ce0 100644
--- a/examples/bzlmod/runfiles/BUILD.bazel
+++ b/examples/bzlmod/runfiles/BUILD.bazel
@@ -1,4 +1,4 @@
-load("@rules_python//python:defs.bzl", "py_test")
+load("@rules_python//python:py_test.bzl", "py_test")
 
 py_test(
     name = "runfiles_test",
diff --git a/examples/bzlmod/tests/BUILD.bazel b/examples/bzlmod/tests/BUILD.bazel
index 96e4cdd..dd50cf3 100644
--- a/examples/bzlmod/tests/BUILD.bazel
+++ b/examples/bzlmod/tests/BUILD.bazel
@@ -2,7 +2,8 @@
 load("@python_versions//3.11:defs.bzl", py_binary_3_11 = "py_binary", py_test_3_11 = "py_test")
 load("@python_versions//3.9:defs.bzl", py_binary_3_9 = "py_binary", py_test_3_9 = "py_test")
 load("@pythons_hub//:versions.bzl", "MINOR_MAPPING")
-load("@rules_python//python:defs.bzl", "py_binary", "py_test")
+load("@rules_python//python:py_binary.bzl", "py_binary")
+load("@rules_python//python:py_test.bzl", "py_test")
 load("@rules_python//python/config_settings:transition.bzl", py_versioned_binary = "py_binary", py_versioned_test = "py_test")
 load("@rules_shell//shell:sh_test.bzl", "sh_test")
 
diff --git a/examples/bzlmod/whl_mods/BUILD.bazel b/examples/bzlmod/whl_mods/BUILD.bazel
index 241d9c1..7c5ab50 100644
--- a/examples/bzlmod/whl_mods/BUILD.bazel
+++ b/examples/bzlmod/whl_mods/BUILD.bazel
@@ -1,4 +1,4 @@
-load("@rules_python//python:defs.bzl", "py_test")
+load("@rules_python//python:py_test.bzl", "py_test")
 
 exports_files(
     glob(["data/**"]),
diff --git a/examples/bzlmod_build_file_generation/BUILD.bazel b/examples/bzlmod_build_file_generation/BUILD.bazel
index 33d01f4..a004766 100644
--- a/examples/bzlmod_build_file_generation/BUILD.bazel
+++ b/examples/bzlmod_build_file_generation/BUILD.bazel
@@ -7,8 +7,10 @@
 # requirements.
 load("@bazel_gazelle//:def.bzl", "gazelle")
 load("@pip//:requirements.bzl", "all_whl_requirements")
-load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test")
 load("@rules_python//python:pip.bzl", "compile_pip_requirements")
+load("@rules_python//python:py_binary.bzl", "py_binary")
+load("@rules_python//python:py_library.bzl", "py_library")
+load("@rules_python//python:py_test.bzl", "py_test")
 load("@rules_python_gazelle_plugin//manifest:defs.bzl", "gazelle_python_manifest")
 load("@rules_python_gazelle_plugin//modules_mapping:def.bzl", "modules_mapping")
 
diff --git a/examples/bzlmod_build_file_generation/other_module/other_module/pkg/BUILD.bazel b/examples/bzlmod_build_file_generation/other_module/other_module/pkg/BUILD.bazel
index 9a130e3..90d41e7 100644
--- a/examples/bzlmod_build_file_generation/other_module/other_module/pkg/BUILD.bazel
+++ b/examples/bzlmod_build_file_generation/other_module/other_module/pkg/BUILD.bazel
@@ -1,4 +1,4 @@
-load("@rules_python//python:defs.bzl", "py_library")
+load("@rules_python//python:py_library.bzl", "py_library")
 
 py_library(
     name = "lib",
diff --git a/examples/bzlmod_build_file_generation/runfiles/BUILD.bazel b/examples/bzlmod_build_file_generation/runfiles/BUILD.bazel
index 3503ac3..8806668 100644
--- a/examples/bzlmod_build_file_generation/runfiles/BUILD.bazel
+++ b/examples/bzlmod_build_file_generation/runfiles/BUILD.bazel
@@ -1,4 +1,4 @@
-load("@rules_python//python:defs.bzl", "py_test")
+load("@rules_python//python:py_test.bzl", "py_test")
 
 # gazelle:ignore
 py_test(
diff --git a/examples/multi_python_versions/libs/my_lib/BUILD.bazel b/examples/multi_python_versions/libs/my_lib/BUILD.bazel
index 8c29f60..7ff6224 100644
--- a/examples/multi_python_versions/libs/my_lib/BUILD.bazel
+++ b/examples/multi_python_versions/libs/my_lib/BUILD.bazel
@@ -1,5 +1,5 @@
 load("@pypi//:requirements.bzl", "requirement")
-load("@rules_python//python:defs.bzl", "py_library")
+load("@rules_python//python:py_library.bzl", "py_library")
 
 py_library(
     name = "my_lib",
diff --git a/examples/multi_python_versions/tests/BUILD.bazel b/examples/multi_python_versions/tests/BUILD.bazel
index 177de22..d04ac6b 100644
--- a/examples/multi_python_versions/tests/BUILD.bazel
+++ b/examples/multi_python_versions/tests/BUILD.bazel
@@ -6,7 +6,8 @@
 load("@python//3.8:defs.bzl", py_binary_3_8 = "py_binary", py_test_3_8 = "py_test")
 load("@python//3.9:defs.bzl", py_binary_3_9 = "py_binary", py_test_3_9 = "py_test")
 load("@pythons_hub//:versions.bzl", "MINOR_MAPPING", "PYTHON_VERSIONS")
-load("@rules_python//python:defs.bzl", "py_binary", "py_test")
+load("@rules_python//python:py_binary.bzl", "py_binary")
+load("@rules_python//python:py_test.bzl", "py_test")
 load("@rules_python//python:versions.bzl", DEFAULT_MINOR_MAPPING = "MINOR_MAPPING", DEFAULT_TOOL_VERSIONS = "TOOL_VERSIONS")
 load("@rules_python//python/private:text_util.bzl", "render")  # buildifier: disable=bzl-visibility
 load("@rules_shell//shell:sh_test.bzl", "sh_test")
diff --git a/examples/pip_parse/BUILD.bazel b/examples/pip_parse/BUILD.bazel
index fd744a2..8bdbd94 100644
--- a/examples/pip_parse/BUILD.bazel
+++ b/examples/pip_parse/BUILD.bazel
@@ -1,11 +1,12 @@
-load("@rules_python//python:defs.bzl", "py_binary", "py_test")
 load("@rules_python//python:pip.bzl", "compile_pip_requirements")
+load("@rules_python//python:py_binary.bzl", "py_binary")
+load("@rules_python//python:py_test.bzl", "py_test")
 load("@rules_python//python/entry_points:py_console_script_binary.bzl", "py_console_script_binary")
 
 # Toolchain setup, this is optional.
 # Demonstrate that we can use the same python interpreter for the toolchain and executing pip in pip install (see WORKSPACE).
 #
-#load("@rules_python//python:defs.bzl", "py_runtime_pair")
+#load("@rules_python//python:py_runtime_pair.bzl", "py_runtime_pair")
 #
 #py_runtime(
 #    name = "python3_runtime",
diff --git a/examples/pip_parse_vendored/BUILD.bazel b/examples/pip_parse_vendored/BUILD.bazel
index e2b1f5d..8d81e4b 100644
--- a/examples/pip_parse_vendored/BUILD.bazel
+++ b/examples/pip_parse_vendored/BUILD.bazel
@@ -1,8 +1,8 @@
 load("@bazel_skylib//rules:build_test.bzl", "build_test")
 load("@bazel_skylib//rules:diff_test.bzl", "diff_test")
 load("@bazel_skylib//rules:write_file.bzl", "write_file")
-load("@rules_python//python:defs.bzl", "py_test")
 load("@rules_python//python:pip.bzl", "compile_pip_requirements")
+load("@rules_python//python:py_test.bzl", "py_test")
 load("//:requirements.bzl", "all_data_requirements", "all_requirements", "all_whl_requirements", "requirement")
 
 # This rule adds a convenient way to update the requirements.txt
diff --git a/examples/pip_repository_annotations/BUILD.bazel b/examples/pip_repository_annotations/BUILD.bazel
index bdf9df1..4e10c51 100644
--- a/examples/pip_repository_annotations/BUILD.bazel
+++ b/examples/pip_repository_annotations/BUILD.bazel
@@ -1,5 +1,5 @@
-load("@rules_python//python:defs.bzl", "py_test")
 load("@rules_python//python:pip.bzl", "compile_pip_requirements")
+load("@rules_python//python:py_test.bzl", "py_test")
 
 exports_files(
     glob(["data/**"]),
diff --git a/examples/py_proto_library/BUILD.bazel b/examples/py_proto_library/BUILD.bazel
index 0158aa2..d782fb2 100644
--- a/examples/py_proto_library/BUILD.bazel
+++ b/examples/py_proto_library/BUILD.bazel
@@ -1,4 +1,4 @@
-load("@rules_python//python:defs.bzl", "py_test")
+load("@rules_python//python:py_test.bzl", "py_test")
 
 py_test(
     name = "pricetag_test",
diff --git a/examples/wheel/BUILD.bazel b/examples/wheel/BUILD.bazel
index 1eaf035..58a4301 100644
--- a/examples/wheel/BUILD.bazel
+++ b/examples/wheel/BUILD.bazel
@@ -15,9 +15,10 @@
 load("@bazel_skylib//rules:build_test.bzl", "build_test")
 load("@bazel_skylib//rules:write_file.bzl", "write_file")
 load("//examples/wheel/private:wheel_utils.bzl", "directory_writer", "make_variable_tags")
-load("//python:defs.bzl", "py_library", "py_test")
 load("//python:packaging.bzl", "py_package", "py_wheel")
 load("//python:pip.bzl", "compile_pip_requirements")
+load("//python:py_library.bzl", "py_library")
+load("//python:py_test.bzl", "py_test")
 load("//python:versions.bzl", "gen_python_config_settings")
 load("//python/entry_points:py_console_script_binary.bzl", "py_console_script_binary")
 load("//python/private:bzlmod_enabled.bzl", "BZLMOD_ENABLED")  # buildifier: disable=bzl-visibility
diff --git a/examples/wheel/lib/BUILD.bazel b/examples/wheel/lib/BUILD.bazel
index 755818d..c182143 100644
--- a/examples/wheel/lib/BUILD.bazel
+++ b/examples/wheel/lib/BUILD.bazel
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-load("//python:defs.bzl", "py_library")
+load("//python:py_library.bzl", "py_library")
 
 package(default_visibility = ["//visibility:public"])
 
diff --git a/examples/wheel/private/BUILD.bazel b/examples/wheel/private/BUILD.bazel
index 3462d35..326fc35 100644
--- a/examples/wheel/private/BUILD.bazel
+++ b/examples/wheel/private/BUILD.bazel
@@ -1,4 +1,4 @@
-load("@rules_python//python:defs.bzl", "py_binary")
+load("@rules_python//python:py_binary.bzl", "py_binary")
 
 py_binary(
     name = "directory_writer",
diff --git a/python/private/proto/BUILD.bazel b/python/private/proto/BUILD.bazel
index 65c0944..222be40 100644
--- a/python/private/proto/BUILD.bazel
+++ b/python/private/proto/BUILD.bazel
@@ -30,7 +30,7 @@
     srcs = ["py_proto_library.bzl"],
     visibility = ["//python:__pkg__"],
     deps = [
-        "//python:defs_bzl",
+        "//python:py_info_bzl",
         "@rules_proto//proto:defs",
     ],
 )
diff --git a/python/private/proto/py_proto_library.bzl b/python/private/proto/py_proto_library.bzl
index ecb0938..ff2d3d2 100644
--- a/python/private/proto/py_proto_library.bzl
+++ b/python/private/proto/py_proto_library.bzl
@@ -15,7 +15,7 @@
 """The implementation of the `py_proto_library` rule and its aspect."""
 
 load("@rules_proto//proto:defs.bzl", "ProtoInfo", "proto_common")
-load("//python:defs.bzl", "PyInfo")
+load("//python:py_info.bzl", "PyInfo")
 load("//python/api:api.bzl", _py_common = "py_common")
 
 PY_PROTO_TOOLCHAIN = "@rules_python//python/proto:toolchain_type"
diff --git a/python/private/pypi/deps.bzl b/python/private/pypi/deps.bzl
index 8949ed4..c6691d7 100644
--- a/python/private/pypi/deps.bzl
+++ b/python/private/pypi/deps.bzl
@@ -100,7 +100,7 @@
 _GENERIC_WHEEL = """\
 package(default_visibility = ["//visibility:public"])
 
-load("@rules_python//python:defs.bzl", "py_library")
+load("@rules_python//python:py_library.bzl", "py_library")
 load("@rules_python//python/private:glob_excludes.bzl", "glob_excludes")
 
 py_library(
diff --git a/python/private/pypi/generate_group_library_build_bazel.bzl b/python/private/pypi/generate_group_library_build_bazel.bzl
index 54da066..571cfd6 100644
--- a/python/private/pypi/generate_group_library_build_bazel.bzl
+++ b/python/private/pypi/generate_group_library_build_bazel.bzl
@@ -25,7 +25,7 @@
 )
 
 _PRELUDE = """\
-load("@rules_python//python:defs.bzl", "py_library")
+load("@rules_python//python:py_library.bzl", "py_library")
 """
 
 _GROUP_TEMPLATE = """\
diff --git a/python/private/pypi/whl_installer/BUILD.bazel b/python/private/pypi/whl_installer/BUILD.bazel
index 5bce1a5..5fb6170 100644
--- a/python/private/pypi/whl_installer/BUILD.bazel
+++ b/python/private/pypi/whl_installer/BUILD.bazel
@@ -1,4 +1,5 @@
-load("//python:defs.bzl", "py_binary", "py_library")
+load("//python:py_binary.bzl", "py_binary")
+load("//python:py_library.bzl", "py_library")
 
 py_library(
     name = "lib",
diff --git a/python/private/whl_filegroup/BUILD.bazel b/python/private/whl_filegroup/BUILD.bazel
index 398b9af..b4246ca 100644
--- a/python/private/whl_filegroup/BUILD.bazel
+++ b/python/private/whl_filegroup/BUILD.bazel
@@ -1,5 +1,5 @@
 load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
-load("//python:defs.bzl", "py_binary")
+load("//python:py_binary.bzl", "py_binary")
 
 filegroup(
     name = "distribution",
diff --git a/python/python.bzl b/python/python.bzl
index 3e739ca..cfbf25b 100644
--- a/python/python.bzl
+++ b/python/python.bzl
@@ -14,11 +14,7 @@
 
 """Re-exports for some of the core Bazel Python rules.
 
-This file is deprecated; please use the exports in defs.bzl instead. This is to
-follow the new naming convention of putting core rules for a language
-underneath @rules_<LANG>//<LANG>:defs.bzl. The exports in this file will be
-disallowed in a future Bazel release by
-`--incompatible_load_python_rules_from_bzl`.
+This file is deprecated; please use the exports in `<name>.bzl` files instead.
 """
 
 def py_library(*args, **kwargs):
diff --git a/python/runfiles/BUILD.bazel b/python/runfiles/BUILD.bazel
index c1fc027..a541b29 100644
--- a/python/runfiles/BUILD.bazel
+++ b/python/runfiles/BUILD.bazel
@@ -12,8 +12,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-load("//python:defs.bzl", "py_library")
 load("//python:packaging.bzl", "py_wheel")
+load("//python:py_library.bzl", "py_library")
 load("//python/private:bzlmod_enabled.bzl", "BZLMOD_ENABLED")
 
 filegroup(
diff --git a/tests/base_rules/base_tests.bzl b/tests/base_rules/base_tests.bzl
index 3518e6f..8e0d10d 100644
--- a/tests/base_rules/base_tests.bzl
+++ b/tests/base_rules/base_tests.bzl
@@ -16,7 +16,7 @@
 load("@rules_testing//lib:analysis_test.bzl", "analysis_test")
 load("@rules_testing//lib:truth.bzl", "matching")
 load("@rules_testing//lib:util.bzl", "PREVENT_IMPLICIT_BUILDING_TAGS", rt_util = "util")
-load("//python:defs.bzl", "PyInfo")
+load("//python:py_info.bzl", "PyInfo")
 load("//python/private:reexports.bzl", "BuiltinPyInfo")  # buildifier: disable=bzl-visibility
 load("//tests/base_rules:util.bzl", pt_util = "util")
 load("//tests/support:py_info_subject.bzl", "py_info_subject")
diff --git a/tests/base_rules/py_binary/py_binary_tests.bzl b/tests/base_rules/py_binary/py_binary_tests.bzl
index 571955d..86a9548 100644
--- a/tests/base_rules/py_binary/py_binary_tests.bzl
+++ b/tests/base_rules/py_binary/py_binary_tests.bzl
@@ -13,7 +13,7 @@
 # limitations under the License.
 """Tests for py_binary."""
 
-load("//python:defs.bzl", "py_binary")
+load("//python:py_binary.bzl", "py_binary")
 load(
     "//tests/base_rules:py_executable_base_tests.bzl",
     "create_executable_tests",
diff --git a/tests/base_rules/py_library/py_library_tests.bzl b/tests/base_rules/py_library/py_library_tests.bzl
index 526735a..9b585b1 100644
--- a/tests/base_rules/py_library/py_library_tests.bzl
+++ b/tests/base_rules/py_library/py_library_tests.bzl
@@ -3,7 +3,8 @@
 load("@rules_testing//lib:analysis_test.bzl", "analysis_test")
 load("@rules_testing//lib:truth.bzl", "matching")
 load("@rules_testing//lib:util.bzl", rt_util = "util")
-load("//python:defs.bzl", "PyRuntimeInfo", "py_library")
+load("//python:py_library.bzl", "py_library")
+load("//python:py_runtime_info.bzl", "PyRuntimeInfo")
 load("//tests/base_rules:base_tests.bzl", "create_base_tests")
 load("//tests/base_rules:util.bzl", pt_util = "util")
 
diff --git a/tests/base_rules/py_test/py_test_tests.bzl b/tests/base_rules/py_test/py_test_tests.bzl
index 6bd31ed..d4d839b 100644
--- a/tests/base_rules/py_test/py_test_tests.bzl
+++ b/tests/base_rules/py_test/py_test_tests.bzl
@@ -15,7 +15,7 @@
 
 load("@rules_testing//lib:analysis_test.bzl", "analysis_test")
 load("@rules_testing//lib:util.bzl", rt_util = "util")
-load("//python:defs.bzl", "py_test")
+load("//python:py_test.bzl", "py_test")
 load(
     "//tests/base_rules:py_executable_base_tests.bzl",
     "create_executable_tests",
diff --git a/tests/load_from_macro/BUILD.bazel b/tests/load_from_macro/BUILD.bazel
index 00d7bf9..ecb5de5 100644
--- a/tests/load_from_macro/BUILD.bazel
+++ b/tests/load_from_macro/BUILD.bazel
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-load("//python:defs.bzl", "py_library")
+load("//python:py_library.bzl", "py_library")
 load(":tags.bzl", "TAGS")
 
 licenses(["notice"])
diff --git a/tests/pycross/BUILD.bazel b/tests/pycross/BUILD.bazel
index 52d1d18..e90b60e 100644
--- a/tests/pycross/BUILD.bazel
+++ b/tests/pycross/BUILD.bazel
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-load("//python:defs.bzl", "py_test")
+load("//python:py_test.bzl", "py_test")
 load("//third_party/rules_pycross/pycross/private:wheel_library.bzl", "py_wheel_library")  # buildifier: disable=bzl-visibility
 
 py_wheel_library(
diff --git a/tests/pypi/generate_group_library_build_bazel/generate_group_library_build_bazel_tests.bzl b/tests/pypi/generate_group_library_build_bazel/generate_group_library_build_bazel_tests.bzl
index a46aa41..a91f861 100644
--- a/tests/pypi/generate_group_library_build_bazel/generate_group_library_build_bazel_tests.bzl
+++ b/tests/pypi/generate_group_library_build_bazel/generate_group_library_build_bazel_tests.bzl
@@ -21,7 +21,7 @@
 
 def _test_simple(env):
     want = """\
-load("@rules_python//python:defs.bzl", "py_library")
+load("@rules_python//python:py_library.bzl", "py_library")
 
 
 ## Group vbap
@@ -62,7 +62,7 @@
 
 def _test_in_hub(env):
     want = """\
-load("@rules_python//python:defs.bzl", "py_library")
+load("@rules_python//python:py_library.bzl", "py_library")
 
 
 ## Group vbap
diff --git a/tests/pypi/whl_installer/BUILD.bazel b/tests/pypi/whl_installer/BUILD.bazel
index e25c4a0..040e4d7 100644
--- a/tests/pypi/whl_installer/BUILD.bazel
+++ b/tests/pypi/whl_installer/BUILD.bazel
@@ -1,4 +1,4 @@
-load("//python:defs.bzl", "py_test")
+load("//python:py_test.bzl", "py_test")
 
 alias(
     name = "lib",
diff --git a/tests/whl_filegroup/BUILD.bazel b/tests/whl_filegroup/BUILD.bazel
index 2176e9e..61c1aa4 100644
--- a/tests/whl_filegroup/BUILD.bazel
+++ b/tests/whl_filegroup/BUILD.bazel
@@ -1,9 +1,10 @@
 load("@bazel_skylib//rules:write_file.bzl", "write_file")
 load("@rules_cc//cc:cc_library.bzl", "cc_library")
 load("@rules_cc//cc:cc_test.bzl", "cc_test")
-load("//python:defs.bzl", "py_library", "py_test")
 load("//python:packaging.bzl", "py_package", "py_wheel")
 load("//python:pip.bzl", "whl_filegroup")
+load("//python:py_library.bzl", "py_library")
+load("//python:py_test.bzl", "py_test")
 load(":whl_filegroup_tests.bzl", "whl_filegroup_test_suite")
 
 whl_filegroup_test_suite(name = "whl_filegroup_tests")
diff --git a/third_party/rules_pycross/pycross/private/wheel_library.bzl b/third_party/rules_pycross/pycross/private/wheel_library.bzl
index 166e1d0..3d6ee32 100644
--- a/third_party/rules_pycross/pycross/private/wheel_library.bzl
+++ b/third_party/rules_pycross/pycross/private/wheel_library.bzl
@@ -16,7 +16,7 @@
 """Implementation of the py_wheel_library rule."""
 
 load("@bazel_skylib//lib:paths.bzl", "paths")
-load("//python:defs.bzl", "PyInfo")
+load("//python:py_info.bzl", "PyInfo")
 load(":providers.bzl", "PyWheelInfo")
 
 def _py_wheel_library_impl(ctx):
diff --git a/tools/BUILD.bazel b/tools/BUILD.bazel
index 4f42bcb..0fcce8f 100644
--- a/tools/BUILD.bazel
+++ b/tools/BUILD.bazel
@@ -11,7 +11,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-load("//python:defs.bzl", "py_binary")
+load("//python:py_binary.bzl", "py_binary")
 
 package(default_visibility = ["//visibility:public"])