Skip to content

Commit

Permalink
uv: support double verbosity flag
Browse files Browse the repository at this point in the history
  • Loading branch information
layday committed Mar 16, 2024
1 parent 5662669 commit 5076a56
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ typing = [
"typing-extensions >= 3.7.4.3",
]
uv = [
"uv >= 0.1.15",
"uv >= 0.1.18",
]
virtualenv = [
"virtualenv >= 20.0.35",
Expand Down
3 changes: 1 addition & 2 deletions src/build/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,7 @@ def create(self, path: str) -> None:
def install_requirements(self, requirements: Collection[str]) -> None:
cmd = [self._uv_bin, 'pip']
if _ctx.verbosity > 1:
# uv doesn't support doubling up -v unlike pip.
cmd += ['-v']
cmd += [f'-{"v" * min(2, _ctx.verbosity - 1)}']
run_subprocess([*cmd, 'install', *requirements], env={**os.environ, 'VIRTUAL_ENV': self._env_path})

@property
Expand Down
2 changes: 1 addition & 1 deletion tests/test_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def test_uv_impl_install_cmd_well_formed(
assert len(install_call.args) == 1
assert install_call.args[0][1:] == [
'pip',
*(['-v'] if verbosity > 1 else []),
*(['-vv' if verbosity > 2 else '-v'] if verbosity > 1 else []),
'install',
'some',
'requirements',
Expand Down

0 comments on commit 5076a56

Please sign in to comment.