forked from bazel-contrib/rules_python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBUILD.bazel
More file actions
76 lines (64 loc) · 1.71 KB
/
BUILD.bazel
File metadata and controls
76 lines (64 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
"""Performance test for py_wheel analysis-time scaling.
Verifies that py_wheel analysis time scales linearly with dep count,
not quadratically (as it would if inputs_to_package.to_list() were
called during analysis).
"""
load("@rules_shell//shell:sh_test.bzl", "sh_test")
load("//python:packaging.bzl", "py_wheel")
load("//python:py_test.bzl", "py_test")
load(":gen_py_libs.bzl", "gen_py_libs")
package(default_visibility = ["//visibility:private"])
# Two py_wheel targets at different sizes to measure scaling behavior.
# If analysis is linear, 10k should take ~2x as long as 5k.
# If analysis is quadratic (the old to_list() bug), 10k takes ~4x as long.
SMALL_DEPS = gen_py_libs(
name = "small",
count = 5000,
)
LARGE_DEPS = gen_py_libs(
name = "large",
count = 10000,
)
py_wheel(
name = "small_wheel",
distribution = "small_wheel",
python_tag = "py3",
version = "0.0.1",
deps = SMALL_DEPS,
)
py_wheel(
name = "large_wheel",
distribution = "large_wheel",
python_tag = "py3",
version = "0.0.1",
deps = LARGE_DEPS,
)
# Smaller wheel (100 deps) for correctness verification.
VERIFY_DEPS = gen_py_libs(
name = "verify",
count = 100,
)
py_wheel(
name = "verify_wheel",
distribution = "verify_wheel",
python_tag = "py3",
version = "0.0.1",
deps = VERIFY_DEPS,
)
py_test(
name = "py_wheel_contents_test",
srcs = ["py_wheel_contents_test.py"],
data = [":verify_wheel"],
deps = ["//python/runfiles"],
)
sh_test(
name = "py_wheel_analysis_scaling_test",
srcs = ["py_wheel_analysis_scaling_test.sh"],
tags = [
"exclusive",
"integration-test",
"manual",
"no-remote-exec",
"no-sandbox",
],
)