Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test size option #173

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions uv/pip.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,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 Down Expand Up @@ -41,6 +42,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"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd like to keep this defaulted to None if unspecified, but otherwise this seems fine.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From https://bazel.build/reference/be/common-definitions you can see the default test size to be medium which has the the spects medium 100 MB RAM 1 CPU timeout moderate (5 minutes) vs. small 20 MB RAM 1 CPU timeout short (1 minute). To me, small seems a reasonable timeout

if types.is_list(requirements_in):
write_target = "_{}.write".format(name)
write_file(
Expand Down Expand Up @@ -78,5 +80,6 @@ def pip_compile(
data = data,
uv_args = args,
tags = ["requires-network"] + tags,
size = size,
**kwargs
)
Loading