summaryrefslogtreecommitdiffhomepage
path: root/benchmarks/defs.bzl
diff options
context:
space:
mode:
Diffstat (limited to 'benchmarks/defs.bzl')
-rw-r--r--benchmarks/defs.bzl18
1 files changed, 18 insertions, 0 deletions
diff --git a/benchmarks/defs.bzl b/benchmarks/defs.bzl
new file mode 100644
index 000000000..79e6cdbc8
--- /dev/null
+++ b/benchmarks/defs.bzl
@@ -0,0 +1,18 @@
+"""Provides python helper functions."""
+
+load("@pydeps//:requirements.bzl", _requirement = "requirement")
+
+def filter_deps(deps = None):
+ if deps == None:
+ deps = []
+ return [dep for dep in deps if dep]
+
+def py_library(deps = None, **kwargs):
+ return native.py_library(deps = filter_deps(deps), **kwargs)
+
+def py_test(deps = None, **kwargs):
+ return native.py_test(deps = filter_deps(deps), **kwargs)
+
+def requirement(name, direct = True):
+ """ requirement returns the required dependency. """
+ return _requirement(name)