Skip to content

Commit

Permalink
fix(bazel): add marker to args
Browse files Browse the repository at this point in the history
Signed-off-by: Cameron Smith <cameron.ray.smith@gmail.com>
  • Loading branch information
cameronraysmith committed Aug 3, 2024
1 parent fc979c3 commit 63e0c5b
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions bazel/python.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ bazel macros for python

# load("@aspect_rules_py//py:defs.bzl", "py_pytest_main", "py_test")
load("@bazel_skylib//lib:paths.bzl", "paths")

# load("@pip//:requirements.bzl", "requirement")
load("@rules_python//python:defs.bzl", "py_test")



def py_test_module_list(files, size, deps, args=[], extra_srcs=[], name_suffix="", **kwargs):
def py_test_module_list(files, size, deps, args = [], extra_srcs = [], name_suffix = "", **kwargs):
"""
py_test_module_list creates a py_test for each file in files.
py_test_module_list creates a py_test for each file in files.
"""
for file in files:
name = paths.split_extension(file)[0] + name_suffix
if name == file:
name = name + "_test"

# native.py_test(
py_test(
name = name,
Expand All @@ -26,17 +26,18 @@ def py_test_module_list(files, size, deps, args=[], extra_srcs=[], name_suffix="
args = [
"-rA",
"-v",
"-m 'not pyensembl'",
"--disable-warnings",
] + args,
deps = deps,
**kwargs
)

def xdoctest(files, name="xdoctest", deps=[], srcs=[], data=[], args=[], size="medium", tags=[], **kwargs):
def xdoctest(files, name = "xdoctest", deps = [], srcs = [], data = [], args = [], size = "medium", tags = [], **kwargs):
"""
run xdoctests on library files
"""
files = native.glob(include=files, exclude=["__init__.py"])
files = native.glob(include = files, exclude = ["__init__.py"])

# native.py_test(
py_test(
Expand All @@ -59,10 +60,10 @@ def xdoctest(files, name="xdoctest", deps=[], srcs=[], data=[], args=[], size="m
**kwargs
)

# for use with aspect_rules_py
# for use with aspect_rules_py
# def py_test_module_list(files, size, deps, extra_srcs=[], name_suffix="", **kwargs):
# """
# py_test_module_list creates a py_test for each file in files.
# py_test_module_list creates a py_test for each file in files.
# """
# py_pytest_main(
# name = "__test__",
Expand Down

0 comments on commit 63e0c5b

Please sign in to comment.