Skip to content

Commit 93086e2

Browse files
jbmscopybara-github
authored andcommitted
Store pre-generated tensorstore type stubs in source repo
PiperOrigin-RevId: 826661443 Change-Id: Ia6f0f92fc23907ba64566e04019ba783ea18b6e3
1 parent 35b4a45 commit 93086e2

File tree

7 files changed

+14187
-258
lines changed

7 files changed

+14187
-258
lines changed

bazel/run_binary_in_target_cfg_if_possible.bzl

Lines changed: 0 additions & 168 deletions
This file was deleted.

python/tensorstore/BUILD

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ load(
66
"pybind11_py_extension",
77
)
88
load("//bazel:pytest.bzl", "tensorstore_pytest_test")
9-
load("//bazel:pytype.bzl", "pytype_strict_binary", "pytype_strict_library")
10-
load("//bazel:run_binary_in_target_cfg_if_possible.bzl", "run_binary")
9+
load("//bazel:pytype.bzl", "pytype_strict_binary", "pytype_strict_library", "pytype_strict_test")
1110
load("//bazel:tensorstore.bzl", "tensorstore_cc_library")
1211
load("//docs:doctest.bzl", "doctest_test")
1312

@@ -22,10 +21,7 @@ exports_files([
2221
"cc_test_driver_main.py",
2322
])
2423

25-
PYI_FILES = [
26-
"__init__.pyi",
27-
"ocdbt.pyi",
28-
]
24+
PYI_FILES = glob(["**/*.pyi"])
2925

3026
doctest_test(
3127
name = "doctest_test",
@@ -1270,23 +1266,16 @@ tensorstore_pytest_test(
12701266
],
12711267
)
12721268

1273-
pytype_strict_binary(
1269+
pytype_strict_test(
12741270
name = "generate_type_stubs",
1271+
size = "small",
12751272
srcs = ["generate_type_stubs.py"],
1276-
data = ["__init__.py"],
1273+
args = ["--strip-generic-slice"],
1274+
data = ["__init__.py"] + PYI_FILES,
12771275
main = "generate_type_stubs.py",
12781276
deps = [
12791277
":_tensorstore_with_python_deps", # build_cleaner: keep
1278+
"@pypa_black//:black",
12801279
"@pypa_pybind11_stubgen//:pybind11_stubgen",
12811280
],
12821281
)
1283-
1284-
run_binary(
1285-
name = "genrule_type_stubs",
1286-
outs = PYI_FILES,
1287-
args = [
1288-
"$(execpath __init__.pyi)",
1289-
"$(execpath ocdbt.pyi)",
1290-
],
1291-
tool = ":generate_type_stubs",
1292-
)

0 commit comments

Comments
 (0)