diff --git a/examples/multi_python_versions/.bazelrc b/examples/multi_python_versions/.bazelrc index 97a973bd85..7d3b2d91c3 100644 --- a/examples/multi_python_versions/.bazelrc +++ b/examples/multi_python_versions/.bazelrc @@ -5,3 +5,4 @@ build --enable_runfiles coverage --java_runtime_version=remotejdk_11 common:bazel7.x --incompatible_python_disallow_native_rules +common --incompatible_default_to_explicit_init_py diff --git a/examples/multi_python_versions/MODULE.bazel b/examples/multi_python_versions/MODULE.bazel index 82faaf8214..93abd73e6a 100644 --- a/examples/multi_python_versions/MODULE.bazel +++ b/examples/multi_python_versions/MODULE.bazel @@ -4,37 +4,39 @@ module( bazel_dep(name = "bazel_skylib", version = "1.7.1") bazel_dep(name = "rules_python", version = "0.0.0") +bazel_dep(name = "platforms", version = "0.0.11") + local_path_override( module_name = "rules_python", path = "../..", ) +uv = use_extension("@rules_python//python/uv:uv.bzl", "uv") +uv.configure(version = "0.12.1") + python = use_extension("@rules_python//python/extensions:python.bzl", "python") python.defaults( # The environment variable takes precedence if set. python_version = "3.10", python_version_env = "BAZEL_PYTHON_VERSION", ) -python.toolchain( - configure_coverage_tool = True, - python_version = "3.10", -) -python.toolchain( - configure_coverage_tool = True, - python_version = "3.11", -) -python.toolchain( - configure_coverage_tool = True, - python_version = "3.12", -) -python.toolchain( - configure_coverage_tool = True, - python_version = "3.13", -) -python.toolchain( - configure_coverage_tool = True, - python_version = "3.14", -) + +PYTHON_VERSIONS = [ + "3.10", + "3.11", + "3.12", + "3.13", + "3.14", +] + +[ + python.toolchain( + configure_coverage_tool = True, + python_version = v, + ) + for v in PYTHON_VERSIONS +] + use_repo( python, "pythons_hub", @@ -44,31 +46,14 @@ use_repo( pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") use_repo(pip, "pypi") -pip.parse( - hub_name = "pypi", - python_version = "3.10", - requirements_lock = "//requirements:requirements_lock_3_10.txt", -) -pip.parse( - hub_name = "pypi", - python_version = "3.11", - requirements_lock = "//requirements:requirements_lock_3_11.txt", -) -pip.parse( - hub_name = "pypi", - python_version = "3.12", - requirements_lock = "//requirements:requirements_lock_3_12.txt", -) -pip.parse( - hub_name = "pypi", - python_version = "3.13", - requirements_lock = "//requirements:requirements_lock_3_13.txt", -) -pip.parse( - hub_name = "pypi", - python_version = "3.14", - requirements_lock = "//requirements:requirements_lock_3_14.txt", -) +[ + pip.parse( + hub_name = "pypi_multi", + python_version = v, + requirements_lock = "//requirements:requirements.txt", + ) + for v in PYTHON_VERSIONS +] # example test dependencies bazel_dep(name = "rules_shell", version = "0.2.0", dev_dependency = True) diff --git a/examples/multi_python_versions/libs/my_lib/BUILD.bazel b/examples/multi_python_versions/libs/my_lib/BUILD.bazel index 7ff62249c4..863d052133 100644 --- a/examples/multi_python_versions/libs/my_lib/BUILD.bazel +++ b/examples/multi_python_versions/libs/my_lib/BUILD.bazel @@ -1,9 +1,8 @@ -load("@pypi//:requirements.bzl", "requirement") load("@rules_python//python:py_library.bzl", "py_library") py_library( name = "my_lib", srcs = ["__init__.py"], visibility = ["@//tests:__pkg__"], - deps = [requirement("websockets")], + deps = ["@pypi//websockets"], ) diff --git a/examples/multi_python_versions/libs/my_lib/__init__.py b/examples/multi_python_versions/libs/my_lib/__init__.py index 33cfb414f5..a276c3fc1b 100644 --- a/examples/multi_python_versions/libs/my_lib/__init__.py +++ b/examples/multi_python_versions/libs/my_lib/__init__.py @@ -16,4 +16,4 @@ def websockets_is_for_python_version(sanitized_version_check): - return f"pypi_{sanitized_version_check}_websockets" in websockets.__file__ + return f"cp{sanitized_version_check}" in websockets.__file__ diff --git a/examples/multi_python_versions/requirements/BUILD.bazel b/examples/multi_python_versions/requirements/BUILD.bazel index ee8ff029f8..9656e88ddb 100644 --- a/examples/multi_python_versions/requirements/BUILD.bazel +++ b/examples/multi_python_versions/requirements/BUILD.bazel @@ -1,36 +1,7 @@ -load("@rules_python//python:pip.bzl", "compile_pip_requirements") +load("@rules_python//python/uv:lock.bzl", "lock") -compile_pip_requirements( - name = "requirements_3_10", - src = "requirements.in", - python_version = "3.10", - requirements_txt = "requirements_lock_3_10.txt", -) - -compile_pip_requirements( - name = "requirements_3_11", - src = "requirements.in", - python_version = "3.11", - requirements_txt = "requirements_lock_3_11.txt", -) - -compile_pip_requirements( - name = "requirements_3_12", - src = "requirements.in", - python_version = "3.12", - requirements_txt = "requirements_lock_3_12.txt", -) - -compile_pip_requirements( - name = "requirements_3_13", - src = "requirements.in", - python_version = "3.13", - requirements_txt = "requirements_lock_3_13.txt", -) - -compile_pip_requirements( - name = "requirements_3_14", - src = "requirements.in", - python_version = "3.14", - requirements_txt = "requirements_lock_3_14.txt", +lock( + name = "requirements", + srcs = ["requirements.in"], + out = "requirements.txt", ) diff --git a/examples/multi_python_versions/requirements/requirements.txt b/examples/multi_python_versions/requirements/requirements.txt new file mode 100644 index 0000000000..68ebf5bdef --- /dev/null +++ b/examples/multi_python_versions/requirements/requirements.txt @@ -0,0 +1,113 @@ +# This file was autogenerated by uv via the following command: +# bazel run //requirements:requirements.update +websockets==16.1.1 \ + --hash=sha256:01fbdcbac298efe19360b94bc0039c8f746f0220ba570f327577bfee81059175 \ + --hash=sha256:024193f8551a2b0eafbdd160911012c4e6c228c28430c84433253299a9e42d6a \ + --hash=sha256:04fd29a0e2fe9414a95b00e92c67ae51bf900c50c0f8a4b2dafdad621f49ea1d \ + --hash=sha256:056ae37939ed7e9974f364f5864e76e49182622d8f9751ac1903c0d09b013985 \ + --hash=sha256:0f62863e8a00a6d33c3d6566ec0b89f23787b747ffe0c3bc71ec0e76b82c94b1 \ + --hash=sha256:0ffd3031ea8bda8d61762e84220186105ba3b748b3c8da2ae4f7816fac03e573 \ + --hash=sha256:1214e673c404684b9bf7154f5cf43b45025b1a6160fac3a9e438e9c1a97e22cb \ + --hash=sha256:125f22dbefaf1554fea66fc83851490edb284ce4f501d37ffed2752f418332d9 \ + --hash=sha256:130937b167a52af203c8d58e78d67705874e82759862e3b9671a452fec4abc87 \ + --hash=sha256:1427fb4cf0d72f66333e2cacc3ff5f575bf2d7008166ce991a4a470b21d51a22 \ + --hash=sha256:195c978b065fa40910582464f99d6b15c8b314c68e0546549a55ed83f4735328 \ + --hash=sha256:1d27fa8462ad6a1cb36206a3d0640b2333340def181fae11ed7f9adeaa5c0747 \ + --hash=sha256:1db4de4a0e95673f7545d393c49eeb0c2f18ac1ef93073218c79d5cdb2ee75ab \ + --hash=sha256:1f79c89b5eb034d1722938a891916582f8f7f503f58ca22518a63c3f2cd18499 \ + --hash=sha256:23253dd5bcae3f9aaee0a1d30967a8dbd52e5d3cff93a2e5b84df57b77d4750d \ + --hash=sha256:249116b4a76063d930a46391ad56e135c286e4562a18309029fc2c73f4ed4c62 \ + --hash=sha256:29dfa8114c4a620c69591c5973860f768eac29d3fd6904f37f34266cb219c512 \ + --hash=sha256:2a606d9c24035242a3e256e9d5b77ed9cd6bccfcb7cf993e5ca3c0f6f68fb6a7 \ + --hash=sha256:2a636ff1e7a5c4edf71ef0e79adae7f25dba93b4fcbe3dc958733477ffeb0eaf \ + --hash=sha256:2bb5d041a8307d2e18782e7ce777f6fdb1e8c2f5d09291484b18c294b789d9aa \ + --hash=sha256:2e28e602bb13da44fbe518c1781a88e3b9d4c3d48d02c9bad83e546164336f57 \ + --hash=sha256:30bbe120437b5648a77d3519b7024ea09530e0b5b18d3698c5a0ae536fe0cc2e \ + --hash=sha256:34420aaa64440ebd51ac72ca8a45ef4626429438c9b02e633ae412ed43f925d3 \ + --hash=sha256:38565aca3e01ea8734e578fb2118dade0ecb0250533f29e22b8d1a7a196cf4d0 \ + --hash=sha256:387e8e4aa5df2f90b198fa3cad3478822a89cf905b6a6d6c97dc3664689640cc \ + --hash=sha256:39f2a024af5c345ffe8fcf1ee18c049c024c94df393bb09b044a6917c77bde43 \ + --hash=sha256:3df13f73af9b3b38ab1195eb299ecb67a4330c911c97ae04043ff74085728abe \ + --hash=sha256:414e596c75f74e0994084694189d7dc9229fb278e33064d6784b73ffbba3ca31 \ + --hash=sha256:41c8e77f17294c0ac18008a7309b99b34ee72247ef10b6dff4c3f8b5ac29896b \ + --hash=sha256:42290eb6db4ccaca7012656738214f8514082fb6fa40cdeb61bb9a471b52e383 \ + --hash=sha256:42f599f4d48c7e1a3338fdaac3acd075be3b3cf02d4b274f3bf2767aedd3d217 \ + --hash=sha256:43e3a9fdd7cbf7ba6040c31fae0faf84ca1474fef777c4e37912f1540f854499 \ + --hash=sha256:443aefe96b7fdb132e2a70806cca1f2af49bb3f28e47abcd7c2e9dcf4d8fa1b8 \ + --hash=sha256:46dcaa042cd1de6c59e7d9269fa63ff7572b6df40510600b678f0826b3c7af51 \ + --hash=sha256:496af849a472b531f758dbd4d61338f5000538cb1a7b3d20d9d32a264517f509 \ + --hash=sha256:49ae99bdfcae803a885c926bf14f886196e84925395bb3f568fef5c0f0979d7d \ + --hash=sha256:4b57693728576d84ede0a77987ab16881b783d2cd9f1dc180a8fbbc3f79c4428 \ + --hash=sha256:4e3b680b1e0a27457e727a0d572fd81dffa87b6dbf8b228ab57da64f7d85aead \ + --hash=sha256:4e8d01cc3bcae7bbf8167f944aeafefed590fae5693552bba9794a9df68371cc \ + --hash=sha256:5283810d2646741a0d8da2aa733d6aefa0545809afccb2a5d105a26bc45125f1 \ + --hash=sha256:53260c8930da5771cec89439bff99c20c8cb03ddb9588b980697355a83cd4bd3 \ + --hash=sha256:536676848fc5961aca9d20389951f59169508f765637a172403dc5434d722fa0 \ + --hash=sha256:54509b8e92fee4453e152b7558ddef37ce9705a044922f2095a6105e3f80c96f \ + --hash=sha256:56cd5fc4f10a9ea8aa0804bddb7b42506cf9e136046f3b4c27de8fec9e2ecba5 \ + --hash=sha256:5bfd1ac19b1b9986a9c95a82d5e23a391ebb09e12c34d7be6094b86efcc35731 \ + --hash=sha256:5c31aa7e39ee3e8a358573257f1c0bb5c52430d1b637030dd9c8cc2c282926be \ + --hash=sha256:5e3b7d601f6f84156b08cc4a5e541c2b50ad7b36cfc302b657a12477c904a5df \ + --hash=sha256:61922544a0587a13fd3f53e4c0e5e606510c7b0d9d22c8444e5fae22a06b38cb \ + --hash=sha256:6456ff333092d509127d75a638cb411afae8ff17f092635015d1902efec8a293 \ + --hash=sha256:69159730a823dde3ea8d08783e8d47ef135a6d7e8d44eb127e32b321c9db8e3e \ + --hash=sha256:69e52d175a0a7d1e13b4b67ad41c560b7d98e8c6f6126eb0bda496c784faf8c7 \ + --hash=sha256:6aaface73b9c71974c6497366d8b9628357f6c9749e09c4ea3610176c63f2ae3 \ + --hash=sha256:6abbd3e82c731c8e531714466acd5d87b5e88ac3243465337ba71d68e23ae7e3 \ + --hash=sha256:6ff9417c0ada4d0f7d212f928303e5579bdf3ace4c802fa4afabb30995da58c3 \ + --hash=sha256:7421fad442de870a8cbf2287d1cad7e706ece0dbfeba5e911df132cbdc1cb56a \ + --hash=sha256:7883388947767080f094950b342b30d35a2a06b849cd967c422fa0db72b40ea9 \ + --hash=sha256:79eace538c6a97e96d0d03d4f9d314f9677f5ed85a8a984992ffd90b13cb8a56 \ + --hash=sha256:7b1b19636af86a3c7995d4d028dbe376f39b4bf31541146f9c123582a6c94562 \ + --hash=sha256:7dfcad78ea1492ee3a9ec765cb7f51bbc17d477107aaf6b22abf7b2558d1c5a0 \ + --hash=sha256:8087e82f842609734c9b5a1330464f8e94e346ba0e18c832c08bafa4b0d63c15 \ + --hash=sha256:820fb8450edddae3812fd58cbc08e2bf22812cb248ecb5f06dbb82119a56e869 \ + --hash=sha256:8483c2096363120eea8b07c06ae7304d520f686665fffd4811fad423930a65d7 \ + --hash=sha256:84a2cef8deffbd9ab8ee0ea546a2a6a7030c28f44e6cdd4547dbfeb489eb8999 \ + --hash=sha256:86d7f0f8bdb25d2c632b72527325e4776430fd5bc61b9118de4e2b8ddb5f5b01 \ + --hash=sha256:8fe0b50da2d84535fb4f7b4bfa951280f97ce3d558a0443b541166d609e67b57 \ + --hash=sha256:90001d893bc368e302ef168d82130b4e4fdd27b85fa094682df9b667c2d48838 \ + --hash=sha256:9246a0d063cfcbcc85f2359dd6876d681213f4790832272aa16641b4ed5d64d4 \ + --hash=sha256:92b820d345f7a3fc7b8163949ee92df910f290c3fc517b3d5301c78065adafe1 \ + --hash=sha256:952303a7318d4cbe1011400839bb2051c9f84fa0a35923267f5daba34b15d458 \ + --hash=sha256:97fd3a0e8b53efa41970ac1dff3d8cf0d2884cadeb4caaf95db7ad1526926ee3 \ + --hash=sha256:9c1c5705e314449e3308872fe084b8571ce078ee4fc55a98a769bdefe5917392 \ + --hash=sha256:9c9f23004a3d40e89c01a7955d186a6cc83418d93b749701944ce2de3e95a1f3 \ + --hash=sha256:9f63bcef7f4b02b06b35fc01c93b96c43b5e88e1e8868676caacf493d5a31f3a \ + --hash=sha256:a0eadbbf2c30f01efa58e1f110eb6fa293261f6b0b1aa38f7f48707107690af9 \ + --hash=sha256:a28fcbc9b6baf54a2e23f8655f308e4ccc6afdd7266f8fe7954f320dcda0f785 \ + --hash=sha256:a6a61aff018180c9c50b7b0da33bfd29d378af3497429c95006c589a23a11648 \ + --hash=sha256:aabe464bfd13bd25f4821faf111da6fefdc389f870265a53105580e45b0a2e49 \ + --hash=sha256:ab59169ace05dcb49a1d4118f0bde139557adf45091bd85747e36bf5de984dd1 \ + --hash=sha256:b436f6ec4fc3a6b4237c84d3f83170ed2b40bb584222f0ac47a0c8a5921980c7 \ + --hash=sha256:b6b9dadbef0cccd9f4c4ee96b08898afa73e26803bbe0f6aeb5bb12b0074206d \ + --hash=sha256:b852788aa51764e2d8e4cf5493d559326bcae5e38d16ba25ffa322b034df272a \ + --hash=sha256:bae954c382e013d5ea5b190d2830526bfa45ad121c326da0049b8c769f185db6 \ + --hash=sha256:bcce07e23e5769375158f5efdcdafa8d5cd014b93c6683865b840ed65b96f231 \ + --hash=sha256:cc97814dfb786a83b6e2dc2e79351e1b83e6d715647d6887fcabd83026417a00 \ + --hash=sha256:cd2ca96a082a36964aca83e992f72abeb61b7306c1a6cba4c7d06a7b93750cac \ + --hash=sha256:cfb70b4eb56cac4da0a83588f3ad50d46beb0690391082f3d4e2d488c70b68ea \ + --hash=sha256:d0fcf657e9f13ff4b177960ab2200237b12994232dfb6df16f1cfe1d4339f93c \ + --hash=sha256:d14bfb217eb4701e850f1525c9d29d79c44794cdf1c299ead25f39f8c78dea81 \ + --hash=sha256:d57685547e0060cc6fd90ee6a28405d6bd395e525545f13c8d7cd99c78afd79f \ + --hash=sha256:d6bec75c290fe484a8ba4cacdf838501e17c06ecfbbf31eede81a9e431bd7751 \ + --hash=sha256:d9531d9cbeac99af6f038fb1bc351403531f7d634a2c2e10e2f7c854c6ed5b68 \ + --hash=sha256:da4ca1a9d72f9030b3146b8d7022719a9f3d478f61efe6f7dd51d243f61c51b2 \ + --hash=sha256:dab9eb87869da2d6ed3af3f3adf28414baae6ec9d4df355ffc18889132f3436c \ + --hash=sha256:db234eda965dcce15df96bb9709f587cd87d4d52aaf0e80e2f34ec04c7670c57 \ + --hash=sha256:dc0fad4933f427acd5b1cec210f3ea6dce7089e1724e4b9ec6ef47c6c04d1b3b \ + --hash=sha256:dc385593a42e31cd6fb60c19f0ecb015b386603818fc2c6c274fb42bd2bb4165 \ + --hash=sha256:dcc04fedf83effaeb9cce98abc9469bb1b42ef85f03e01c8c1f4438ef7555737 \ + --hash=sha256:e047dc87ef7ca50f4d309bf775ad4a71711c58556d75d7bd0604b2317f43e94b \ + --hash=sha256:e09f753a169951eb4f28c2c774f71069304f66e7277e0f5a2892423599cfa854 \ + --hash=sha256:ed5bb271084b46530ee2ddc0410537a9961152c5ccba2fc98c5276d992ccba87 \ + --hash=sha256:f0aa4aad3b1b69ad3fd85a0fd0952ec64331c762bd77ec51cc814170873890b2 \ + --hash=sha256:f17dbe07eb3ea7f99e4df9b7e0efefe80fbf30d37a8cc4d561a0aed310bc8847 \ + --hash=sha256:f2769a0344a09e9ccf5b3cce538bc75a51b53eff3275d3896310c8552049195d \ + --hash=sha256:f55f0b01956a094c8587146d9558c91937e78789c333860ffaf35931a6e5dbc4 \ + --hash=sha256:f5d497865f05bb222cab7016c6034542e84e5f29f49c6fd3f4939cda7197b5b8 \ + --hash=sha256:f70541f3104339f59f830522d94ebadb1bf47426287381623443d8bb1cdbf33d \ + --hash=sha256:fb9a0a6dc3d1b3986cb88091b6899f0396651e0f74e2c9766ab8d6ffc3842e29 \ + --hash=sha256:fce6c48559c86d1ac3632ccb1bebc7d5442fbe79bd9bb0e40379ee54be2a4051 \ + --hash=sha256:fd46fff7eb62c24804d234f0051c7a8ea81285ad63e0337d3dcf33ca82aee58a + # via -r requirements/requirements.in diff --git a/examples/multi_python_versions/requirements/requirements_lock_3_10.txt b/examples/multi_python_versions/requirements/requirements_lock_3_10.txt deleted file mode 100644 index 3a8453223f..0000000000 --- a/examples/multi_python_versions/requirements/requirements_lock_3_10.txt +++ /dev/null @@ -1,78 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.10 -# by the following command: -# -# bazel run //requirements:requirements_3_10.update -# -websockets==11.0.3 ; python_full_version > "3.9.1" \ - --hash=sha256:01f5567d9cf6f502d655151645d4e8b72b453413d3819d2b6f1185abc23e82dd \ - --hash=sha256:03aae4edc0b1c68498f41a6772d80ac7c1e33c06c6ffa2ac1c27a07653e79d6f \ - --hash=sha256:0ac56b661e60edd453585f4bd68eb6a29ae25b5184fd5ba51e97652580458998 \ - --hash=sha256:0ee68fe502f9031f19d495dae2c268830df2760c0524cbac5d759921ba8c8e82 \ - --hash=sha256:1553cb82942b2a74dd9b15a018dce645d4e68674de2ca31ff13ebc2d9f283788 \ - --hash=sha256:1a073fc9ab1c8aff37c99f11f1641e16da517770e31a37265d2755282a5d28aa \ - --hash=sha256:1d2256283fa4b7f4c7d7d3e84dc2ece74d341bce57d5b9bf385df109c2a1a82f \ - --hash=sha256:1d5023a4b6a5b183dc838808087033ec5df77580485fc533e7dab2567851b0a4 \ - --hash=sha256:1fdf26fa8a6a592f8f9235285b8affa72748dc12e964a5518c6c5e8f916716f7 \ - --hash=sha256:2529338a6ff0eb0b50c7be33dc3d0e456381157a31eefc561771ee431134a97f \ - --hash=sha256:279e5de4671e79a9ac877427f4ac4ce93751b8823f276b681d04b2156713b9dd \ - --hash=sha256:2d903ad4419f5b472de90cd2d40384573b25da71e33519a67797de17ef849b69 \ - --hash=sha256:332d126167ddddec94597c2365537baf9ff62dfcc9db4266f263d455f2f031cb \ - --hash=sha256:34fd59a4ac42dff6d4681d8843217137f6bc85ed29722f2f7222bd619d15e95b \ - --hash=sha256:3580dd9c1ad0701169e4d6fc41e878ffe05e6bdcaf3c412f9d559389d0c9e016 \ - --hash=sha256:3ccc8a0c387629aec40f2fc9fdcb4b9d5431954f934da3eaf16cdc94f67dbfac \ - --hash=sha256:41f696ba95cd92dc047e46b41b26dd24518384749ed0d99bea0a941ca87404c4 \ - --hash=sha256:42cc5452a54a8e46a032521d7365da775823e21bfba2895fb7b77633cce031bb \ - --hash=sha256:4841ed00f1026dfbced6fca7d963c4e7043aa832648671b5138008dc5a8f6d99 \ - --hash=sha256:4b253869ea05a5a073ebfdcb5cb3b0266a57c3764cf6fe114e4cd90f4bfa5f5e \ - --hash=sha256:54c6e5b3d3a8936a4ab6870d46bdd6ec500ad62bde9e44462c32d18f1e9a8e54 \ - --hash=sha256:619d9f06372b3a42bc29d0cd0354c9bb9fb39c2cbc1a9c5025b4538738dbffaf \ - --hash=sha256:6505c1b31274723ccaf5f515c1824a4ad2f0d191cec942666b3d0f3aa4cb4007 \ - --hash=sha256:660e2d9068d2bedc0912af508f30bbeb505bbbf9774d98def45f68278cea20d3 \ - --hash=sha256:6681ba9e7f8f3b19440921e99efbb40fc89f26cd71bf539e45d8c8a25c976dc6 \ - --hash=sha256:68b977f21ce443d6d378dbd5ca38621755f2063d6fdb3335bda981d552cfff86 \ - --hash=sha256:69269f3a0b472e91125b503d3c0b3566bda26da0a3261c49f0027eb6075086d1 \ - --hash=sha256:6f1a3f10f836fab6ca6efa97bb952300b20ae56b409414ca85bff2ad241d2a61 \ - --hash=sha256:7622a89d696fc87af8e8d280d9b421db5133ef5b29d3f7a1ce9f1a7bf7fcfa11 \ - --hash=sha256:777354ee16f02f643a4c7f2b3eff8027a33c9861edc691a2003531f5da4f6bc8 \ - --hash=sha256:84d27a4832cc1a0ee07cdcf2b0629a8a72db73f4cf6de6f0904f6661227f256f \ - --hash=sha256:8531fdcad636d82c517b26a448dcfe62f720e1922b33c81ce695d0edb91eb931 \ - --hash=sha256:86d2a77fd490ae3ff6fae1c6ceaecad063d3cc2320b44377efdde79880e11526 \ - --hash=sha256:88fc51d9a26b10fc331be344f1781224a375b78488fc343620184e95a4b27016 \ - --hash=sha256:8a34e13a62a59c871064dfd8ffb150867e54291e46d4a7cf11d02c94a5275bae \ - --hash=sha256:8c82f11964f010053e13daafdc7154ce7385ecc538989a354ccc7067fd7028fd \ - --hash=sha256:92b2065d642bf8c0a82d59e59053dd2fdde64d4ed44efe4870fa816c1232647b \ - --hash=sha256:97b52894d948d2f6ea480171a27122d77af14ced35f62e5c892ca2fae9344311 \ - --hash=sha256:9d9acd80072abcc98bd2c86c3c9cd4ac2347b5a5a0cae7ed5c0ee5675f86d9af \ - --hash=sha256:9f59a3c656fef341a99e3d63189852be7084c0e54b75734cde571182c087b152 \ - --hash=sha256:aa5003845cdd21ac0dc6c9bf661c5beddd01116f6eb9eb3c8e272353d45b3288 \ - --hash=sha256:b16fff62b45eccb9c7abb18e60e7e446998093cdcb50fed33134b9b6878836de \ - --hash=sha256:b30c6590146e53149f04e85a6e4fcae068df4289e31e4aee1fdf56a0dead8f97 \ - --hash=sha256:b58cbf0697721120866820b89f93659abc31c1e876bf20d0b3d03cef14faf84d \ - --hash=sha256:b67c6f5e5a401fc56394f191f00f9b3811fe843ee93f4a70df3c389d1adf857d \ - --hash=sha256:bceab846bac555aff6427d060f2fcfff71042dba6f5fca7dc4f75cac815e57ca \ - --hash=sha256:bee9fcb41db2a23bed96c6b6ead6489702c12334ea20a297aa095ce6d31370d0 \ - --hash=sha256:c114e8da9b475739dde229fd3bc6b05a6537a88a578358bc8eb29b4030fac9c9 \ - --hash=sha256:c1f0524f203e3bd35149f12157438f406eff2e4fb30f71221c8a5eceb3617b6b \ - --hash=sha256:c792ea4eabc0159535608fc5658a74d1a81020eb35195dd63214dcf07556f67e \ - --hash=sha256:c7f3cb904cce8e1be667c7e6fef4516b98d1a6a0635a58a57528d577ac18a128 \ - --hash=sha256:d67ac60a307f760c6e65dad586f556dde58e683fab03323221a4e530ead6f74d \ - --hash=sha256:dcacf2c7a6c3a84e720d1bb2b543c675bf6c40e460300b628bab1b1efc7c034c \ - --hash=sha256:de36fe9c02995c7e6ae6efe2e205816f5f00c22fd1fbf343d4d18c3d5ceac2f5 \ - --hash=sha256:def07915168ac8f7853812cc593c71185a16216e9e4fa886358a17ed0fd9fcf6 \ - --hash=sha256:df41b9bc27c2c25b486bae7cf42fccdc52ff181c8c387bfd026624a491c2671b \ - --hash=sha256:e052b8467dd07d4943936009f46ae5ce7b908ddcac3fda581656b1b19c083d9b \ - --hash=sha256:e063b1865974611313a3849d43f2c3f5368093691349cf3c7c8f8f75ad7cb280 \ - --hash=sha256:e1459677e5d12be8bbc7584c35b992eea142911a6236a3278b9b5ce3326f282c \ - --hash=sha256:e1a99a7a71631f0efe727c10edfba09ea6bee4166a6f9c19aafb6c0b5917d09c \ - --hash=sha256:e590228200fcfc7e9109509e4d9125eace2042fd52b595dd22bbc34bb282307f \ - --hash=sha256:e6316827e3e79b7b8e7d8e3b08f4e331af91a48e794d5d8b099928b6f0b85f20 \ - --hash=sha256:e7837cb169eca3b3ae94cc5787c4fed99eef74c0ab9506756eea335e0d6f3ed8 \ - --hash=sha256:e848f46a58b9fcf3d06061d17be388caf70ea5b8cc3466251963c8345e13f7eb \ - --hash=sha256:ed058398f55163a79bb9f06a90ef9ccc063b204bb346c4de78efc5d15abfe602 \ - --hash=sha256:f2e58f2c36cc52d41f2659e4c0cbf7353e28c8c9e63e30d8c6d3494dc9fdedcf \ - --hash=sha256:f467ba0050b7de85016b43f5a22b46383ef004c4f672148a8abf32bc999a87f0 \ - --hash=sha256:f61bdb1df43dc9c131791fbc2355535f9024b9a04398d3bd0684fc16ab07df74 \ - --hash=sha256:fb06eea71a00a7af0ae6aefbb932fb8a7df3cb390cc217d51a9ad7343de1b8d0 \ - --hash=sha256:ffd7dcaf744f25f82190856bc26ed81721508fc5cbf2a330751e135ff1283564 - # via -r requirements/requirements.in diff --git a/examples/multi_python_versions/requirements/requirements_lock_3_11.txt b/examples/multi_python_versions/requirements/requirements_lock_3_11.txt deleted file mode 100644 index f1fa8f56f5..0000000000 --- a/examples/multi_python_versions/requirements/requirements_lock_3_11.txt +++ /dev/null @@ -1,78 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.11 -# by the following command: -# -# bazel run //requirements:requirements_3_11.update -# -websockets==11.0.3 ; python_full_version > "3.9.1" \ - --hash=sha256:01f5567d9cf6f502d655151645d4e8b72b453413d3819d2b6f1185abc23e82dd \ - --hash=sha256:03aae4edc0b1c68498f41a6772d80ac7c1e33c06c6ffa2ac1c27a07653e79d6f \ - --hash=sha256:0ac56b661e60edd453585f4bd68eb6a29ae25b5184fd5ba51e97652580458998 \ - --hash=sha256:0ee68fe502f9031f19d495dae2c268830df2760c0524cbac5d759921ba8c8e82 \ - --hash=sha256:1553cb82942b2a74dd9b15a018dce645d4e68674de2ca31ff13ebc2d9f283788 \ - --hash=sha256:1a073fc9ab1c8aff37c99f11f1641e16da517770e31a37265d2755282a5d28aa \ - --hash=sha256:1d2256283fa4b7f4c7d7d3e84dc2ece74d341bce57d5b9bf385df109c2a1a82f \ - --hash=sha256:1d5023a4b6a5b183dc838808087033ec5df77580485fc533e7dab2567851b0a4 \ - --hash=sha256:1fdf26fa8a6a592f8f9235285b8affa72748dc12e964a5518c6c5e8f916716f7 \ - --hash=sha256:2529338a6ff0eb0b50c7be33dc3d0e456381157a31eefc561771ee431134a97f \ - --hash=sha256:279e5de4671e79a9ac877427f4ac4ce93751b8823f276b681d04b2156713b9dd \ - --hash=sha256:2d903ad4419f5b472de90cd2d40384573b25da71e33519a67797de17ef849b69 \ - --hash=sha256:332d126167ddddec94597c2365537baf9ff62dfcc9db4266f263d455f2f031cb \ - --hash=sha256:34fd59a4ac42dff6d4681d8843217137f6bc85ed29722f2f7222bd619d15e95b \ - --hash=sha256:3580dd9c1ad0701169e4d6fc41e878ffe05e6bdcaf3c412f9d559389d0c9e016 \ - --hash=sha256:3ccc8a0c387629aec40f2fc9fdcb4b9d5431954f934da3eaf16cdc94f67dbfac \ - --hash=sha256:41f696ba95cd92dc047e46b41b26dd24518384749ed0d99bea0a941ca87404c4 \ - --hash=sha256:42cc5452a54a8e46a032521d7365da775823e21bfba2895fb7b77633cce031bb \ - --hash=sha256:4841ed00f1026dfbced6fca7d963c4e7043aa832648671b5138008dc5a8f6d99 \ - --hash=sha256:4b253869ea05a5a073ebfdcb5cb3b0266a57c3764cf6fe114e4cd90f4bfa5f5e \ - --hash=sha256:54c6e5b3d3a8936a4ab6870d46bdd6ec500ad62bde9e44462c32d18f1e9a8e54 \ - --hash=sha256:619d9f06372b3a42bc29d0cd0354c9bb9fb39c2cbc1a9c5025b4538738dbffaf \ - --hash=sha256:6505c1b31274723ccaf5f515c1824a4ad2f0d191cec942666b3d0f3aa4cb4007 \ - --hash=sha256:660e2d9068d2bedc0912af508f30bbeb505bbbf9774d98def45f68278cea20d3 \ - --hash=sha256:6681ba9e7f8f3b19440921e99efbb40fc89f26cd71bf539e45d8c8a25c976dc6 \ - --hash=sha256:68b977f21ce443d6d378dbd5ca38621755f2063d6fdb3335bda981d552cfff86 \ - --hash=sha256:69269f3a0b472e91125b503d3c0b3566bda26da0a3261c49f0027eb6075086d1 \ - --hash=sha256:6f1a3f10f836fab6ca6efa97bb952300b20ae56b409414ca85bff2ad241d2a61 \ - --hash=sha256:7622a89d696fc87af8e8d280d9b421db5133ef5b29d3f7a1ce9f1a7bf7fcfa11 \ - --hash=sha256:777354ee16f02f643a4c7f2b3eff8027a33c9861edc691a2003531f5da4f6bc8 \ - --hash=sha256:84d27a4832cc1a0ee07cdcf2b0629a8a72db73f4cf6de6f0904f6661227f256f \ - --hash=sha256:8531fdcad636d82c517b26a448dcfe62f720e1922b33c81ce695d0edb91eb931 \ - --hash=sha256:86d2a77fd490ae3ff6fae1c6ceaecad063d3cc2320b44377efdde79880e11526 \ - --hash=sha256:88fc51d9a26b10fc331be344f1781224a375b78488fc343620184e95a4b27016 \ - --hash=sha256:8a34e13a62a59c871064dfd8ffb150867e54291e46d4a7cf11d02c94a5275bae \ - --hash=sha256:8c82f11964f010053e13daafdc7154ce7385ecc538989a354ccc7067fd7028fd \ - --hash=sha256:92b2065d642bf8c0a82d59e59053dd2fdde64d4ed44efe4870fa816c1232647b \ - --hash=sha256:97b52894d948d2f6ea480171a27122d77af14ced35f62e5c892ca2fae9344311 \ - --hash=sha256:9d9acd80072abcc98bd2c86c3c9cd4ac2347b5a5a0cae7ed5c0ee5675f86d9af \ - --hash=sha256:9f59a3c656fef341a99e3d63189852be7084c0e54b75734cde571182c087b152 \ - --hash=sha256:aa5003845cdd21ac0dc6c9bf661c5beddd01116f6eb9eb3c8e272353d45b3288 \ - --hash=sha256:b16fff62b45eccb9c7abb18e60e7e446998093cdcb50fed33134b9b6878836de \ - --hash=sha256:b30c6590146e53149f04e85a6e4fcae068df4289e31e4aee1fdf56a0dead8f97 \ - --hash=sha256:b58cbf0697721120866820b89f93659abc31c1e876bf20d0b3d03cef14faf84d \ - --hash=sha256:b67c6f5e5a401fc56394f191f00f9b3811fe843ee93f4a70df3c389d1adf857d \ - --hash=sha256:bceab846bac555aff6427d060f2fcfff71042dba6f5fca7dc4f75cac815e57ca \ - --hash=sha256:bee9fcb41db2a23bed96c6b6ead6489702c12334ea20a297aa095ce6d31370d0 \ - --hash=sha256:c114e8da9b475739dde229fd3bc6b05a6537a88a578358bc8eb29b4030fac9c9 \ - --hash=sha256:c1f0524f203e3bd35149f12157438f406eff2e4fb30f71221c8a5eceb3617b6b \ - --hash=sha256:c792ea4eabc0159535608fc5658a74d1a81020eb35195dd63214dcf07556f67e \ - --hash=sha256:c7f3cb904cce8e1be667c7e6fef4516b98d1a6a0635a58a57528d577ac18a128 \ - --hash=sha256:d67ac60a307f760c6e65dad586f556dde58e683fab03323221a4e530ead6f74d \ - --hash=sha256:dcacf2c7a6c3a84e720d1bb2b543c675bf6c40e460300b628bab1b1efc7c034c \ - --hash=sha256:de36fe9c02995c7e6ae6efe2e205816f5f00c22fd1fbf343d4d18c3d5ceac2f5 \ - --hash=sha256:def07915168ac8f7853812cc593c71185a16216e9e4fa886358a17ed0fd9fcf6 \ - --hash=sha256:df41b9bc27c2c25b486bae7cf42fccdc52ff181c8c387bfd026624a491c2671b \ - --hash=sha256:e052b8467dd07d4943936009f46ae5ce7b908ddcac3fda581656b1b19c083d9b \ - --hash=sha256:e063b1865974611313a3849d43f2c3f5368093691349cf3c7c8f8f75ad7cb280 \ - --hash=sha256:e1459677e5d12be8bbc7584c35b992eea142911a6236a3278b9b5ce3326f282c \ - --hash=sha256:e1a99a7a71631f0efe727c10edfba09ea6bee4166a6f9c19aafb6c0b5917d09c \ - --hash=sha256:e590228200fcfc7e9109509e4d9125eace2042fd52b595dd22bbc34bb282307f \ - --hash=sha256:e6316827e3e79b7b8e7d8e3b08f4e331af91a48e794d5d8b099928b6f0b85f20 \ - --hash=sha256:e7837cb169eca3b3ae94cc5787c4fed99eef74c0ab9506756eea335e0d6f3ed8 \ - --hash=sha256:e848f46a58b9fcf3d06061d17be388caf70ea5b8cc3466251963c8345e13f7eb \ - --hash=sha256:ed058398f55163a79bb9f06a90ef9ccc063b204bb346c4de78efc5d15abfe602 \ - --hash=sha256:f2e58f2c36cc52d41f2659e4c0cbf7353e28c8c9e63e30d8c6d3494dc9fdedcf \ - --hash=sha256:f467ba0050b7de85016b43f5a22b46383ef004c4f672148a8abf32bc999a87f0 \ - --hash=sha256:f61bdb1df43dc9c131791fbc2355535f9024b9a04398d3bd0684fc16ab07df74 \ - --hash=sha256:fb06eea71a00a7af0ae6aefbb932fb8a7df3cb390cc217d51a9ad7343de1b8d0 \ - --hash=sha256:ffd7dcaf744f25f82190856bc26ed81721508fc5cbf2a330751e135ff1283564 - # via -r requirements/requirements.in diff --git a/examples/multi_python_versions/requirements/requirements_lock_3_12.txt b/examples/multi_python_versions/requirements/requirements_lock_3_12.txt deleted file mode 100644 index 818b20e14c..0000000000 --- a/examples/multi_python_versions/requirements/requirements_lock_3_12.txt +++ /dev/null @@ -1,78 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.12 -# by the following command: -# -# bazel run //requirements:requirements_3_12.update -# -websockets==11.0.3 ; python_full_version > "3.9.1" \ - --hash=sha256:01f5567d9cf6f502d655151645d4e8b72b453413d3819d2b6f1185abc23e82dd \ - --hash=sha256:03aae4edc0b1c68498f41a6772d80ac7c1e33c06c6ffa2ac1c27a07653e79d6f \ - --hash=sha256:0ac56b661e60edd453585f4bd68eb6a29ae25b5184fd5ba51e97652580458998 \ - --hash=sha256:0ee68fe502f9031f19d495dae2c268830df2760c0524cbac5d759921ba8c8e82 \ - --hash=sha256:1553cb82942b2a74dd9b15a018dce645d4e68674de2ca31ff13ebc2d9f283788 \ - --hash=sha256:1a073fc9ab1c8aff37c99f11f1641e16da517770e31a37265d2755282a5d28aa \ - --hash=sha256:1d2256283fa4b7f4c7d7d3e84dc2ece74d341bce57d5b9bf385df109c2a1a82f \ - --hash=sha256:1d5023a4b6a5b183dc838808087033ec5df77580485fc533e7dab2567851b0a4 \ - --hash=sha256:1fdf26fa8a6a592f8f9235285b8affa72748dc12e964a5518c6c5e8f916716f7 \ - --hash=sha256:2529338a6ff0eb0b50c7be33dc3d0e456381157a31eefc561771ee431134a97f \ - --hash=sha256:279e5de4671e79a9ac877427f4ac4ce93751b8823f276b681d04b2156713b9dd \ - --hash=sha256:2d903ad4419f5b472de90cd2d40384573b25da71e33519a67797de17ef849b69 \ - --hash=sha256:332d126167ddddec94597c2365537baf9ff62dfcc9db4266f263d455f2f031cb \ - --hash=sha256:34fd59a4ac42dff6d4681d8843217137f6bc85ed29722f2f7222bd619d15e95b \ - --hash=sha256:3580dd9c1ad0701169e4d6fc41e878ffe05e6bdcaf3c412f9d559389d0c9e016 \ - --hash=sha256:3ccc8a0c387629aec40f2fc9fdcb4b9d5431954f934da3eaf16cdc94f67dbfac \ - --hash=sha256:41f696ba95cd92dc047e46b41b26dd24518384749ed0d99bea0a941ca87404c4 \ - --hash=sha256:42cc5452a54a8e46a032521d7365da775823e21bfba2895fb7b77633cce031bb \ - --hash=sha256:4841ed00f1026dfbced6fca7d963c4e7043aa832648671b5138008dc5a8f6d99 \ - --hash=sha256:4b253869ea05a5a073ebfdcb5cb3b0266a57c3764cf6fe114e4cd90f4bfa5f5e \ - --hash=sha256:54c6e5b3d3a8936a4ab6870d46bdd6ec500ad62bde9e44462c32d18f1e9a8e54 \ - --hash=sha256:619d9f06372b3a42bc29d0cd0354c9bb9fb39c2cbc1a9c5025b4538738dbffaf \ - --hash=sha256:6505c1b31274723ccaf5f515c1824a4ad2f0d191cec942666b3d0f3aa4cb4007 \ - --hash=sha256:660e2d9068d2bedc0912af508f30bbeb505bbbf9774d98def45f68278cea20d3 \ - --hash=sha256:6681ba9e7f8f3b19440921e99efbb40fc89f26cd71bf539e45d8c8a25c976dc6 \ - --hash=sha256:68b977f21ce443d6d378dbd5ca38621755f2063d6fdb3335bda981d552cfff86 \ - --hash=sha256:69269f3a0b472e91125b503d3c0b3566bda26da0a3261c49f0027eb6075086d1 \ - --hash=sha256:6f1a3f10f836fab6ca6efa97bb952300b20ae56b409414ca85bff2ad241d2a61 \ - --hash=sha256:7622a89d696fc87af8e8d280d9b421db5133ef5b29d3f7a1ce9f1a7bf7fcfa11 \ - --hash=sha256:777354ee16f02f643a4c7f2b3eff8027a33c9861edc691a2003531f5da4f6bc8 \ - --hash=sha256:84d27a4832cc1a0ee07cdcf2b0629a8a72db73f4cf6de6f0904f6661227f256f \ - --hash=sha256:8531fdcad636d82c517b26a448dcfe62f720e1922b33c81ce695d0edb91eb931 \ - --hash=sha256:86d2a77fd490ae3ff6fae1c6ceaecad063d3cc2320b44377efdde79880e11526 \ - --hash=sha256:88fc51d9a26b10fc331be344f1781224a375b78488fc343620184e95a4b27016 \ - --hash=sha256:8a34e13a62a59c871064dfd8ffb150867e54291e46d4a7cf11d02c94a5275bae \ - --hash=sha256:8c82f11964f010053e13daafdc7154ce7385ecc538989a354ccc7067fd7028fd \ - --hash=sha256:92b2065d642bf8c0a82d59e59053dd2fdde64d4ed44efe4870fa816c1232647b \ - --hash=sha256:97b52894d948d2f6ea480171a27122d77af14ced35f62e5c892ca2fae9344311 \ - --hash=sha256:9d9acd80072abcc98bd2c86c3c9cd4ac2347b5a5a0cae7ed5c0ee5675f86d9af \ - --hash=sha256:9f59a3c656fef341a99e3d63189852be7084c0e54b75734cde571182c087b152 \ - --hash=sha256:aa5003845cdd21ac0dc6c9bf661c5beddd01116f6eb9eb3c8e272353d45b3288 \ - --hash=sha256:b16fff62b45eccb9c7abb18e60e7e446998093cdcb50fed33134b9b6878836de \ - --hash=sha256:b30c6590146e53149f04e85a6e4fcae068df4289e31e4aee1fdf56a0dead8f97 \ - --hash=sha256:b58cbf0697721120866820b89f93659abc31c1e876bf20d0b3d03cef14faf84d \ - --hash=sha256:b67c6f5e5a401fc56394f191f00f9b3811fe843ee93f4a70df3c389d1adf857d \ - --hash=sha256:bceab846bac555aff6427d060f2fcfff71042dba6f5fca7dc4f75cac815e57ca \ - --hash=sha256:bee9fcb41db2a23bed96c6b6ead6489702c12334ea20a297aa095ce6d31370d0 \ - --hash=sha256:c114e8da9b475739dde229fd3bc6b05a6537a88a578358bc8eb29b4030fac9c9 \ - --hash=sha256:c1f0524f203e3bd35149f12157438f406eff2e4fb30f71221c8a5eceb3617b6b \ - --hash=sha256:c792ea4eabc0159535608fc5658a74d1a81020eb35195dd63214dcf07556f67e \ - --hash=sha256:c7f3cb904cce8e1be667c7e6fef4516b98d1a6a0635a58a57528d577ac18a128 \ - --hash=sha256:d67ac60a307f760c6e65dad586f556dde58e683fab03323221a4e530ead6f74d \ - --hash=sha256:dcacf2c7a6c3a84e720d1bb2b543c675bf6c40e460300b628bab1b1efc7c034c \ - --hash=sha256:de36fe9c02995c7e6ae6efe2e205816f5f00c22fd1fbf343d4d18c3d5ceac2f5 \ - --hash=sha256:def07915168ac8f7853812cc593c71185a16216e9e4fa886358a17ed0fd9fcf6 \ - --hash=sha256:df41b9bc27c2c25b486bae7cf42fccdc52ff181c8c387bfd026624a491c2671b \ - --hash=sha256:e052b8467dd07d4943936009f46ae5ce7b908ddcac3fda581656b1b19c083d9b \ - --hash=sha256:e063b1865974611313a3849d43f2c3f5368093691349cf3c7c8f8f75ad7cb280 \ - --hash=sha256:e1459677e5d12be8bbc7584c35b992eea142911a6236a3278b9b5ce3326f282c \ - --hash=sha256:e1a99a7a71631f0efe727c10edfba09ea6bee4166a6f9c19aafb6c0b5917d09c \ - --hash=sha256:e590228200fcfc7e9109509e4d9125eace2042fd52b595dd22bbc34bb282307f \ - --hash=sha256:e6316827e3e79b7b8e7d8e3b08f4e331af91a48e794d5d8b099928b6f0b85f20 \ - --hash=sha256:e7837cb169eca3b3ae94cc5787c4fed99eef74c0ab9506756eea335e0d6f3ed8 \ - --hash=sha256:e848f46a58b9fcf3d06061d17be388caf70ea5b8cc3466251963c8345e13f7eb \ - --hash=sha256:ed058398f55163a79bb9f06a90ef9ccc063b204bb346c4de78efc5d15abfe602 \ - --hash=sha256:f2e58f2c36cc52d41f2659e4c0cbf7353e28c8c9e63e30d8c6d3494dc9fdedcf \ - --hash=sha256:f467ba0050b7de85016b43f5a22b46383ef004c4f672148a8abf32bc999a87f0 \ - --hash=sha256:f61bdb1df43dc9c131791fbc2355535f9024b9a04398d3bd0684fc16ab07df74 \ - --hash=sha256:fb06eea71a00a7af0ae6aefbb932fb8a7df3cb390cc217d51a9ad7343de1b8d0 \ - --hash=sha256:ffd7dcaf744f25f82190856bc26ed81721508fc5cbf2a330751e135ff1283564 - # via -r requirements/requirements.in diff --git a/examples/multi_python_versions/requirements/requirements_lock_3_13.txt b/examples/multi_python_versions/requirements/requirements_lock_3_13.txt deleted file mode 100644 index 8dc44b8a07..0000000000 --- a/examples/multi_python_versions/requirements/requirements_lock_3_13.txt +++ /dev/null @@ -1,78 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.13 -# by the following command: -# -# bazel run //requirements:requirements_3_13.update -# -websockets==11.0.3 ; python_full_version > "3.9.1" \ - --hash=sha256:01f5567d9cf6f502d655151645d4e8b72b453413d3819d2b6f1185abc23e82dd \ - --hash=sha256:03aae4edc0b1c68498f41a6772d80ac7c1e33c06c6ffa2ac1c27a07653e79d6f \ - --hash=sha256:0ac56b661e60edd453585f4bd68eb6a29ae25b5184fd5ba51e97652580458998 \ - --hash=sha256:0ee68fe502f9031f19d495dae2c268830df2760c0524cbac5d759921ba8c8e82 \ - --hash=sha256:1553cb82942b2a74dd9b15a018dce645d4e68674de2ca31ff13ebc2d9f283788 \ - --hash=sha256:1a073fc9ab1c8aff37c99f11f1641e16da517770e31a37265d2755282a5d28aa \ - --hash=sha256:1d2256283fa4b7f4c7d7d3e84dc2ece74d341bce57d5b9bf385df109c2a1a82f \ - --hash=sha256:1d5023a4b6a5b183dc838808087033ec5df77580485fc533e7dab2567851b0a4 \ - --hash=sha256:1fdf26fa8a6a592f8f9235285b8affa72748dc12e964a5518c6c5e8f916716f7 \ - --hash=sha256:2529338a6ff0eb0b50c7be33dc3d0e456381157a31eefc561771ee431134a97f \ - --hash=sha256:279e5de4671e79a9ac877427f4ac4ce93751b8823f276b681d04b2156713b9dd \ - --hash=sha256:2d903ad4419f5b472de90cd2d40384573b25da71e33519a67797de17ef849b69 \ - --hash=sha256:332d126167ddddec94597c2365537baf9ff62dfcc9db4266f263d455f2f031cb \ - --hash=sha256:34fd59a4ac42dff6d4681d8843217137f6bc85ed29722f2f7222bd619d15e95b \ - --hash=sha256:3580dd9c1ad0701169e4d6fc41e878ffe05e6bdcaf3c412f9d559389d0c9e016 \ - --hash=sha256:3ccc8a0c387629aec40f2fc9fdcb4b9d5431954f934da3eaf16cdc94f67dbfac \ - --hash=sha256:41f696ba95cd92dc047e46b41b26dd24518384749ed0d99bea0a941ca87404c4 \ - --hash=sha256:42cc5452a54a8e46a032521d7365da775823e21bfba2895fb7b77633cce031bb \ - --hash=sha256:4841ed00f1026dfbced6fca7d963c4e7043aa832648671b5138008dc5a8f6d99 \ - --hash=sha256:4b253869ea05a5a073ebfdcb5cb3b0266a57c3764cf6fe114e4cd90f4bfa5f5e \ - --hash=sha256:54c6e5b3d3a8936a4ab6870d46bdd6ec500ad62bde9e44462c32d18f1e9a8e54 \ - --hash=sha256:619d9f06372b3a42bc29d0cd0354c9bb9fb39c2cbc1a9c5025b4538738dbffaf \ - --hash=sha256:6505c1b31274723ccaf5f515c1824a4ad2f0d191cec942666b3d0f3aa4cb4007 \ - --hash=sha256:660e2d9068d2bedc0912af508f30bbeb505bbbf9774d98def45f68278cea20d3 \ - --hash=sha256:6681ba9e7f8f3b19440921e99efbb40fc89f26cd71bf539e45d8c8a25c976dc6 \ - --hash=sha256:68b977f21ce443d6d378dbd5ca38621755f2063d6fdb3335bda981d552cfff86 \ - --hash=sha256:69269f3a0b472e91125b503d3c0b3566bda26da0a3261c49f0027eb6075086d1 \ - --hash=sha256:6f1a3f10f836fab6ca6efa97bb952300b20ae56b409414ca85bff2ad241d2a61 \ - --hash=sha256:7622a89d696fc87af8e8d280d9b421db5133ef5b29d3f7a1ce9f1a7bf7fcfa11 \ - --hash=sha256:777354ee16f02f643a4c7f2b3eff8027a33c9861edc691a2003531f5da4f6bc8 \ - --hash=sha256:84d27a4832cc1a0ee07cdcf2b0629a8a72db73f4cf6de6f0904f6661227f256f \ - --hash=sha256:8531fdcad636d82c517b26a448dcfe62f720e1922b33c81ce695d0edb91eb931 \ - --hash=sha256:86d2a77fd490ae3ff6fae1c6ceaecad063d3cc2320b44377efdde79880e11526 \ - --hash=sha256:88fc51d9a26b10fc331be344f1781224a375b78488fc343620184e95a4b27016 \ - --hash=sha256:8a34e13a62a59c871064dfd8ffb150867e54291e46d4a7cf11d02c94a5275bae \ - --hash=sha256:8c82f11964f010053e13daafdc7154ce7385ecc538989a354ccc7067fd7028fd \ - --hash=sha256:92b2065d642bf8c0a82d59e59053dd2fdde64d4ed44efe4870fa816c1232647b \ - --hash=sha256:97b52894d948d2f6ea480171a27122d77af14ced35f62e5c892ca2fae9344311 \ - --hash=sha256:9d9acd80072abcc98bd2c86c3c9cd4ac2347b5a5a0cae7ed5c0ee5675f86d9af \ - --hash=sha256:9f59a3c656fef341a99e3d63189852be7084c0e54b75734cde571182c087b152 \ - --hash=sha256:aa5003845cdd21ac0dc6c9bf661c5beddd01116f6eb9eb3c8e272353d45b3288 \ - --hash=sha256:b16fff62b45eccb9c7abb18e60e7e446998093cdcb50fed33134b9b6878836de \ - --hash=sha256:b30c6590146e53149f04e85a6e4fcae068df4289e31e4aee1fdf56a0dead8f97 \ - --hash=sha256:b58cbf0697721120866820b89f93659abc31c1e876bf20d0b3d03cef14faf84d \ - --hash=sha256:b67c6f5e5a401fc56394f191f00f9b3811fe843ee93f4a70df3c389d1adf857d \ - --hash=sha256:bceab846bac555aff6427d060f2fcfff71042dba6f5fca7dc4f75cac815e57ca \ - --hash=sha256:bee9fcb41db2a23bed96c6b6ead6489702c12334ea20a297aa095ce6d31370d0 \ - --hash=sha256:c114e8da9b475739dde229fd3bc6b05a6537a88a578358bc8eb29b4030fac9c9 \ - --hash=sha256:c1f0524f203e3bd35149f12157438f406eff2e4fb30f71221c8a5eceb3617b6b \ - --hash=sha256:c792ea4eabc0159535608fc5658a74d1a81020eb35195dd63214dcf07556f67e \ - --hash=sha256:c7f3cb904cce8e1be667c7e6fef4516b98d1a6a0635a58a57528d577ac18a128 \ - --hash=sha256:d67ac60a307f760c6e65dad586f556dde58e683fab03323221a4e530ead6f74d \ - --hash=sha256:dcacf2c7a6c3a84e720d1bb2b543c675bf6c40e460300b628bab1b1efc7c034c \ - --hash=sha256:de36fe9c02995c7e6ae6efe2e205816f5f00c22fd1fbf343d4d18c3d5ceac2f5 \ - --hash=sha256:def07915168ac8f7853812cc593c71185a16216e9e4fa886358a17ed0fd9fcf6 \ - --hash=sha256:df41b9bc27c2c25b486bae7cf42fccdc52ff181c8c387bfd026624a491c2671b \ - --hash=sha256:e052b8467dd07d4943936009f46ae5ce7b908ddcac3fda581656b1b19c083d9b \ - --hash=sha256:e063b1865974611313a3849d43f2c3f5368093691349cf3c7c8f8f75ad7cb280 \ - --hash=sha256:e1459677e5d12be8bbc7584c35b992eea142911a6236a3278b9b5ce3326f282c \ - --hash=sha256:e1a99a7a71631f0efe727c10edfba09ea6bee4166a6f9c19aafb6c0b5917d09c \ - --hash=sha256:e590228200fcfc7e9109509e4d9125eace2042fd52b595dd22bbc34bb282307f \ - --hash=sha256:e6316827e3e79b7b8e7d8e3b08f4e331af91a48e794d5d8b099928b6f0b85f20 \ - --hash=sha256:e7837cb169eca3b3ae94cc5787c4fed99eef74c0ab9506756eea335e0d6f3ed8 \ - --hash=sha256:e848f46a58b9fcf3d06061d17be388caf70ea5b8cc3466251963c8345e13f7eb \ - --hash=sha256:ed058398f55163a79bb9f06a90ef9ccc063b204bb346c4de78efc5d15abfe602 \ - --hash=sha256:f2e58f2c36cc52d41f2659e4c0cbf7353e28c8c9e63e30d8c6d3494dc9fdedcf \ - --hash=sha256:f467ba0050b7de85016b43f5a22b46383ef004c4f672148a8abf32bc999a87f0 \ - --hash=sha256:f61bdb1df43dc9c131791fbc2355535f9024b9a04398d3bd0684fc16ab07df74 \ - --hash=sha256:fb06eea71a00a7af0ae6aefbb932fb8a7df3cb390cc217d51a9ad7343de1b8d0 \ - --hash=sha256:ffd7dcaf744f25f82190856bc26ed81721508fc5cbf2a330751e135ff1283564 - # via -r requirements/requirements.in diff --git a/examples/multi_python_versions/requirements/requirements_lock_3_14.txt b/examples/multi_python_versions/requirements/requirements_lock_3_14.txt deleted file mode 100644 index f0aaaa90af..0000000000 --- a/examples/multi_python_versions/requirements/requirements_lock_3_14.txt +++ /dev/null @@ -1,78 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.14 -# by the following command: -# -# bazel run //requirements:requirements_3_14.update -# -websockets==11.0.3 ; python_full_version > "3.9.1" \ - --hash=sha256:01f5567d9cf6f502d655151645d4e8b72b453413d3819d2b6f1185abc23e82dd \ - --hash=sha256:03aae4edc0b1c68498f41a6772d80ac7c1e33c06c6ffa2ac1c27a07653e79d6f \ - --hash=sha256:0ac56b661e60edd453585f4bd68eb6a29ae25b5184fd5ba51e97652580458998 \ - --hash=sha256:0ee68fe502f9031f19d495dae2c268830df2760c0524cbac5d759921ba8c8e82 \ - --hash=sha256:1553cb82942b2a74dd9b15a018dce645d4e68674de2ca31ff13ebc2d9f283788 \ - --hash=sha256:1a073fc9ab1c8aff37c99f11f1641e16da517770e31a37265d2755282a5d28aa \ - --hash=sha256:1d2256283fa4b7f4c7d7d3e84dc2ece74d341bce57d5b9bf385df109c2a1a82f \ - --hash=sha256:1d5023a4b6a5b183dc838808087033ec5df77580485fc533e7dab2567851b0a4 \ - --hash=sha256:1fdf26fa8a6a592f8f9235285b8affa72748dc12e964a5518c6c5e8f916716f7 \ - --hash=sha256:2529338a6ff0eb0b50c7be33dc3d0e456381157a31eefc561771ee431134a97f \ - --hash=sha256:279e5de4671e79a9ac877427f4ac4ce93751b8823f276b681d04b2156713b9dd \ - --hash=sha256:2d903ad4419f5b472de90cd2d40384573b25da71e33519a67797de17ef849b69 \ - --hash=sha256:332d126167ddddec94597c2365537baf9ff62dfcc9db4266f263d455f2f031cb \ - --hash=sha256:34fd59a4ac42dff6d4681d8843217137f6bc85ed29722f2f7222bd619d15e95b \ - --hash=sha256:3580dd9c1ad0701169e4d6fc41e878ffe05e6bdcaf3c412f9d559389d0c9e016 \ - --hash=sha256:3ccc8a0c387629aec40f2fc9fdcb4b9d5431954f934da3eaf16cdc94f67dbfac \ - --hash=sha256:41f696ba95cd92dc047e46b41b26dd24518384749ed0d99bea0a941ca87404c4 \ - --hash=sha256:42cc5452a54a8e46a032521d7365da775823e21bfba2895fb7b77633cce031bb \ - --hash=sha256:4841ed00f1026dfbced6fca7d963c4e7043aa832648671b5138008dc5a8f6d99 \ - --hash=sha256:4b253869ea05a5a073ebfdcb5cb3b0266a57c3764cf6fe114e4cd90f4bfa5f5e \ - --hash=sha256:54c6e5b3d3a8936a4ab6870d46bdd6ec500ad62bde9e44462c32d18f1e9a8e54 \ - --hash=sha256:619d9f06372b3a42bc29d0cd0354c9bb9fb39c2cbc1a9c5025b4538738dbffaf \ - --hash=sha256:6505c1b31274723ccaf5f515c1824a4ad2f0d191cec942666b3d0f3aa4cb4007 \ - --hash=sha256:660e2d9068d2bedc0912af508f30bbeb505bbbf9774d98def45f68278cea20d3 \ - --hash=sha256:6681ba9e7f8f3b19440921e99efbb40fc89f26cd71bf539e45d8c8a25c976dc6 \ - --hash=sha256:68b977f21ce443d6d378dbd5ca38621755f2063d6fdb3335bda981d552cfff86 \ - --hash=sha256:69269f3a0b472e91125b503d3c0b3566bda26da0a3261c49f0027eb6075086d1 \ - --hash=sha256:6f1a3f10f836fab6ca6efa97bb952300b20ae56b409414ca85bff2ad241d2a61 \ - --hash=sha256:7622a89d696fc87af8e8d280d9b421db5133ef5b29d3f7a1ce9f1a7bf7fcfa11 \ - --hash=sha256:777354ee16f02f643a4c7f2b3eff8027a33c9861edc691a2003531f5da4f6bc8 \ - --hash=sha256:84d27a4832cc1a0ee07cdcf2b0629a8a72db73f4cf6de6f0904f6661227f256f \ - --hash=sha256:8531fdcad636d82c517b26a448dcfe62f720e1922b33c81ce695d0edb91eb931 \ - --hash=sha256:86d2a77fd490ae3ff6fae1c6ceaecad063d3cc2320b44377efdde79880e11526 \ - --hash=sha256:88fc51d9a26b10fc331be344f1781224a375b78488fc343620184e95a4b27016 \ - --hash=sha256:8a34e13a62a59c871064dfd8ffb150867e54291e46d4a7cf11d02c94a5275bae \ - --hash=sha256:8c82f11964f010053e13daafdc7154ce7385ecc538989a354ccc7067fd7028fd \ - --hash=sha256:92b2065d642bf8c0a82d59e59053dd2fdde64d4ed44efe4870fa816c1232647b \ - --hash=sha256:97b52894d948d2f6ea480171a27122d77af14ced35f62e5c892ca2fae9344311 \ - --hash=sha256:9d9acd80072abcc98bd2c86c3c9cd4ac2347b5a5a0cae7ed5c0ee5675f86d9af \ - --hash=sha256:9f59a3c656fef341a99e3d63189852be7084c0e54b75734cde571182c087b152 \ - --hash=sha256:aa5003845cdd21ac0dc6c9bf661c5beddd01116f6eb9eb3c8e272353d45b3288 \ - --hash=sha256:b16fff62b45eccb9c7abb18e60e7e446998093cdcb50fed33134b9b6878836de \ - --hash=sha256:b30c6590146e53149f04e85a6e4fcae068df4289e31e4aee1fdf56a0dead8f97 \ - --hash=sha256:b58cbf0697721120866820b89f93659abc31c1e876bf20d0b3d03cef14faf84d \ - --hash=sha256:b67c6f5e5a401fc56394f191f00f9b3811fe843ee93f4a70df3c389d1adf857d \ - --hash=sha256:bceab846bac555aff6427d060f2fcfff71042dba6f5fca7dc4f75cac815e57ca \ - --hash=sha256:bee9fcb41db2a23bed96c6b6ead6489702c12334ea20a297aa095ce6d31370d0 \ - --hash=sha256:c114e8da9b475739dde229fd3bc6b05a6537a88a578358bc8eb29b4030fac9c9 \ - --hash=sha256:c1f0524f203e3bd35149f12157438f406eff2e4fb30f71221c8a5eceb3617b6b \ - --hash=sha256:c792ea4eabc0159535608fc5658a74d1a81020eb35195dd63214dcf07556f67e \ - --hash=sha256:c7f3cb904cce8e1be667c7e6fef4516b98d1a6a0635a58a57528d577ac18a128 \ - --hash=sha256:d67ac60a307f760c6e65dad586f556dde58e683fab03323221a4e530ead6f74d \ - --hash=sha256:dcacf2c7a6c3a84e720d1bb2b543c675bf6c40e460300b628bab1b1efc7c034c \ - --hash=sha256:de36fe9c02995c7e6ae6efe2e205816f5f00c22fd1fbf343d4d18c3d5ceac2f5 \ - --hash=sha256:def07915168ac8f7853812cc593c71185a16216e9e4fa886358a17ed0fd9fcf6 \ - --hash=sha256:df41b9bc27c2c25b486bae7cf42fccdc52ff181c8c387bfd026624a491c2671b \ - --hash=sha256:e052b8467dd07d4943936009f46ae5ce7b908ddcac3fda581656b1b19c083d9b \ - --hash=sha256:e063b1865974611313a3849d43f2c3f5368093691349cf3c7c8f8f75ad7cb280 \ - --hash=sha256:e1459677e5d12be8bbc7584c35b992eea142911a6236a3278b9b5ce3326f282c \ - --hash=sha256:e1a99a7a71631f0efe727c10edfba09ea6bee4166a6f9c19aafb6c0b5917d09c \ - --hash=sha256:e590228200fcfc7e9109509e4d9125eace2042fd52b595dd22bbc34bb282307f \ - --hash=sha256:e6316827e3e79b7b8e7d8e3b08f4e331af91a48e794d5d8b099928b6f0b85f20 \ - --hash=sha256:e7837cb169eca3b3ae94cc5787c4fed99eef74c0ab9506756eea335e0d6f3ed8 \ - --hash=sha256:e848f46a58b9fcf3d06061d17be388caf70ea5b8cc3466251963c8345e13f7eb \ - --hash=sha256:ed058398f55163a79bb9f06a90ef9ccc063b204bb346c4de78efc5d15abfe602 \ - --hash=sha256:f2e58f2c36cc52d41f2659e4c0cbf7353e28c8c9e63e30d8c6d3494dc9fdedcf \ - --hash=sha256:f467ba0050b7de85016b43f5a22b46383ef004c4f672148a8abf32bc999a87f0 \ - --hash=sha256:f61bdb1df43dc9c131791fbc2355535f9024b9a04398d3bd0684fc16ab07df74 \ - --hash=sha256:fb06eea71a00a7af0ae6aefbb932fb8a7df3cb390cc217d51a9ad7343de1b8d0 \ - --hash=sha256:ffd7dcaf744f25f82190856bc26ed81721508fc5cbf2a330751e135ff1283564 - # via -r requirements/requirements.in diff --git a/news/3978.fixed.md b/news/3978.fixed.md new file mode 100644 index 0000000000..fe297fa0ee --- /dev/null +++ b/news/3978.fixed.md @@ -0,0 +1,5 @@ +(pip) Wrap `pip_parse` and `unified_workspace_hub_repo` calls in the +WORKSPACE file with `maybe` from `@bazel_tools//tools/build_defs/repo:utils.bzl` +so that extracted wheel dependencies are reused and not re-created when the +WORKSPACE is evaluated multiple times. This mirrors the `maybe` pattern already +used in the bzlmod `pip` extension and in the generated `install_deps` macro. diff --git a/python/private/BUILD.bazel b/python/private/BUILD.bazel index a5f4d2da3e..33fa3a4cd1 100644 --- a/python/private/BUILD.bazel +++ b/python/private/BUILD.bazel @@ -929,6 +929,12 @@ bzl_library( deps = [":visibility"], ) +bzl_library( + name = "repo_utils", + srcs = ["repo_utils.bzl"], + deps = [":text_util"], +) + bzl_library( name = "bzlmod_enabled", srcs = ["bzlmod_enabled.bzl"], @@ -994,11 +1000,6 @@ bzl_library( srcs = ["py_runtime_info.bzl"], ) -bzl_library( - name = "repo_utils", - srcs = ["repo_utils.bzl"], -) - bzl_library( name = "runtimes_manifest_workspace", srcs = ["runtimes_manifest_workspace.bzl"], diff --git a/python/private/internal_dev_deps.bzl b/python/private/internal_dev_deps.bzl index 5bbee232f9..926ee37268 100644 --- a/python/private/internal_dev_deps.bzl +++ b/python/private/internal_dev_deps.bzl @@ -14,12 +14,15 @@ """Module extension for internal dev_dependency=True setup.""" load("@bazel_ci_rules//:rbe_repo.bzl", "rbe_preconfig") -load("//python/private/pypi:whl_library.bzl", "whl_library") +load("//python/private:repo_utils.bzl", "repo_utils") +load("//python/private/pypi:whl_library.bzl", _whl_library = "whl_library") load("//tests/support/whl_from_dir:whl_from_dir_repo.bzl", "whl_from_dir_repo") load(":runtime_env_repo.bzl", "runtime_env_repo") def _internal_dev_deps_impl(mctx): _ = mctx # @unused + maybe = repo_utils.maybe({}) + whl_library = lambda **kwargs: _whl_library(maybe = maybe, **kwargs) # Creates a default toolchain config for RBE. # Use this as is if you are using the rbe_ubuntu16_04 container, @@ -118,6 +121,7 @@ def _internal_dev_deps_impl(mctx): root = "//tests/pypi/whl_library/testdata/pkg:BUILD.bazel", output = "pkg-1.0-any-none-any.whl", requirement = "pkg[optional]", + maybe = maybe, # The following is necessary to enable pipstar and make tests faster config_load = "@rules_python//tests/pypi/whl_library/testdata:packages.bzl", dep_template = "@whl_library_extras_{name}//:{target}", @@ -126,6 +130,7 @@ def _internal_dev_deps_impl(mctx): name = "whl_library_extras_optional_dep", root = "//tests/pypi/whl_library/testdata/optional_dep:BUILD.bazel", output = "optional_dep-1.0-any-none-any.whl", + maybe = maybe, requirement = "optional_dep", # The following is necessary to enable pipstar and make tests faster config_load = "@rules_python//tests/pypi/whl_library/testdata:packages.bzl", @@ -149,15 +154,16 @@ def _internal_dev_deps_impl(mctx): }, ) -def _whl_library_from_dir(*, name, output, root, **kwargs): +def _whl_library_from_dir(*, name, output, root, maybe, **kwargs): whl_from_dir_repo( name = "{}_whl".format(name), root = root, output = output, ) - whl_library( + _whl_library( name = name, whl_file = "@{}_whl//:{}".format(name, output), + maybe = maybe, **kwargs ) diff --git a/python/private/pypi/BUILD.bazel b/python/private/pypi/BUILD.bazel index 775aa0d9d2..c16ee49076 100644 --- a/python/private/pypi/BUILD.bazel +++ b/python/private/pypi/BUILD.bazel @@ -473,6 +473,7 @@ bzl_library( ":urllib", ":whl_extract", ":whl_metadata", + ":whl_repo_name", "//python/private:auth", "//python/private:envsubst", "//python/private:is_standalone_interpreter", @@ -522,6 +523,12 @@ bzl_library( deps = ["//python/private:envsubst"], ) +bzl_library( + name = "index_sources", + srcs = ["index_sources.bzl"], + deps = [":hash"], +) + bzl_library( name = "argparse", srcs = ["argparse.bzl"], @@ -542,12 +549,6 @@ bzl_library( srcs = ["hash.bzl"], ) -bzl_library( - name = "index_sources", - srcs = ["index_sources.bzl"], - deps = [":hash"], -) - bzl_library( name = "labels", srcs = ["labels.bzl"], diff --git a/python/private/pypi/extension.bzl b/python/private/pypi/extension.bzl index 210e169d4d..91bb79d690 100644 --- a/python/private/pypi/extension.bzl +++ b/python/private/pypi/extension.bzl @@ -22,6 +22,7 @@ load("//python/private:auth.bzl", "AUTH_ATTRS") load("//python/private:normalize_name.bzl", "normalize_name") load("//python/private:pyproject_utils.bzl", "read_pyproject", "version_from_requires_python") load("//python/private:repo_utils.bzl", "repo_utils") +load("//python/private:text_util.bzl", "render") load(":hub_builder.bzl", "hub_builder") load(":hub_repository.bzl", "hub_repository", "whl_config_settings_to_json") load(":parse_whl_name.bzl", "parse_whl_name") @@ -463,10 +464,27 @@ You cannot use both the additive_build_content and additive_build_content_file a out = hub.build() for whl_name, lib in out.whl_libraries.items(): + # NOTE @aignas 2026-07-04: if the same wheel is downloaded from multiple + # indexes, this will fail, forcing the user to actually download the wheel + # from the same and deterministic location. This is usually the case for + # public wheels and users should setup the defaults.index_url to correct + # fall-back in rules_python we should handle the default index to substitute + # any index-url in requirements pointing to the public PyPI mirrors. if whl_name in whl_libraries: - fail("'{}' already in created".format(whl_name)) - else: - whl_libraries[whl_name] = lib + existing = whl_libraries[whl_name] + + diff = repo_utils.diff_dict(existing, lib) + if diff: + fail("'{}' already in created:\n{}".format( + whl_name, + "\n".join([ + " {}: {}".format(key, render.indent(render.dict(value)).lstrip()) + for key, value in diff.items() + if value + ]), + )) + + whl_libraries[whl_name] = lib exposed_packages[hub.name] = out.exposed_packages extra_aliases[hub.name] = out.extra_aliases @@ -611,8 +629,13 @@ def _pip_impl(module_ctx): # Build all of the wheel modifications if the tag class is called. _whl_mods_impl(mods.whl_mods) + registered = {} for name, args in mods.whl_libraries.items(): - whl_library(name = name, **args) + whl_library( + name = name, + maybe = repo_utils.maybe(registered), + **args + ) for hub_name, whl_map in mods.hub_whl_map.items(): hub_repository( @@ -991,7 +1014,7 @@ a string `"{os}_{arch}"` as the value here. You could also use `"{os}_{arch}_fre """, ), "uv_lock": attr.label( - doc = """ + doc = """\ (label, optional): A label pointing to the uv.lock file. If provided, the uv.lock file will be used as the primary source for package metadata. diff --git a/python/private/pypi/hub_builder.bzl b/python/private/pypi/hub_builder.bzl index 596cfb2cbe..9a2b9ee832 100644 --- a/python/private/pypi/hub_builder.bzl +++ b/python/private/pypi/hub_builder.bzl @@ -88,6 +88,7 @@ def hub_builder( # Functions to download according to the config # dict[str python_version, callable] _get_index_urls = {}, + _default_index_url = {}, # Tells whether to use the downloader for a package. # dict[str python_version, dict[str package_name, bool use_downloader]] _use_downloader = {}, @@ -257,44 +258,6 @@ def _add_extra_aliases(self, extra_hub_aliases): {alias: True for alias in aliases}, ) -def _diff_dict(first, second): - """A simple utility to shallow compare dictionaries. - - Args: - first: The first dictionary to compare. - second: The second dictionary to compare. - - Returns: - A dictionary containing the differences, with keys "common", "different", - "extra", and "missing", or None if the dictionaries are identical. - """ - missing = {} - extra = { - key: value - for key, value in second.items() - if key not in first - } - common = {} - different = {} - - for key, value in first.items(): - if key not in second: - missing[key] = value - elif value == second[key]: - common[key] = value - else: - different[key] = (value, second[key]) - - if missing or extra or different: - return { - "common": common, - "different": different, - "extra": extra, - "missing": missing, - } - else: - return None - def _add_whl_library(self, *, python_version, whl, repo): """Add a whl_library and kwargs to call it with for the hub. @@ -310,16 +273,10 @@ def _add_whl_library(self, *, python_version, whl, repo): # disallow building from sdist. return - # TODO @aignas 2025-06-29: we should not need the version in the repo_name if - # we are using pipstar and we are downloading the wheel using the downloader - # - # However, for that we should first have a different way to reference closures with - # extras. For example, if some package depends on `foo[extra]` and another depends on - # `foo`, we should have 2 py_library targets. repo_name = "{}_{}_{}".format(self.name, version_label(python_version), repo.repo_name) if repo_name in self._whl_libraries: - diff = _diff_dict(self._whl_libraries[repo_name], repo.args) + diff = repo_utils.diff_dict(self._whl_libraries[repo_name], repo.args) if diff: self._logger.fail(lambda: ( "Attempting to create a duplicate library {repo_name} for {whl_name} with different arguments. Already existing declaration has:\n".format( @@ -349,24 +306,25 @@ def _add_whl_library(self, *, python_version, whl, repo): ### end of setters, below we have various functions to implement the public methods def _set_get_index_urls(self, mctx, pip_attr): + python_version = pip_attr.python_version + # Resolve the index URL through envsubst so the ``$VAR`` / ``${VAR:-default}`` # form is honored when deciding whether the experimental index-url mode is # active. Without this, an unsubstituted template like ``$RULES_PYTHON_PIP_INDEX_URL`` # is treated as truthy and the mode is forced on, even when the env var # would expand to the empty string. - default_index_url = envsubst( + self._default_index_url[python_version] = envsubst( pip_attr.experimental_index_url, pip_attr.envsubst, mctx.getenv, ) or self._config.index_url default_extra_index_urls = pip_attr.experimental_extra_index_urls or [] - if not default_index_url: + if not self._default_index_url[python_version]: # parallel_download is set to True by default, so we are not checking/validating it # here return False - python_version = pip_attr.python_version self._use_downloader.setdefault(python_version, {}).update({ normalize_name(s): False for s in pip_attr.simpleapi_skip @@ -374,7 +332,7 @@ def _set_get_index_urls(self, mctx, pip_attr): self._get_index_urls[python_version] = lambda ctx, distributions, *, index_url = None, extra_index_urls = None: self._simpleapi_download_fn( ctx, attr = struct( - index_url = (index_url or default_index_url).rstrip("/"), + index_url = (index_url or self._default_index_url[python_version]).rstrip("/"), extra_index_urls = [ x.rstrip("/") for x in (extra_index_urls or default_extra_index_urls) diff --git a/python/private/pypi/whl_library.bzl b/python/private/pypi/whl_library.bzl index 640a6518a6..48e2a8822f 100644 --- a/python/private/pypi/whl_library.bzl +++ b/python/private/pypi/whl_library.bzl @@ -28,6 +28,7 @@ load(":pypi_repo_utils.bzl", "pypi_repo_utils") load(":urllib.bzl", "urllib") load(":whl_extract.bzl", "whl_extract") load(":whl_metadata.bzl", "parse_entry_points", "whl_metadata") +load(":whl_repo_name.bzl", "whl_repo_name") _CPPFLAGS = "CPPFLAGS" _COMMAND_LINE_TOOLS_PATH_SLUG = "commandlinetools" @@ -752,7 +753,7 @@ def _whl_deps_library_impl(rctx): repo = rctx.attr.repo or ( str(rctx.attr.metadata_file) if rctx.attr.metadata_file else None ), - extras = requirement(rctx.attr.requirement).extras, + extras = rctx.attr.extras, ) rctx.file("BUILD.bazel", build_file_contents) @@ -764,9 +765,10 @@ whl_deps_library = repository_rule( "dep_template", "group_deps", "group_name", - "requirement", + "repo_prefix", ] } | { + "extras": attr.string_list(doc = "The extras to configure for this repo."), "metadata": attr.string( doc = """ The subset of the METADATA contents that is needed for generation of the dependencies. @@ -789,7 +791,16 @@ Does not depend on any python. environ = [REPO_DEBUG_ENV_VAR], ) -def whl_library(name, repo = None, **kwargs): +def whl_library( + name, + repo = None, + maybe = lambda fn, **kwargs: fn(**kwargs), + rules = struct( + whl_deps_library = whl_deps_library, + pip_archive = pip_archive, + whl_archive = whl_archive, + ), + **kwargs): """Create a whl_library. This proxies to one of the underlying implementations: @@ -799,6 +810,10 @@ def whl_library(name, repo = None, **kwargs): Args: name: {type}`str` The name of the repo. repo: Unused, will be dropped in the next major release. + maybe: This is the repo rule that is used in WORKSPACE mode and in the extension eval to + dedupe some of the invocations. This has to be overridden on bzlmod using + {obj}`repo_utils.bzlmod_maybe`. + rules: Used in tests for mocking. **kwargs: The args passed to the underlying implementation. Returns: @@ -810,6 +825,83 @@ def whl_library(name, repo = None, **kwargs): urls = kwargs.get("urls", []) filename = kwargs.get("filename") if whl_file or (urls and filename and filename.endswith(".whl")): - whl_archive(name = name, **kwargs) + filename = filename or Label(whl_file).name + if "annotation" in kwargs or "whl_patches" in kwargs: + # No reuse of the whl_library because there is an annotation here + rules.whl_archive(name = name, **kwargs) + return + + extract_args = { + k: v + for k, v in kwargs.items() + if k not in { + # These attributes are specific to pip_archive and are not + # accepted by whl_archive. + "config_load": None, + "dep_template": None, + "python_interpreter": None, + "python_interpreter_target": None, + } + } + if "index_url" in extract_args: + extract_args["index_url"] = extract_args["index_url"].strip("/") + + # The extras do not affect the extraction, so normalize the requirement + # to allow the same wheel to be extracted only once. + extract_args["requirement"] = _without_extras(extract_args["requirement"]) + extract_repo_name = "w_{}".format( + whl_repo_name(filename, kwargs.get("sha256")), + ) + + maybe( + rules.whl_archive, + name = extract_repo_name, + **extract_args + ) + + req = requirement(kwargs["requirement"]) + + deps_args = { + k: kwargs.get(k) + for k in [ + "config_load", + "dep_template", + "group_deps", + "group_name", + "repo_prefix", + ] + if kwargs.get(k) != None + } | { + "metadata_file": "@{}//:metadata.json".format(extract_repo_name), + } + if req.extras: + deps_args["extras"] = req.extras + rules.whl_deps_library( + name = name, + **deps_args + ) else: - pip_archive(name = name, **kwargs) + # No reuse of the whl_library because we have args that force the extraction of the whl + # in the hub context. If we have whl-only pipstar extraction, then we can reuse the + # extracted sources. + rules.pip_archive(name = name, **kwargs) + +def _without_extras(requirement_line): + """Remove the extras from a requirement line. + + The extras do not affect which wheel is downloaded and extracted, so they + can be removed to allow the same wheel to be extracted only once even when + it is referenced with different extras. + + Args: + requirement_line: {type}`str` the requirement line, e.g. + `foo[bar]==1.0 --hash=sha256:...`. + + Returns: + The requirement line without the extras, e.g. `foo==1.0 --hash=sha256:...`. + """ + name_and_version, _, extras = requirement_line.partition("[") + if not extras: + return requirement_line + _, _, rest = extras.partition("]") + return name_and_version + rest diff --git a/python/private/pypi/whl_library_targets.bzl b/python/private/pypi/whl_library_targets.bzl index ee5c781b3d..bc8e4df9ad 100644 --- a/python/private/pypi/whl_library_targets.bzl +++ b/python/private/pypi/whl_library_targets.bzl @@ -99,7 +99,6 @@ def whl_library_targets( visibility: {type}`list[str]` The visibility of the targets. **kwargs: Extra args passed to the {obj}`whl_library_deps_targets` and {obj}`whl_library_srcs`. """ - create_extra_targets = bool(requires_dist or group_name) and dep_template whl_library_srcs( name = name, sdist_filename = sdist_filename, @@ -113,27 +112,22 @@ def whl_library_targets( copy_executables = copy_executables, enable_implicit_namespace_pkgs = enable_implicit_namespace_pkgs, namespace_package_files = namespace_package_files, - # If there are no dependencies, then let's create the targets with public labels. - # Note, we are not supporting grouping the packages in this case, but that is fine. - whl_name = WHEEL_FILE if create_extra_targets else WHEEL_FILE_PUBLIC_LABEL, - pkg_name = PY_SRCS_LABEL if create_extra_targets else PY_LIBRARY_PUBLIC_LABEL, **kwargs ) - if create_extra_targets: - whl_library_deps_targets( - name = name, - metadata_name = metadata_name, - requires_dist = requires_dist, - group_deps = group_deps, # only needed if requires_dist is present - extras = extras, # only needed if requires_dist is present - include = include, # only needed if requires_dist is present - group_name = group_name, # only needed if requires_dist is present - dep_template = dep_template, # only needed if requires_dist is present - repo = None, # set aliases in the same repo - aliases = {}, - **kwargs - ) + whl_library_deps_targets( + name = name, + metadata_name = metadata_name, + requires_dist = requires_dist, + group_deps = group_deps, # only needed if requires_dist is present + extras = extras, # only needed if requires_dist is present + include = include, # only needed if requires_dist is present + group_name = group_name, # only needed if requires_dist is present + dep_template = dep_template, # only needed if requires_dist is present + repo = None, # set aliases in the same repo + aliases = {}, + **kwargs + ) def whl_library_srcs( *, @@ -349,8 +343,8 @@ def whl_library_deps_targets( repo, aliases = None, metadata_name, - requires_dist, - extras, + requires_dist = [], + extras = [], include = [], group_deps = [], group_name = None, @@ -491,6 +485,8 @@ def whl_library_deps_targets( name = py_library_label, # We include as srcs to ensure that the (locations :pkg) works as expected. srcs = [repo_label(PY_SRCS_LABEL)], + # Never pre-compile, because we don't have real sources here. + precompile = "disabled", deps = _deps( # We include as deps, so that `PyInfo` and friends (e.g. `pyi_srcs`) get # propagated. Just passing the target as `srcs` is not enough to propagate diff --git a/python/private/pypi/whl_repo_name.bzl b/python/private/pypi/whl_repo_name.bzl index 739ff2a4a1..a0c693acbf 100644 --- a/python/private/pypi/whl_repo_name.bzl +++ b/python/private/pypi/whl_repo_name.bzl @@ -34,7 +34,8 @@ def whl_repo_name(filename, digest, *target_platforms): # Strip the `:` prefix so that the name only contains the hex digest # and stays the same as it has always been for bare sha256 values. - digest = digest.rpartition(":")[2] + if digest: + digest = digest.rpartition(":")[2] parts = [] diff --git a/python/private/repo_utils.bzl b/python/private/repo_utils.bzl index 0e83fda28c..dc3d4c4ae8 100644 --- a/python/private/repo_utils.bzl +++ b/python/private/repo_utils.bzl @@ -17,9 +17,75 @@ This code should only be loaded and used during the repository phase. """ +load(":text_util.bzl", "render") + REPO_DEBUG_ENV_VAR = "RULES_PYTHON_REPO_DEBUG" REPO_VERBOSITY_ENV_VAR = "RULES_PYTHON_REPO_DEBUG_VERBOSITY" +def _maybe(store): + def _inner(repo_rule, *, name, **kwargs): + existing = store.get(name) + if existing: + diff = _diff_dict(existing, kwargs) + if not diff: + return + + fail( + "Attempting to create a duplicate rule {name} with different arguments. Already existing declaration has:\n".format( + name = name, + ) + "\n".join([ + " {}: {}".format(key, render.indent(render.dict(value)).lstrip()) + for key, value in diff.items() + if value + ]), + ) + + store[name] = dict(kwargs) # make a copy + repo_rule(name = name, **kwargs) + + return _inner + +def _diff_dict(first, second, *, ignore_keys = {}): + """A simple utility to shallow compare dictionaries. + + Args: + first: The first dictionary to compare. + second: The second dictionary to compare. + ignore_keys: A set of keys to ignore during comparison. + + Returns: + A dictionary containing the differences, with keys "common", "different", + "extra", and "missing", or None if the dictionaries are identical. + """ + missing = {} + extra = { + key: value + for key, value in second.items() + if key not in first and key not in ignore_keys + } + common = {} + different = {} + + for key, value in first.items(): + if key in ignore_keys: + continue + elif key not in second: + missing[key] = value + elif value == second[key]: + common[key] = value + else: + different[key] = (value, second[key]) + + if missing or extra or different: + return { + "common": common, + "different": different, + "extra": extra, + "missing": missing, + } + else: + return None + def _is_repo_debug_enabled(mrctx): """Tells if debbugging output is requested during repo operatiosn. @@ -587,6 +653,7 @@ def _rename(mrctx, src, dest): repo_utils = struct( # keep sorted + diff_dict = _diff_dict, execute_checked = _execute_checked, execute_checked_stdout = _execute_checked_stdout, execute_unchecked = _execute_unchecked, @@ -596,6 +663,7 @@ repo_utils = struct( is_repo_debug_enabled = _is_repo_debug_enabled, logger = _logger, maybe_fix_permissions = _maybe_fix_permissions, + maybe = _maybe, mkdir = _mkdir, norm_path = _norm_path, relative_to = _relative_to, diff --git a/tests/integration/whl_library/MODULE.bazel b/tests/integration/whl_library/MODULE.bazel index 39a579f79e..9dad3b7d9d 100644 --- a/tests/integration/whl_library/MODULE.bazel +++ b/tests/integration/whl_library/MODULE.bazel @@ -53,5 +53,4 @@ whl_deps_library( name = "whl_deps_library", dep_template = "@integration_test//:{name}_{target}", metadata_file = "@whl_archive//:metadata.json", - requirement = "requests", ) diff --git a/tests/pypi/whl_library/BUILD.bazel b/tests/pypi/whl_library/BUILD.bazel index cade0d2b8e..65db520c6c 100644 --- a/tests/pypi/whl_library/BUILD.bazel +++ b/tests/pypi/whl_library/BUILD.bazel @@ -1,11 +1,3 @@ -load("//python:py_test.bzl", "py_test") -load("//tests/support:support.bzl", "SUPPORTS_BZLMOD") +load(":whl_library_tests.bzl", "whl_library_test_suite") -py_test( - name = "whl_library_extras_test", - srcs = ["whl_library_extras_test.py"], - target_compatible_with = SUPPORTS_BZLMOD, - deps = [ - "@whl_library_extras_direct_dep//:pkg", - ], -) +whl_library_test_suite(name = "whl_library_tests") diff --git a/tests/pypi/whl_library/whl_library_tests.bzl b/tests/pypi/whl_library/whl_library_tests.bzl new file mode 100644 index 0000000000..d2a8c275e1 --- /dev/null +++ b/tests/pypi/whl_library/whl_library_tests.bzl @@ -0,0 +1,298 @@ +# Copyright 2024 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +"""Tests for //python/private/pypi:whl_library.bzl + +These tests verify the dispatching logic in the ``whl_library`` function, +ensuring the correct underlying rule is invoked (directly or via ``maybe``) +with the right arguments for each code path. + +The ``rules`` parameter of ``whl_library`` is used to inject mock rule functions +that record their calls instead of creating actual repository rules. +""" + +load("@rules_testing//lib:test_suite.bzl", "test_suite") + +# buildifier: disable=bzl-visibility +load("//python/private/pypi:whl_library.bzl", "whl_library") + +_tests = [] + +def _mock_rules(calls): + def _whl_archive(**kwargs): + calls.append(struct(rule = "whl_archive", kwargs = dict(kwargs))) + return kwargs.get("name") + + def _pip_archive(**kwargs): + calls.append(struct(rule = "pip_archive", kwargs = dict(kwargs))) + return kwargs.get("name") + + def _whl_deps_library(**kwargs): + calls.append(struct(rule = "whl_deps_library", kwargs = dict(kwargs))) + return kwargs.get("name") + + return struct( + whl_archive = _whl_archive, + pip_archive = _pip_archive, + whl_deps_library = _whl_deps_library, + ) + +def _calls_for(calls, rule_name): + return [c for c in calls if c.rule == rule_name] + +def _test_whl_file_reuse_path(env): + calls = [] + whl_library( + name = "test_repo", + rules = _mock_rules(calls), + whl_file = "@some_wheels//:pkg-1.0-py3-none-any.whl", + requirement = "pkg==1.0", + ) + whl_archive_calls = _calls_for(calls, "whl_archive") + env.expect.that_int(len(whl_archive_calls)).equals(1) + env.expect.that_dict(whl_archive_calls[0].kwargs).contains_exactly({ + "name": "w_pkg_1_0_py3_none_any", + "requirement": "pkg==1.0", + "whl_file": "@some_wheels//:pkg-1.0-py3-none-any.whl", + }) + deps_calls = _calls_for(calls, "whl_deps_library") + env.expect.that_int(len(deps_calls)).equals(1) + env.expect.that_dict(deps_calls[0].kwargs).contains_exactly({ + "metadata_file": "@w_pkg_1_0_py3_none_any//:metadata.json", + "name": "test_repo", + }) + +_tests.append(_test_whl_file_reuse_path) + +def _test_urls_reuse_path(env): + calls = [] + whl_library( + name = "test_repo", + rules = _mock_rules(calls), + whl_file = None, + urls = ["https://example.com/pkg-1.0-py3-none-any.whl"], + filename = "pkg-1.0-py3-none-any.whl", + requirement = "pkg==1.0", + config_load = "@pypi//:config.bzl", + ) + whl_archive_calls = _calls_for(calls, "whl_archive") + env.expect.that_int(len(whl_archive_calls)).equals(1) + env.expect.that_dict(whl_archive_calls[0].kwargs).contains_exactly({ + "filename": "pkg-1.0-py3-none-any.whl", + "name": "w_pkg_1_0_py3_none_any", + "requirement": "pkg==1.0", + "urls": ["https://example.com/pkg-1.0-py3-none-any.whl"], + "whl_file": None, + }) + deps_calls = _calls_for(calls, "whl_deps_library") + env.expect.that_int(len(deps_calls)).equals(1) + env.expect.that_dict(deps_calls[0].kwargs).contains_exactly({ + "config_load": "@pypi//:config.bzl", + "metadata_file": "@w_pkg_1_0_py3_none_any//:metadata.json", + "name": "test_repo", + }) + +_tests.append(_test_urls_reuse_path) + +def _test_annotation_no_reuse(env): + calls = [] + whl_library( + name = "test_repo", + rules = _mock_rules(calls), + whl_file = None, + urls = ["https://example.com/pkg-1.0-py3-none-any.whl"], + filename = "pkg-1.0-py3-none-any.whl", + requirement = "pkg[extra]==1.0", + annotation = "@some_repo//:pkg.annotation.json", + ) + whl_archive_calls = _calls_for(calls, "whl_archive") + env.expect.that_int(len(whl_archive_calls)).equals(1) + env.expect.that_dict(whl_archive_calls[0].kwargs).contains_exactly({ + "annotation": "@some_repo//:pkg.annotation.json", + "filename": "pkg-1.0-py3-none-any.whl", + "name": "test_repo", + "requirement": "pkg[extra]==1.0", + "urls": ["https://example.com/pkg-1.0-py3-none-any.whl"], + "whl_file": None, + }) + env.expect.that_int(len(_calls_for(calls, "whl_deps_library"))).equals(0) + +_tests.append(_test_annotation_no_reuse) + +def _test_whl_patches_no_reuse(env): + calls = [] + whl_library( + name = "test_repo", + rules = _mock_rules(calls), + whl_file = None, + urls = ["https://example.com/pkg-1.0-py3-none-any.whl"], + filename = "pkg-1.0-py3-none-any.whl", + requirement = "pkg==1.0", + whl_patches = {"//patches:foo.patch": "json"}, + ) + whl_archive_calls = _calls_for(calls, "whl_archive") + env.expect.that_int(len(whl_archive_calls)).equals(1) + env.expect.that_dict(whl_archive_calls[0].kwargs).contains_exactly({ + "filename": "pkg-1.0-py3-none-any.whl", + "name": "test_repo", + "requirement": "pkg==1.0", + "urls": ["https://example.com/pkg-1.0-py3-none-any.whl"], + "whl_file": None, + "whl_patches": {"//patches:foo.patch": "json"}, + }) + env.expect.that_int(len(_calls_for(calls, "whl_deps_library"))).equals(0) + +_tests.append(_test_whl_patches_no_reuse) + +def _test_pip_archive_path(env): + calls = [] + whl_library( + name = "test_repo", + rules = _mock_rules(calls), + requirement = "pkg==1.0", + config_load = "@pypi//:config.bzl", + ) + pip_archive_calls = _calls_for(calls, "pip_archive") + env.expect.that_int(len(pip_archive_calls)).equals(1) + env.expect.that_dict(pip_archive_calls[0].kwargs).contains_exactly({ + "config_load": "@pypi//:config.bzl", + "name": "test_repo", + "requirement": "pkg==1.0", + }) + env.expect.that_int(len(_calls_for(calls, "whl_archive"))).equals(0) + +_tests.append(_test_pip_archive_path) + +def _test_extras_not_passed_when_empty(env): + calls = [] + whl_library( + name = "test_repo", + rules = _mock_rules(calls), + whl_file = None, + urls = ["https://example.com/pkg-1.0-py3-none-any.whl"], + filename = "pkg-1.0-py3-none-any.whl", + requirement = "pkg==1.0", + config_load = "@pypi//:config.bzl", + ) + deps_calls = _calls_for(calls, "whl_deps_library") + env.expect.that_int(len(deps_calls)).equals(1) + env.expect.that_collection( + deps_calls[0].kwargs.keys(), + ).contains_none_of(["extras"]) + +_tests.append(_test_extras_not_passed_when_empty) + +def _test_extras_passed_when_non_empty(env): + calls = [] + whl_library( + name = "test_repo", + rules = _mock_rules(calls), + whl_file = None, + urls = ["https://example.com/pkg-1.0-py3-none-any.whl"], + filename = "pkg-1.0-py3-none-any.whl", + requirement = "pkg[foo,bar]==1.0", + config_load = "@pypi//:config.bzl", + ) + deps_calls = _calls_for(calls, "whl_deps_library") + env.expect.that_int(len(deps_calls)).equals(1) + env.expect.that_collection( + deps_calls[0].kwargs["extras"], + ).contains_exactly(["foo", "bar"]) + +_tests.append(_test_extras_passed_when_non_empty) + +def _test_python_interpreter_excluded(env): + calls = [] + whl_library( + name = "test_repo", + rules = _mock_rules(calls), + whl_file = None, + urls = ["https://example.com/pkg-1.0-py3-none-any.whl"], + filename = "pkg-1.0-py3-none-any.whl", + requirement = "pkg==1.0", + config_load = "@pypi//:config.bzl", + python_interpreter = "python3", + python_interpreter_target = "@python//:python", + ) + whl_archive_calls = _calls_for(calls, "whl_archive") + env.expect.that_int(len(whl_archive_calls)).equals(1) + env.expect.that_collection( + whl_archive_calls[0].kwargs.keys(), + ).contains_none_of(["python_interpreter", "python_interpreter_target"]) + +_tests.append(_test_python_interpreter_excluded) + +def _test_config_load_excluded_from_extract_args(env): + calls = [] + whl_library( + name = "test_repo", + rules = _mock_rules(calls), + whl_file = None, + urls = ["https://example.com/pkg-1.0-py3-none-any.whl"], + filename = "pkg-1.0-py3-none-any.whl", + requirement = "pkg==1.0", + config_load = "@pypi//:config.bzl", + dep_template = "@pypi%{name}//:{{target}}", + ) + whl_archive_calls = _calls_for(calls, "whl_archive") + env.expect.that_int(len(whl_archive_calls)).equals(1) + env.expect.that_collection( + whl_archive_calls[0].kwargs.keys(), + ).contains_none_of(["config_load", "dep_template"]) + +_tests.append(_test_config_load_excluded_from_extract_args) + +def _test_wheel_reuse_across_different_extras(env): + calls = [] + whl_library( + name = "pkg_foo_repo", + rules = _mock_rules(calls), + whl_file = None, + urls = ["https://example.com/pkg-1.0-py3-none-any.whl"], + filename = "pkg-1.0-py3-none-any.whl", + requirement = "pkg[foo]==1.0", + ) + whl_library( + name = "pkg_bar_repo", + rules = _mock_rules(calls), + whl_file = None, + urls = ["https://example.com/pkg-1.0-py3-none-any.whl"], + filename = "pkg-1.0-py3-none-any.whl", + requirement = "pkg[bar]==1.0", + ) + whl_archive_calls = _calls_for(calls, "whl_archive") + env.expect.that_int(len(whl_archive_calls)).equals(2) + env.expect.that_str(whl_archive_calls[0].kwargs["name"]).equals("w_pkg_1_0_py3_none_any") + env.expect.that_str(whl_archive_calls[1].kwargs["name"]).equals("w_pkg_1_0_py3_none_any") + + deps_calls = _calls_for(calls, "whl_deps_library") + env.expect.that_int(len(deps_calls)).equals(2) + env.expect.that_dict(deps_calls[0].kwargs).contains_exactly({ + "extras": ["foo"], + "metadata_file": "@w_pkg_1_0_py3_none_any//:metadata.json", + "name": "pkg_foo_repo", + }) + env.expect.that_dict(deps_calls[1].kwargs).contains_exactly({ + "extras": ["bar"], + "metadata_file": "@w_pkg_1_0_py3_none_any//:metadata.json", + "name": "pkg_bar_repo", + }) + +_tests.append(_test_wheel_reuse_across_different_extras) + +def whl_library_test_suite(name): + test_suite( + name = name, + basic_tests = _tests, + ) diff --git a/tests/pypi/whl_library_targets/whl_library_targets_tests.bzl b/tests/pypi/whl_library_targets/whl_library_targets_tests.bzl index d752159b32..289ca5bc47 100644 --- a/tests/pypi/whl_library_targets/whl_library_targets_tests.bzl +++ b/tests/pypi/whl_library_targets/whl_library_targets_tests.bzl @@ -173,6 +173,7 @@ def _test_whl_library_deps_targets(env): ":is_include_bar_baz_true": ["@pypi//bar_baz:pkg"], "//conditions:default": [], }), + "precompile": "disabled", "tags": [], "visibility": ["//visibility:public"], }) # buildifier: @unsorted-dict-items diff --git a/tests/venv_site_packages_libs/app_files_building/app_files_building_tests.bzl b/tests/venv_site_packages_libs/app_files_building/app_files_building_tests.bzl index 663ab6963e..1349052578 100644 --- a/tests/venv_site_packages_libs/app_files_building/app_files_building_tests.bzl +++ b/tests/venv_site_packages_libs/app_files_building/app_files_building_tests.bzl @@ -452,51 +452,51 @@ def _test_optimized_grouping_pkgutil_whls_impl(env, target): # Entries from pkgutil_ns1 _venv_symlink( "nspkg/__init__.py", - link_to_path = "+internal_dev_deps+pkgutil_nspkg1/site-packages/nspkg/__init__.py", + link_to_path = "+internal_dev_deps+w_pkgutil_nspkg1_1_0_any_none_any/site-packages/nspkg/__init__.py", files = [ - "../+internal_dev_deps+pkgutil_nspkg1/site-packages/nspkg/__init__.py", + "../+internal_dev_deps+w_pkgutil_nspkg1_1_0_any_none_any/site-packages/nspkg/__init__.py", ], ), _venv_symlink( "nspkg/one", - link_to_path = "+internal_dev_deps+pkgutil_nspkg1/site-packages/nspkg/one", + link_to_path = "+internal_dev_deps+w_pkgutil_nspkg1_1_0_any_none_any/site-packages/nspkg/one", files = [ - "../+internal_dev_deps+pkgutil_nspkg1/site-packages/nspkg/one/a.txt", + "../+internal_dev_deps+w_pkgutil_nspkg1_1_0_any_none_any/site-packages/nspkg/one/a.txt", ], ), _venv_symlink( "pkgutil_nspkg1-1.0.dist-info", - link_to_path = "+internal_dev_deps+pkgutil_nspkg1/site-packages/pkgutil_nspkg1-1.0.dist-info", + link_to_path = "+internal_dev_deps+w_pkgutil_nspkg1_1_0_any_none_any/site-packages/pkgutil_nspkg1-1.0.dist-info", files = [ - "../+internal_dev_deps+pkgutil_nspkg1/site-packages/pkgutil_nspkg1-1.0.dist-info/INSTALLER", - "../+internal_dev_deps+pkgutil_nspkg1/site-packages/pkgutil_nspkg1-1.0.dist-info/METADATA", - "../+internal_dev_deps+pkgutil_nspkg1/site-packages/pkgutil_nspkg1-1.0.dist-info/RECORD", - "../+internal_dev_deps+pkgutil_nspkg1/site-packages/pkgutil_nspkg1-1.0.dist-info/WHEEL", + "../+internal_dev_deps+w_pkgutil_nspkg1_1_0_any_none_any/site-packages/pkgutil_nspkg1-1.0.dist-info/INSTALLER", + "../+internal_dev_deps+w_pkgutil_nspkg1_1_0_any_none_any/site-packages/pkgutil_nspkg1-1.0.dist-info/METADATA", + "../+internal_dev_deps+w_pkgutil_nspkg1_1_0_any_none_any/site-packages/pkgutil_nspkg1-1.0.dist-info/RECORD", + "../+internal_dev_deps+w_pkgutil_nspkg1_1_0_any_none_any/site-packages/pkgutil_nspkg1-1.0.dist-info/WHEEL", ], ), # Entries from pkgutil_ns2 _venv_symlink( "nspkg/__init__.py", - link_to_path = "+internal_dev_deps+pkgutil_nspkg2/site-packages/nspkg/__init__.py", + link_to_path = "+internal_dev_deps+w_pkgutil_nspkg2_1_0_any_none_any/site-packages/nspkg/__init__.py", files = [ - "../+internal_dev_deps+pkgutil_nspkg2/site-packages/nspkg/__init__.py", + "../+internal_dev_deps+w_pkgutil_nspkg2_1_0_any_none_any/site-packages/nspkg/__init__.py", ], ), _venv_symlink( "nspkg/two", - link_to_path = "+internal_dev_deps+pkgutil_nspkg2/site-packages/nspkg/two", + link_to_path = "+internal_dev_deps+w_pkgutil_nspkg2_1_0_any_none_any/site-packages/nspkg/two", files = [ - "../+internal_dev_deps+pkgutil_nspkg2/site-packages/nspkg/two/b.txt", + "../+internal_dev_deps+w_pkgutil_nspkg2_1_0_any_none_any/site-packages/nspkg/two/b.txt", ], ), _venv_symlink( "pkgutil_nspkg2-1.0.dist-info", - link_to_path = "+internal_dev_deps+pkgutil_nspkg2/site-packages/pkgutil_nspkg2-1.0.dist-info", + link_to_path = "+internal_dev_deps+w_pkgutil_nspkg2_1_0_any_none_any/site-packages/pkgutil_nspkg2-1.0.dist-info", files = [ - "../+internal_dev_deps+pkgutil_nspkg2/site-packages/pkgutil_nspkg2-1.0.dist-info/INSTALLER", - "../+internal_dev_deps+pkgutil_nspkg2/site-packages/pkgutil_nspkg2-1.0.dist-info/METADATA", - "../+internal_dev_deps+pkgutil_nspkg2/site-packages/pkgutil_nspkg2-1.0.dist-info/RECORD", - "../+internal_dev_deps+pkgutil_nspkg2/site-packages/pkgutil_nspkg2-1.0.dist-info/WHEEL", + "../+internal_dev_deps+w_pkgutil_nspkg2_1_0_any_none_any/site-packages/pkgutil_nspkg2-1.0.dist-info/INSTALLER", + "../+internal_dev_deps+w_pkgutil_nspkg2_1_0_any_none_any/site-packages/pkgutil_nspkg2-1.0.dist-info/METADATA", + "../+internal_dev_deps+w_pkgutil_nspkg2_1_0_any_none_any/site-packages/pkgutil_nspkg2-1.0.dist-info/RECORD", + "../+internal_dev_deps+w_pkgutil_nspkg2_1_0_any_none_any/site-packages/pkgutil_nspkg2-1.0.dist-info/WHEEL", ], ), ]) @@ -507,16 +507,16 @@ def _test_optimized_grouping_pkgutil_whls_impl(env, target): env.expect.that_collection(_venv_symlinks_from_entries(conflicts[0])).contains_exactly([ _venv_symlink( "nspkg/__init__.py", - link_to_path = "+internal_dev_deps+pkgutil_nspkg1/site-packages/nspkg/__init__.py", + link_to_path = "+internal_dev_deps+w_pkgutil_nspkg1_1_0_any_none_any/site-packages/nspkg/__init__.py", files = [ - "../+internal_dev_deps+pkgutil_nspkg1/site-packages/nspkg/__init__.py", + "../+internal_dev_deps+w_pkgutil_nspkg1_1_0_any_none_any/site-packages/nspkg/__init__.py", ], ), _venv_symlink( "nspkg/__init__.py", - link_to_path = "+internal_dev_deps+pkgutil_nspkg2/site-packages/nspkg/__init__.py", + link_to_path = "+internal_dev_deps+w_pkgutil_nspkg2_1_0_any_none_any/site-packages/nspkg/__init__.py", files = [ - "../+internal_dev_deps+pkgutil_nspkg2/site-packages/nspkg/__init__.py", + "../+internal_dev_deps+w_pkgutil_nspkg2_1_0_any_none_any/site-packages/nspkg/__init__.py", ], ), ])