fix(pypi): upgrade pip to 26.2.2 and pip-tools to 7.6.2 (#4310)

`pip` versions prior to 26.2.2 bundle an older `certifi` release that
still trusts the distrusted eMudhra (`emSign ECC Root CA - G3`) root
certificate when `pip` makes network requests during requirements
locking, sdist builds, or wheel fallback downloads.

Upgrade the internal `pip` dependency to 26.2.2 so `pip` uses the
updated `certifi` bundle, and upgrade `pip-tools` to 7.6.2 for
compatibility with `pip` 26.2.2.

Work towards #4299
diff --git a/MODULE.bazel b/MODULE.bazel
index d21e779..3be1187 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -38,6 +38,7 @@
     "pypi__pyproject_hooks",
     "pypi__setuptools",
     "pypi__tomli",
+    "pypi__typing_extensions",
     "pypi__wheel",
     "pypi__zipp",
     "rules_python_internal",
diff --git a/dev/update_deps/BUILD.bazel b/dev/update_deps/BUILD.bazel
index 2e72ad8..9f69996 100644
--- a/dev/update_deps/BUILD.bazel
+++ b/dev/update_deps/BUILD.bazel
@@ -59,6 +59,7 @@
         "REQUIREMENTS_TXT": "$(rlocationpath //python/private/pypi:requirements_txt)",
     },
     imports = ["../.."],
+    python_version = "3.10",
     visibility = ["//:__subpackages__"],
     deps = [
         ":args",
diff --git a/dev/update_deps/update_pip_deps.py b/dev/update_deps/update_pip_deps.py
index 020064a..5be3631 100755
--- a/dev/update_deps/update_pip_deps.py
+++ b/dev/update_deps/update_pip_deps.py
@@ -72,6 +72,8 @@
             "install",
             "--dry-run",
             "--ignore-installed",
+            "--only-binary=:all:",
+            "--platform=any",
             "--report",
             f"{tmp_path}",
             "-r",
diff --git a/news/4299.changed.md b/news/4299.changed.md
new file mode 100644
index 0000000..9396a6a
--- /dev/null
+++ b/news/4299.changed.md
@@ -0,0 +1,4 @@
+(pypi) Updated `pip` to `26.2.2`, `pip-tools` to `7.6.2`, and other internal
+dependencies used for `compile_pip_requirements`, building sdists in
+`whl_library`, and fetching wheels using `pip`
+([#4299](https://github.com/bazel-contrib/rules_python/issues/4299)).
diff --git a/python/private/pypi/deps.bzl b/python/private/pypi/deps.bzl
index 264446b..eb5e9b2 100644
--- a/python/private/pypi/deps.bzl
+++ b/python/private/pypi/deps.bzl
@@ -21,13 +21,13 @@
     # START: maintained by 'bazel run //dev/update_deps:update_pip_deps'
     (
         "pypi__build",
-        "https://files.pythonhosted.org/packages/c5/0d/84a4380f930db0010168e0aa7b7a8fed9ba1835a8fbb1472bc6d0201d529/build-1.4.0-py3-none-any.whl",
-        "6a07c1b8eb6f2b311b96fcbdbce5dab5fe637ffda0fd83c9cac622e927501596",
+        "https://files.pythonhosted.org/packages/ad/9b/9fb3585dabcd73a1b2a6267f63f62649347c9e6d072c9fde365b105abb2c/build-1.6.1-py3-none-any.whl",
+        "ecd351a4be9d35a9eaaba244a7687143c9c7d4aea6ac964e7e7ddab20cbcf4e7",
     ),
     (
         "pypi__click",
-        "https://files.pythonhosted.org/packages/98/78/01c019cdb5d6498122777c1a43056ebb3ebfeef2076d9d026bfe15583b2b/click-8.3.1-py3-none-any.whl",
-        "981153a64e25f12d547d3426c367a4857371575ee7ad18df2a6183ab0545b2a6",
+        "https://files.pythonhosted.org/packages/58/50/6c0d534c5f134586a8e1ba4e330569e32f057e33372ae556463212fb4cd3/click-8.5.0-py3-none-any.whl",
+        "255bc9599cf7748b4b1a446ccc735421bd08a2ae529a8b88597d3de5664ee360",
     ),
     (
         "pypi__colorama",
@@ -36,23 +36,23 @@
     ),
     (
         "pypi__importlib_metadata",
-        "https://files.pythonhosted.org/packages/fa/5e/f8e9a1d23b9c20a551a8a02ea3637b4642e22c2626e3a13a9a29cdea99eb/importlib_metadata-8.7.1-py3-none-any.whl",
-        "5a1f80bf1daa489495071efbb095d75a634cf28a8bc299581244063b53176151",
+        "https://files.pythonhosted.org/packages/b3/55/ecca97ae19075f1fac62def77731e7f535e6c1fb8f92ff08160c5e6dade8/importlib_metadata-9.0.1-py3-none-any.whl",
+        "bba5600596a7e21f3eef53281cf28d6a5195634d2f2b78ff9501a3272c6eaab0",
     ),
     (
         "pypi__installer",
-        "https://files.pythonhosted.org/packages/e5/ca/1172b6638d52f2d6caa2dd262ec4c811ba59eee96d54a7701930726bce18/installer-0.7.0-py3-none-any.whl",
-        "05d1933f0a5ba7d8d6296bb6d5018e7c94fa473ceb10cf198a92ccea19c27b53",
+        "https://files.pythonhosted.org/packages/d7/7a/63547a792a12148882205d79e07644091d5b7690f40c2bb9d41452a8bdc2/installer-1.1.0-py3-none-any.whl",
+        "f55f5728ff61d3dd54dbc5a397cf3f7307cb64b180c20b72afbebf01c9e2c8a0",
     ),
     (
         "pypi__more_itertools",
-        "https://files.pythonhosted.org/packages/a4/8e/469e5a4a2f5855992e425f3cb33804cc07bf18d48f2db061aec61ce50270/more_itertools-10.8.0-py3-none-any.whl",
-        "52d4362373dcf7c52546bc4af9a86ee7c4579df9a8dc268be0a2f949d376cc9b",
+        "https://files.pythonhosted.org/packages/e8/3d/1087453384dbde46a8c7f9356eead2c58be8a7bf156bca40243377c85715/more_itertools-11.1.0-py3-none-any.whl",
+        "4b65538ae22f6fed0ce4874efd317463a7489796a0939fa66824dd542125a192",
     ),
     (
         "pypi__packaging",
-        "https://files.pythonhosted.org/packages/b7/b9/c538f279a4e237a006a2c98387d081e9eb060d203d8ed34467cc0f0b9b53/packaging-26.0-py3-none-any.whl",
-        "b36f1fef9334a5588b4166f8bcd26a14e521f2b55e6b9de3aaa80d3ff7a37529",
+        "https://files.pythonhosted.org/packages/63/34/ba1c580383c9eada3711951fef0795c80b829a078d72188184bcab9dd527/packaging-26.3-py3-none-any.whl",
+        "d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c",
     ),
     (
         "pypi__pep517",
@@ -61,38 +61,43 @@
     ),
     (
         "pypi__pip",
-        "https://files.pythonhosted.org/packages/de/f0/c81e05b613866b76d2d1066490adf1a3dbc4ee9d9c839961c3fc8a6997af/pip-26.0.1-py3-none-any.whl",
-        "bdb1b08f4274833d62c1aa29e20907365a2ceb950410df15fc9521bad440122b",
+        "https://files.pythonhosted.org/packages/3f/06/3e4420302363fbb71be3c7f35ce042f54bfca330e3e66b3a2e3c4cca579f/pip-26.2.2-py3-none-any.whl",
+        "fd7f4dfa8190e014013b9f08f3e973f4e4c26ffd179a204895533a7254813a70",
     ),
     (
         "pypi__pip_tools",
-        "https://files.pythonhosted.org/packages/6e/74/59906d876c6cb1137f42a137164f2fe683b06283cde84bfcf7f5dd43970b/pip_tools-7.5.3-py3-none-any.whl",
-        "3aac0c473240ae90db7213c033401f345b05197293ccbdd2704e52e7a783785e",
+        "https://files.pythonhosted.org/packages/4b/68/f3bd09c53ed3159bb1349e1d5859ad1ea7755b8e4cd50174290e9e8cbb47/pip_tools-7.6.2-py3-none-any.whl",
+        "f37eb4b736859c2c30230e50977312c61918b7ef931071ff7811fd067715c25f",
     ),
     (
         "pypi__pyproject_hooks",
-        "https://files.pythonhosted.org/packages/bd/24/12818598c362d7f300f18e74db45963dbcb85150324092410c8b49405e42/pyproject_hooks-1.2.0-py3-none-any.whl",
-        "9e5c6bfa8dcc30091c74b0cf803c81fdd29d94f01992a7707bc97babb1141913",
+        "https://files.pythonhosted.org/packages/85/11/044d1ae1b4ec0d7af88ee5bc91e081be1022533032b906a7bdabdbb60977/pyproject_hooks-1.3.3-py3-none-any.whl",
+        "5fc53fdac9f7bd63fbcdc868fb5f90b4784d78a53a3d3388cd738b807441a20b",
     ),
     (
         "pypi__setuptools",
-        "https://files.pythonhosted.org/packages/e1/c6/76dc613121b793286a3f91621d7b75a2b493e0390ddca50f11993eadf192/setuptools-82.0.0-py3-none-any.whl",
-        "70b18734b607bd1da571d097d236cfcfacaf01de45717d59e6e04b96877532e0",
+        "https://files.pythonhosted.org/packages/ef/55/6dc6d6bb953bdfc52519a0059592c52b6e3b8ad51cf8256dffceb55b0610/setuptools-84.2.1-py3-none-any.whl",
+        "ca140b45d5325a9478f880e351484f62fef15f336462e449ca0c03c873d589c2",
     ),
     (
         "pypi__tomli",
-        "https://files.pythonhosted.org/packages/23/d1/136eb2cb77520a31e1f64cbae9d33ec6df0d78bdf4160398e86eec8a8754/tomli-2.4.0-py3-none-any.whl",
-        "1f776e7d669ebceb01dee46484485f43a4048746235e683bcdffacdf1fb4785a",
+        "https://files.pythonhosted.org/packages/60/3f/3e3f8fd0919249b0200c80fbc4f9a1e70be19f9883da71dfb7f8b9ab8aca/tomli-2.5.0-py3-none-any.whl",
+        "32a7b79ac57a2e83670ce329ccf675798bc5a2094783a63676866b70503f2e2b",
+    ),
+    (
+        "pypi__typing_extensions",
+        "https://files.pythonhosted.org/packages/49/d3/b8441a820a491ddfc024b0b0cf0393375b75ea13866d9c66727e54c2fc80/typing_extensions-4.16.0-py3-none-any.whl",
+        "481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8",
     ),
     (
         "pypi__wheel",
-        "https://files.pythonhosted.org/packages/87/22/b76d483683216dde3d67cba61fb2444be8d5be289bf628c13fc0fd90e5f9/wheel-0.46.3-py3-none-any.whl",
-        "4b399d56c9d9338230118d705d9737a2a468ccca63d5e813e2a4fc7815d8bc4d",
+        "https://files.pythonhosted.org/packages/2e/29/69cfbb602cd91690c55d38ba9fe53e6a7e76a6fa647bf38f19c138d25449/wheel-0.48.0-py3-none-any.whl",
+        "3217dcc807155e45db462d7ef2431f5ddda0d7273b700d05a67b271ceb1287ab",
     ),
     (
         "pypi__zipp",
-        "https://files.pythonhosted.org/packages/2e/54/647ade08bf0db230bfea292f893923872fd20be6ac6f53b2b936ba839d75/zipp-3.23.0-py3-none-any.whl",
-        "071652d6115ed432f5ce1d34c336c0adfd6a884660d1e9712a256d3d3bd4b14e",
+        "https://files.pythonhosted.org/packages/b8/44/7bd2007260da11cccca29ba2d4c345f1287aa663db38ee7cefeabf6386a5/zipp-4.1.2-py3-none-any.whl",
+        "b30cb6cd253122169c47de245ca24a86bac2a5d3802ba15bf7ba6414eb9e144d",
     ),
     # END: maintained by 'bazel run //dev/update_deps:update_pip_deps'
 ]
diff --git a/python/private/pypi/pip_compile.bzl b/python/private/pypi/pip_compile.bzl
index 1bec343..24fa6d5 100644
--- a/python/private/pypi/pip_compile.bzl
+++ b/python/private/pypi/pip_compile.bzl
@@ -156,6 +156,7 @@
         Label("@pypi__pyproject_hooks//:lib"),
         Label("@pypi__setuptools//:lib"),
         Label("@pypi__tomli//:lib"),
+        Label("@pypi__typing_extensions//:lib"),
         Label("@pypi__zipp//:lib"),
         Label("//python/runfiles:runfiles"),
     ] + extra_deps
diff --git a/python/private/pypi/requirements.txt b/python/private/pypi/requirements.txt
index 006ef21..2029a9b 100755
--- a/python/private/pypi/requirements.txt
+++ b/python/private/pypi/requirements.txt
@@ -10,5 +10,6 @@
 pip_tools >= 7.4.0
 setuptools
 tomli
+typing_extensions
 wheel
 zipp