@@ -44,6 +44,7 @@ def hub_builder(
4444 debug = False ,
4545 config = None ,
4646 minor_mapping = {},
47+ whl_overrides = {},
4748 evaluate_markers_fn = None ,
4849 simpleapi_download_fn = None ,
4950 available_interpreters = {}):
@@ -76,7 +77,7 @@ def hub_builder(
7677 netrc = None ,
7778 auth_patterns = None ,
7879 ),
79- whl_overrides = {} ,
80+ whl_overrides = whl_overrides ,
8081 minor_mapping = minor_mapping or {"3.15" : "3.15.19" },
8182 available_interpreters = available_interpreters or {
8283 "python_3_15_host" : "unit_test_interpreter_target" ,
@@ -320,7 +321,6 @@ def _test_simple_extras_vs_no_extras_simpleapi(env):
320321 "config_load" : "@pypi//:config.bzl" ,
321322 "dep_template" : "@pypi//{name}:{target}" ,
322323 "filename" : "simple-0.0.1-py3-none-any.whl" ,
323- "python_interpreter_target" : "unit_test_interpreter_target" ,
324324 "requirement" : "simple[foo]==0.0.1" ,
325325 "sha256" : "deadbeef" ,
326326 "urls" : ["https://example.com/simple-0.0.1-py3-none-any.whl" ],
@@ -329,7 +329,6 @@ def _test_simple_extras_vs_no_extras_simpleapi(env):
329329 "config_load" : "@pypi//:config.bzl" ,
330330 "dep_template" : "@pypi//{name}:{target}" ,
331331 "filename" : "simple-0.0.1-py3-none-any.whl" ,
332- "python_interpreter_target" : "unit_test_interpreter_target" ,
333332 "requirement" : "simple==0.0.1" ,
334333 "sha256" : "deadbeef" ,
335334 "urls" : ["https://example.com/simple-0.0.1-py3-none-any.whl" ],
@@ -656,7 +655,6 @@ torch==2.4.1+cpu ; platform_machine == 'x86_64' \
656655 "config_load" : "@pypi//:config.bzl" ,
657656 "dep_template" : "@pypi//{name}:{target}" ,
658657 "filename" : "torch-2.4.1+cpu-cp312-cp312-linux_x86_64.whl" ,
659- "python_interpreter_target" : "unit_test_interpreter_target" ,
660658 "requirement" : "torch==2.4.1+cpu" ,
661659 "sha256" : "8800deef0026011d502c0c256cc4b67d002347f63c3a38cd8e45f1f445c61364" ,
662660 "urls" : ["https://torch.index/whl/cpu/torch-2.4.1%2Bcpu-cp312-cp312-linux_x86_64.whl" ],
@@ -665,7 +663,6 @@ torch==2.4.1+cpu ; platform_machine == 'x86_64' \
665663 "config_load" : "@pypi//:config.bzl" ,
666664 "dep_template" : "@pypi//{name}:{target}" ,
667665 "filename" : "torch-2.4.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl" ,
668- "python_interpreter_target" : "unit_test_interpreter_target" ,
669666 "requirement" : "torch==2.4.1" ,
670667 "sha256" : "36109432b10bd7163c9b30ce896f3c2cca1b86b9765f956a1594f0ff43091e2a" ,
671668 "urls" : ["https://torch.index/whl/cpu/torch-2.4.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl" ],
@@ -674,7 +671,6 @@ torch==2.4.1+cpu ; platform_machine == 'x86_64' \
674671 "config_load" : "@pypi//:config.bzl" ,
675672 "dep_template" : "@pypi//{name}:{target}" ,
676673 "filename" : "torch-2.4.1+cpu-cp312-cp312-win_amd64.whl" ,
677- "python_interpreter_target" : "unit_test_interpreter_target" ,
678674 "requirement" : "torch==2.4.1+cpu" ,
679675 "sha256" : "3a570e5c553415cdbddfe679207327b3a3806b21c6adea14fba77684d1619e97" ,
680676 "urls" : ["https://torch.index/whl/cpu/torch-2.4.1%2Bcpu-cp312-cp312-win_amd64.whl" ],
@@ -683,7 +679,6 @@ torch==2.4.1+cpu ; platform_machine == 'x86_64' \
683679 "config_load" : "@pypi//:config.bzl" ,
684680 "dep_template" : "@pypi//{name}:{target}" ,
685681 "filename" : "torch-2.4.1-cp312-none-macosx_11_0_arm64.whl" ,
686- "python_interpreter_target" : "unit_test_interpreter_target" ,
687682 "requirement" : "torch==2.4.1" ,
688683 "sha256" : "72b484d5b6cec1a735bf3fa5a1c4883d01748698c5e9cfdbeb4ffab7c7987e0d" ,
689684 "urls" : ["https://torch.index/whl/cpu/torch-2.4.1-cp312-none-macosx_11_0_arm64.whl" ],
@@ -845,6 +840,11 @@ def _test_simple_get_index(env):
845840 builder = hub_builder (
846841 env ,
847842 simpleapi_download_fn = mocksimpleapi_download ,
843+ whl_overrides = {
844+ "direct_without_sha" : {
845+ "my_patch" : 1 ,
846+ },
847+ },
848848 )
849849 builder .pip_parse (
850850 _mock_mctx (
@@ -1003,6 +1003,10 @@ git_dep @ git+https://git.server/repo/project@deadbeefdeadbeef
10031003 "requirement" : "direct_without_sha==0.0.1" ,
10041004 "sha256" : "" ,
10051005 "urls" : ["example-direct.org/direct_without_sha-0.0.1-py3-none-any.whl" ],
1006+ # NOTE @aignas 2025-11-24: any patching still requires the python interpreter from the
1007+ # hermetic toolchain or the system. This is so that we can rezip it back to a wheel and
1008+ # verify the metadata so that it is installable by any installer out there.
1009+ "whl_patches" : {"my_patch" : "1" },
10061010 },
10071011 "pypi_315_git_dep" : {
10081012 "config_load" : "@pypi//:config.bzl" ,
@@ -1022,7 +1026,6 @@ git_dep @ git+https://git.server/repo/project@deadbeefdeadbeef
10221026 "config_load" : "@pypi//:config.bzl" ,
10231027 "dep_template" : "@pypi//{name}:{target}" ,
10241028 "filename" : "plat-pkg-0.0.4-py3-none-linux_x86_64.whl" ,
1025- "python_interpreter_target" : "unit_test_interpreter_target" ,
10261029 "requirement" : "plat_pkg==0.0.4" ,
10271030 "sha256" : "deadb44f" ,
10281031 "urls" : ["example2.org/index/plat_pkg/" ],
@@ -1031,7 +1034,6 @@ git_dep @ git+https://git.server/repo/project@deadbeefdeadbeef
10311034 "config_load" : "@pypi//:config.bzl" ,
10321035 "dep_template" : "@pypi//{name}:{target}" ,
10331036 "filename" : "simple-0.0.1-py3-none-any.whl" ,
1034- "python_interpreter_target" : "unit_test_interpreter_target" ,
10351037 "requirement" : "simple==0.0.1" ,
10361038 "sha256" : "deadb00f" ,
10371039 "urls" : ["example2.org" ],
@@ -1040,7 +1042,6 @@ git_dep @ git+https://git.server/repo/project@deadbeefdeadbeef
10401042 "config_load" : "@pypi//:config.bzl" ,
10411043 "dep_template" : "@pypi//{name}:{target}" ,
10421044 "filename" : "some_pkg-0.0.1-py3-none-any.whl" ,
1043- "python_interpreter_target" : "unit_test_interpreter_target" ,
10441045 "requirement" : "some_pkg==0.0.1" ,
10451046 "sha256" : "deadbaaf" ,
10461047 "urls" : ["example-direct.org/some_pkg-0.0.1-py3-none-any.whl" ],
@@ -1049,7 +1050,6 @@ git_dep @ git+https://git.server/repo/project@deadbeefdeadbeef
10491050 "config_load" : "@pypi//:config.bzl" ,
10501051 "dep_template" : "@pypi//{name}:{target}" ,
10511052 "filename" : "some-other-pkg-0.0.1-py3-none-any.whl" ,
1052- "python_interpreter_target" : "unit_test_interpreter_target" ,
10531053 "requirement" : "some_other_pkg==0.0.1" ,
10541054 "sha256" : "deadb33f" ,
10551055 "urls" : ["example2.org/index/some_other_pkg/" ],
0 commit comments