Skip to content

Commit df6eb5d

Browse files
committed
add a test
1 parent a9056b1 commit df6eb5d

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

tests/pypi/hub_builder/hub_builder_tests.bzl

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,7 @@ def _test_torch_experimental_index_url(env):
566566
for (os, cpu), whl_platform_tags in {
567567
("linux", "x86_64"): ["linux_x86_64", "manylinux_*_x86_64"],
568568
("linux", "aarch64"): ["linux_aarch64", "manylinux_*_aarch64"],
569+
("osx", "x86_64"): ["macosx_*_x86_64"],
569570
("osx", "aarch64"): ["macosx_*_arm64"],
570571
("windows", "x86_64"): ["win_amd64"],
571572
("windows", "aarch64"): ["win_arm64"], # this should be ignored
@@ -800,6 +801,20 @@ def _test_simple_get_index(env):
800801
got_simpleapi_download_args.extend(args)
801802
got_simpleapi_download_kwargs.update(kwargs)
802803
return {
804+
"plat_pkg": struct(
805+
whls = {
806+
"deadb44f": struct(
807+
yanked = False,
808+
filename = "plat-pkg-0.0.4-py3-none-linux_x86_64.whl",
809+
sha256 = "deadb44f",
810+
url = "example2.org/index/plat_pkg/",
811+
),
812+
},
813+
sdists = {},
814+
sha256s_by_version = {
815+
"0.0.4": ["deadb44f"],
816+
},
817+
),
803818
"simple": struct(
804819
whls = {
805820
"deadb00f": struct(
@@ -850,6 +865,7 @@ some_pkg==0.0.1 @ example-direct.org/some_pkg-0.0.1-py3-none-any.whl \
850865
--hash=sha256:deadbaaf
851866
direct_without_sha==0.0.1 @ example-direct.org/direct_without_sha-0.0.1-py3-none-any.whl
852867
some_other_pkg==0.0.1
868+
plat_pkg==0.0.4
853869
pip_fallback==0.0.1
854870
direct_sdist_without_sha @ some-archive/any-name.tar.gz
855871
git_dep @ git+https://git.server/repo/project@deadbeefdeadbeef
@@ -873,6 +889,7 @@ git_dep @ git+https://git.server/repo/project@deadbeefdeadbeef
873889
"direct_without_sha",
874890
"git_dep",
875891
"pip_fallback",
892+
"plat_pkg",
876893
"simple",
877894
"some_other_pkg",
878895
"some_pkg",
@@ -921,6 +938,17 @@ git_dep @ git+https://git.server/repo/project@deadbeefdeadbeef
921938
),
922939
],
923940
},
941+
"plat_pkg": {
942+
"pypi_315_plat_py3_none_linux_x86_64_deadb44f": [
943+
whl_config_setting(
944+
target_platforms = [
945+
"cp315_linux_x86_64",
946+
"cp315_linux_x86_64_freethreaded",
947+
],
948+
version = "3.15",
949+
),
950+
],
951+
},
924952
"simple": {
925953
"pypi_315_simple_py3_none_any_deadb00f": [
926954
whl_config_setting(
@@ -998,6 +1026,15 @@ git_dep @ git+https://git.server/repo/project@deadbeefdeadbeef
9981026
"python_interpreter_target": "unit_test_interpreter_target",
9991027
"requirement": "pip_fallback==0.0.1",
10001028
},
1029+
"pypi_315_plat_py3_none_linux_x86_64_deadb44f": {
1030+
"config_load": "@pypi//:config.bzl",
1031+
"dep_template": "@pypi//{name}:{target}",
1032+
"filename": "plat-pkg-0.0.4-py3-none-linux_x86_64.whl",
1033+
"python_interpreter_target": "unit_test_interpreter_target",
1034+
"requirement": "plat_pkg==0.0.4",
1035+
"sha256": "deadb44f",
1036+
"urls": ["example2.org/index/plat_pkg/"],
1037+
},
10011038
"pypi_315_simple_py3_none_any_deadb00f": {
10021039
"config_load": "@pypi//:config.bzl",
10031040
"dep_template": "@pypi//{name}:{target}",
@@ -1036,7 +1073,7 @@ git_dep @ git+https://git.server/repo/project@deadbeefdeadbeef
10361073
index_url = "pypi.org",
10371074
index_url_overrides = {},
10381075
netrc = None,
1039-
sources = ["simple", "pip_fallback", "some_other_pkg"],
1076+
sources = ["simple", "plat_pkg", "pip_fallback", "some_other_pkg"],
10401077
),
10411078
"cache": {},
10421079
"parallel_download": False,

0 commit comments

Comments
 (0)