@@ -40,19 +40,16 @@ simple==0.0.1 \
4040
4141def hub_builder (
4242 env ,
43- enable_pipstar = False ,
4443 debug = False ,
4544 config = None ,
4645 minor_mapping = {},
47- evaluate_markers_fn = None ,
4846 simpleapi_download_fn = None ,
4947 available_interpreters = {}):
5048 builder = _hub_builder (
5149 name = "pypi" ,
5250 module_name = "unit_test" ,
5351 config = config or struct (
5452 # no need to evaluate the markers with the interpreter
55- enable_pipstar = enable_pipstar ,
5653 platforms = {
5754 "{}_{}{}" .format (os , cpu , freethreaded ): _plat (
5855 name = "{}_{}{}" .format (os , cpu , freethreaded ),
@@ -76,13 +73,13 @@ def hub_builder(
7673 netrc = None ,
7774 auth_patterns = None ,
7875 ),
76+ evaluate_markers_fn = None ,
7977 whl_overrides = {},
8078 minor_mapping = minor_mapping or {"3.15" : "3.15.19" },
8179 available_interpreters = available_interpreters or {
8280 "python_3_15_host" : "unit_test_interpreter_target" ,
8381 },
8482 simpleapi_download_fn = simpleapi_download_fn or (lambda * a , ** k : {}),
85- evaluate_markers_fn = evaluate_markers_fn ,
8683 logger = repo_utils .logger (
8784 struct (
8885 os = struct (
@@ -303,14 +300,6 @@ _tests.append(_test_simple_multiple_python_versions)
303300def _test_simple_with_markers (env ):
304301 builder = hub_builder (
305302 env ,
306- evaluate_markers_fn = lambda _ , requirements , ** __ : {
307- key : [
308- platform
309- for platform in platforms
310- if ("x86_64" in platform and "platform_machine ==" in key ) or ("x86_64" not in platform and "platform_machine !=" in key )
311- ]
312- for key , platforms in requirements .items ()
313- },
314303 )
315304 builder .pip_parse (
316305 _mock_mctx (
@@ -405,7 +394,6 @@ def _test_torch_experimental_index_url(env):
405394 env ,
406395 config = struct (
407396 netrc = None ,
408- enable_pipstar = False ,
409397 auth_patterns = {},
410398 platforms = {
411399 "{}_{}" .format (os , cpu ): _plat (
@@ -431,15 +419,6 @@ def _test_torch_experimental_index_url(env):
431419 "python_3_12_host" : "unit_test_interpreter_target" ,
432420 },
433421 minor_mapping = {"3.12" : "3.12.19" },
434- evaluate_markers_fn = lambda _ , requirements , ** __ : {
435- # todo once 2692 is merged, this is going to be easier to test.
436- key : [
437- platform
438- for platform in platforms
439- if ("x86_64" in platform and "platform_machine ==" in key ) or ("x86_64" not in platform and "platform_machine !=" in key )
440- ]
441- for key , platforms in requirements .items ()
442- },
443422 simpleapi_download_fn = mocksimpleapi_download ,
444423 )
445424 builder .pip_parse (
@@ -516,7 +495,6 @@ torch==2.4.1+cpu ; platform_machine == 'x86_64' \
516495 pypi .whl_libraries ().contains_exactly ({
517496 "pypi_312_torch_cp312_cp312_linux_x86_64_8800deef" : {
518497 "dep_template" : "@pypi//{name}:{target}" ,
519- "experimental_target_platforms" : ["linux_x86_64" ],
520498 "filename" : "torch-2.4.1+cpu-cp312-cp312-linux_x86_64.whl" ,
521499 "python_interpreter_target" : "unit_test_interpreter_target" ,
522500 "requirement" : "torch==2.4.1+cpu" ,
@@ -525,7 +503,6 @@ torch==2.4.1+cpu ; platform_machine == 'x86_64' \
525503 },
526504 "pypi_312_torch_cp312_cp312_manylinux_2_17_aarch64_36109432" : {
527505 "dep_template" : "@pypi//{name}:{target}" ,
528- "experimental_target_platforms" : ["linux_aarch64" ],
529506 "filename" : "torch-2.4.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl" ,
530507 "python_interpreter_target" : "unit_test_interpreter_target" ,
531508 "requirement" : "torch==2.4.1" ,
@@ -534,7 +511,6 @@ torch==2.4.1+cpu ; platform_machine == 'x86_64' \
534511 },
535512 "pypi_312_torch_cp312_cp312_win_amd64_3a570e5c" : {
536513 "dep_template" : "@pypi//{name}:{target}" ,
537- "experimental_target_platforms" : ["windows_x86_64" ],
538514 "filename" : "torch-2.4.1+cpu-cp312-cp312-win_amd64.whl" ,
539515 "python_interpreter_target" : "unit_test_interpreter_target" ,
540516 "requirement" : "torch==2.4.1+cpu" ,
@@ -543,7 +519,6 @@ torch==2.4.1+cpu ; platform_machine == 'x86_64' \
543519 },
544520 "pypi_312_torch_cp312_none_macosx_11_0_arm64_72b484d5" : {
545521 "dep_template" : "@pypi//{name}:{target}" ,
546- "experimental_target_platforms" : ["osx_aarch64" ],
547522 "filename" : "torch-2.4.1-cp312-none-macosx_11_0_arm64.whl" ,
548523 "python_interpreter_target" : "unit_test_interpreter_target" ,
549524 "requirement" : "torch==2.4.1" ,
@@ -621,8 +596,6 @@ simple==0.0.3 \
621596 "pypi_315_extra" : {
622597 "dep_template" : "@pypi//{name}:{target}" ,
623598 "download_only" : True ,
624- # TODO @aignas 2025-04-20: ensure that this is in the hub repo
625- # "experimental_target_platforms": ["cp315_linux_x86_64"],
626599 "extra_pip_args" : ["--platform=manylinux_2_17_x86_64" , "--python-version=315" , "--implementation=cp" , "--abi=cp315" ],
627600 "python_interpreter_target" : "unit_test_interpreter_target" ,
628601 "requirement" : "extra==0.0.1 --hash=sha256:deadb00f" ,
@@ -821,12 +794,6 @@ git_dep @ git+https://git.server/repo/project@deadbeefdeadbeef
821794 pypi .whl_libraries ().contains_exactly ({
822795 "pypi_315_any_name" : {
823796 "dep_template" : "@pypi//{name}:{target}" ,
824- "experimental_target_platforms" : [
825- "linux_aarch64" ,
826- "linux_x86_64" ,
827- "osx_aarch64" ,
828- "windows_aarch64" ,
829- ],
830797 "extra_pip_args" : ["--extra-args-for-sdist-building" ],
831798 "filename" : "any-name.tar.gz" ,
832799 "python_interpreter_target" : "unit_test_interpreter_target" ,
@@ -836,12 +803,6 @@ git_dep @ git+https://git.server/repo/project@deadbeefdeadbeef
836803 },
837804 "pypi_315_direct_without_sha_0_0_1_py3_none_any" : {
838805 "dep_template" : "@pypi//{name}:{target}" ,
839- "experimental_target_platforms" : [
840- "linux_aarch64" ,
841- "linux_x86_64" ,
842- "osx_aarch64" ,
843- "windows_aarch64" ,
844- ],
845806 "filename" : "direct_without_sha-0.0.1-py3-none-any.whl" ,
846807 "python_interpreter_target" : "unit_test_interpreter_target" ,
847808 "requirement" : "direct_without_sha==0.0.1" ,
@@ -862,12 +823,6 @@ git_dep @ git+https://git.server/repo/project@deadbeefdeadbeef
862823 },
863824 "pypi_315_simple_py3_none_any_deadb00f" : {
864825 "dep_template" : "@pypi//{name}:{target}" ,
865- "experimental_target_platforms" : [
866- "linux_aarch64" ,
867- "linux_x86_64" ,
868- "osx_aarch64" ,
869- "windows_aarch64" ,
870- ],
871826 "filename" : "simple-0.0.1-py3-none-any.whl" ,
872827 "python_interpreter_target" : "unit_test_interpreter_target" ,
873828 "requirement" : "simple==0.0.1" ,
@@ -876,12 +831,6 @@ git_dep @ git+https://git.server/repo/project@deadbeefdeadbeef
876831 },
877832 "pypi_315_some_pkg_py3_none_any_deadbaaf" : {
878833 "dep_template" : "@pypi//{name}:{target}" ,
879- "experimental_target_platforms" : [
880- "linux_aarch64" ,
881- "linux_x86_64" ,
882- "osx_aarch64" ,
883- "windows_aarch64" ,
884- ],
885834 "filename" : "some_pkg-0.0.1-py3-none-any.whl" ,
886835 "python_interpreter_target" : "unit_test_interpreter_target" ,
887836 "requirement" : "some_pkg==0.0.1" ,
@@ -890,12 +839,6 @@ git_dep @ git+https://git.server/repo/project@deadbeefdeadbeef
890839 },
891840 "pypi_315_some_py3_none_any_deadb33f" : {
892841 "dep_template" : "@pypi//{name}:{target}" ,
893- "experimental_target_platforms" : [
894- "linux_aarch64" ,
895- "linux_x86_64" ,
896- "osx_aarch64" ,
897- "windows_aarch64" ,
898- ],
899842 "filename" : "some-other-pkg-0.0.1-py3-none-any.whl" ,
900843 "python_interpreter_target" : "unit_test_interpreter_target" ,
901844 "requirement" : "some_other_pkg==0.0.1" ,
@@ -925,14 +868,6 @@ _tests.append(_test_simple_get_index)
925868def _test_optimum_sys_platform_extra (env ):
926869 builder = hub_builder (
927870 env ,
928- evaluate_markers_fn = lambda _ , requirements , ** __ : {
929- key : [
930- platform
931- for platform in platforms
932- if ("darwin" in key and "osx" in platform ) or ("linux" in key and "linux" in platform )
933- ]
934- for key , platforms in requirements .items ()
935- },
936871 )
937872 builder .pip_parse (
938873 _mock_mctx (
@@ -946,13 +881,14 @@ optimum[onnxruntime-gpu]==1.17.1 ; sys_platform == 'linux'
946881 _parse (
947882 hub_name = "pypi" ,
948883 python_version = "3.15" ,
949- requirements_lock = "universal.txt" ,
884+ requirements_by_platform = {
885+ "universal.txt" : "linux_*,osx_*" ,
886+ },
950887 ),
951888 )
952889 pypi = builder .build ()
953890
954- # FIXME @aignas 2025-09-07: we should expose the `optimum` package
955- pypi .exposed_packages ().contains_exactly ([])
891+ pypi .exposed_packages ().contains_exactly (["optimum" ])
956892 pypi .group_map ().contains_exactly ({})
957893 pypi .whl_map ().contains_exactly ({
958894 "optimum" : {
@@ -995,9 +931,7 @@ _tests.append(_test_optimum_sys_platform_extra)
995931def _test_pipstar_platforms (env ):
996932 builder = hub_builder (
997933 env ,
998- enable_pipstar = True ,
999934 config = struct (
1000- enable_pipstar = True ,
1001935 netrc = None ,
1002936 auth_patterns = {},
1003937 platforms = {
0 commit comments