@@ -461,6 +461,21 @@ def _test_simple_get_index(env):
461461 ),
462462 },
463463 ),
464+ "some_other_pkg" : struct (
465+ whls = {
466+ "deadb33f" : struct (
467+ yanked = False ,
468+ filename = "some-other-pkg-0.0.1-py3-none-any.whl" ,
469+ sha256 = "deadb33f" ,
470+ url = "example2.org/index/some_other_pkg/" ,
471+ ),
472+ },
473+ sdists = {},
474+ sha256s_by_version = {
475+ "0.0.1" : ["deadb33f" ],
476+ "0.0.3" : ["deadbeef" ],
477+ },
478+ ),
464479 }
465480
466481 pypi = _parse_modules (
@@ -485,7 +500,10 @@ def _test_simple_get_index(env):
485500simple==0.0.1 \
486501 --hash=sha256:deadbeef \
487502 --hash=sha256:deadb00f
488- some_pkg==0.0.1
503+ some_pkg==0.0.1 @ example-direct.org/some_pkg-0.0.1-py3-none-any.whl \
504+ --hash=sha256:deadbaaf
505+ some_other_pkg==0.0.1
506+ pip_fallback==0.0.1
489507""" ,
490508 }[x ],
491509 ),
@@ -496,42 +514,71 @@ some_pkg==0.0.1
496514 )
497515
498516 pypi .is_reproducible ().equals (False )
499- pypi .exposed_packages ().contains_exactly ({"pypi" : ["simple" , "some_pkg" ]})
517+ pypi .exposed_packages ().contains_exactly ({"pypi" : ["pip_fallback" , " simple" , "some_other_pkg " , "some_pkg" ]})
500518 pypi .hub_group_map ().contains_exactly ({"pypi" : {}})
501519 pypi .hub_whl_map ().contains_exactly ({
502520 "pypi" : {
521+ "pip_fallback" : {
522+ "pypi_315_pip_fallback" : [
523+ struct (
524+ config_setting = None ,
525+ filename = None ,
526+ target_platforms = None ,
527+ version = "3.15" ,
528+ ),
529+ ],
530+ },
503531 "simple" : {
504532 "pypi_315_simple_py3_none_any_deadb00f" : [
505- whl_config_setting (
533+ struct (
534+ config_setting = None ,
506535 filename = "simple-0.0.1-py3-none-any.whl" ,
536+ target_platforms = None ,
507537 version = "3.15" ,
508538 ),
509539 ],
510540 "pypi_315_simple_sdist_deadbeef" : [
511- whl_config_setting (
541+ struct (
542+ config_setting = None ,
512543 filename = "simple-0.0.1.tar.gz" ,
544+ target_platforms = None ,
545+ version = "3.15" ,
546+ ),
547+ ],
548+ },
549+ "some_other_pkg" : {
550+ "pypi_315_some_py3_none_any_deadb33f" : [
551+ struct (
552+ config_setting = None ,
553+ filename = "some-other-pkg-0.0.1-py3-none-any.whl" ,
554+ target_platforms = None ,
513555 version = "3.15" ,
514556 ),
515557 ],
516558 },
517559 "some_pkg" : {
518- "pypi_315_some_pkg" : [whl_config_setting (version = "3.15" )],
560+ "pypi_315_some_pkg_py3_none_any_deadbaaf" : [
561+ struct (
562+ config_setting = None ,
563+ filename = "some_pkg-0.0.1-py3-none-any.whl" ,
564+ target_platforms = None ,
565+ version = "3.15" ,
566+ ),
567+ ],
519568 },
520569 },
521570 })
522571 pypi .whl_libraries ().contains_exactly ({
572+ "pypi_315_pip_fallback" : {
573+ "dep_template" : "@pypi//{name}:{target}" ,
574+ "extra_pip_args" : ["--extra-args-for-sdist-building" ],
575+ "python_interpreter_target" : "unit_test_interpreter_target" ,
576+ "repo" : "pypi_315" ,
577+ "requirement" : "pip_fallback==0.0.1" ,
578+ },
523579 "pypi_315_simple_py3_none_any_deadb00f" : {
524580 "dep_template" : "@pypi//{name}:{target}" ,
525- "experimental_target_platforms" : [
526- "cp315_linux_aarch64" ,
527- "cp315_linux_arm" ,
528- "cp315_linux_ppc" ,
529- "cp315_linux_s390x" ,
530- "cp315_linux_x86_64" ,
531- "cp315_osx_aarch64" ,
532- "cp315_osx_x86_64" ,
533- "cp315_windows_x86_64" ,
534- ],
581+ "experimental_target_platforms" : ["cp315_linux_aarch64" , "cp315_linux_arm" , "cp315_linux_ppc" , "cp315_linux_s390x" , "cp315_linux_x86_64" , "cp315_osx_aarch64" , "cp315_osx_x86_64" , "cp315_windows_x86_64" ],
535582 "filename" : "simple-0.0.1-py3-none-any.whl" ,
536583 "python_interpreter_target" : "unit_test_interpreter_target" ,
537584 "repo" : "pypi_315" ,
@@ -541,16 +588,7 @@ some_pkg==0.0.1
541588 },
542589 "pypi_315_simple_sdist_deadbeef" : {
543590 "dep_template" : "@pypi//{name}:{target}" ,
544- "experimental_target_platforms" : [
545- "cp315_linux_aarch64" ,
546- "cp315_linux_arm" ,
547- "cp315_linux_ppc" ,
548- "cp315_linux_s390x" ,
549- "cp315_linux_x86_64" ,
550- "cp315_osx_aarch64" ,
551- "cp315_osx_x86_64" ,
552- "cp315_windows_x86_64" ,
553- ],
591+ "experimental_target_platforms" : ["cp315_linux_aarch64" , "cp315_linux_arm" , "cp315_linux_ppc" , "cp315_linux_s390x" , "cp315_linux_x86_64" , "cp315_osx_aarch64" , "cp315_osx_x86_64" , "cp315_windows_x86_64" ],
554592 "extra_pip_args" : ["--extra-args-for-sdist-building" ],
555593 "filename" : "simple-0.0.1.tar.gz" ,
556594 "python_interpreter_target" : "unit_test_interpreter_target" ,
@@ -559,29 +597,43 @@ some_pkg==0.0.1
559597 "sha256" : "deadbeef" ,
560598 "urls" : ["example.org" ],
561599 },
562- # We are falling back to regular `pip`
563- "pypi_315_some_pkg" : {
600+ "pypi_315_some_pkg_py3_none_any_deadbaaf" : {
564601 "dep_template" : "@pypi//{name}:{target}" ,
565- "extra_pip_args" : ["--extra-args-for-sdist-building" ],
602+ "experimental_target_platforms" : ["cp315_linux_aarch64" , "cp315_linux_arm" , "cp315_linux_ppc" , "cp315_linux_s390x" , "cp315_linux_x86_64" , "cp315_osx_aarch64" , "cp315_osx_x86_64" , "cp315_windows_x86_64" ],
603+ "filename" : "some_pkg-0.0.1-py3-none-any.whl" ,
566604 "python_interpreter_target" : "unit_test_interpreter_target" ,
567605 "repo" : "pypi_315" ,
568- "requirement" : "some_pkg==0.0.1" ,
606+ "requirement" : "some_pkg==0.0.1 @ example-direct.org/some_pkg-0.0.1-py3-none-any.whl --hash=sha256:deadbaaf" ,
607+ "sha256" : "deadbaaf" ,
608+ "urls" : ["example-direct.org/some_pkg-0.0.1-py3-none-any.whl" ],
609+ },
610+ "pypi_315_some_py3_none_any_deadb33f" : {
611+ "dep_template" : "@pypi//{name}:{target}" ,
612+ "experimental_target_platforms" : ["cp315_linux_aarch64" , "cp315_linux_arm" , "cp315_linux_ppc" , "cp315_linux_s390x" , "cp315_linux_x86_64" , "cp315_osx_aarch64" , "cp315_osx_x86_64" , "cp315_windows_x86_64" ],
613+ "filename" : "some-other-pkg-0.0.1-py3-none-any.whl" ,
614+ "python_interpreter_target" : "unit_test_interpreter_target" ,
615+ "repo" : "pypi_315" ,
616+ "requirement" : "some_other_pkg==0.0.1" ,
617+ "sha256" : "deadb33f" ,
618+ "urls" : ["example2.org/index/some_other_pkg/" ],
569619 },
570620 })
571621 pypi .whl_mods ().contains_exactly ({})
572- env .expect .that_dict (got_simpleapi_download_kwargs ).contains_exactly ({
573- "attr" : struct (
574- auth_patterns = {},
575- envsubst = {},
576- extra_index_urls = [],
577- index_url = "pypi.org" ,
578- index_url_overrides = {},
579- netrc = None ,
580- sources = ["simple" ],
581- ),
582- "cache" : {},
583- "parallel_download" : False ,
584- })
622+ env .expect .that_dict (got_simpleapi_download_kwargs ).contains_exactly (
623+ {
624+ "attr" : struct (
625+ auth_patterns = {},
626+ envsubst = {},
627+ extra_index_urls = [],
628+ index_url = "pypi.org" ,
629+ index_url_overrides = {},
630+ netrc = None ,
631+ sources = ["simple" , "pip_fallback" , "some_other_pkg" ],
632+ ),
633+ "cache" : {},
634+ "parallel_download" : False ,
635+ },
636+ )
585637
586638_tests .append (_test_simple_get_index )
587639
0 commit comments