Skip to content

Commit

Permalink
inherit $HOME environment variable for test (#105)
Browse files Browse the repository at this point in the history
This is a simple way of ensuring $HOME is available for uv to detect
`.netrc`.

Fixes #103
  • Loading branch information
chrisirhc authored Aug 12, 2024
1 parent 46b1877 commit 83c235d
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions uv/private/pip.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,17 @@ def _pip_compile_test_impl(ctx):
generator_label = ctx.attr.generator_label.label,
uv_args = ctx.attr.uv_args,
)
return DefaultInfo(
executable = executable,
runfiles = _runfiles(ctx),
)
return [
DefaultInfo(
executable = executable,
runfiles = _runfiles(ctx),
),
RunEnvironmentInfo(
# Ensures that .netrc can be detected by uv
# See https://github.com/theoremlp/rules_uv/issues/103
inherited_environment = ["HOME"],
),
]

_pip_compile_test = rule(
attrs = _COMMON_ATTRS | {
Expand Down

0 comments on commit 83c235d

Please sign in to comment.