summaryrefslogtreecommitdiffhomepage
path: root/benchmarks/defs.bzl
blob: 79e6cdbc82ed1cef437fcb891c5d883113a13e86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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)