Skip to content

Commit

Permalink
Add test size option (#180)
Browse files Browse the repository at this point in the history
Replace #173
  • Loading branch information
hofbi authored Dec 16, 2024
1 parent 7a775d5 commit b173a93
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions uv/pip.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def pip_compile(
args = None,
data = None,
tags = None,
size = None,
**kwargs):
"""
Produce targets to compile a requirements.in or pyproject.toml file into a requirements.txt file.
Expand All @@ -33,6 +34,7 @@ def pip_compile(
--no-strip-extras (Include extras in the output file)
data: (optional) a list of labels of additional files to include
tags: (optional) tags to apply to the generated test target
size: (optional) size of the test target, see https://bazel.build/reference/test-encyclopedia#role-test-runner
**kwargs: (optional) other fields passed through to all underlying rules
Targets produced by this macro are:
Expand All @@ -43,6 +45,7 @@ def pip_compile(
requirements_in = requirements_in or "//:requirements.in"
requirements_txt = requirements_txt or "//:requirements.txt"
tags = tags or []
size = size or "small"
if types.is_list(requirements_in):
write_target = "_{}.write".format(name)
write_file(
Expand Down Expand Up @@ -82,5 +85,6 @@ def pip_compile(
data = data,
uv_args = args,
tags = ["requires-network"] + tags,
size = size,
**kwargs
)

0 comments on commit b173a93

Please sign in to comment.