Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/tox_uv/_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def uv_resolution_post_process(value: str) -> str:

def default_install_command(self, conf: Config, env_name: str | None) -> Command: # noqa: ARG002
cmd = [self.uv, "pip", "install", "{opts}", "{packages}"]
if self._env.options.verbosity > 2: # noqa: PLR2004
if self._env.options.verbosity > 3: # noqa: PLR2004
cmd.append("-v")
return Command(cmd)

Expand Down
2 changes: 1 addition & 1 deletion src/tox_uv/_run_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def _setup_env(self) -> None:
install_pkg = getattr(self.options, "install_pkg", None)
if install_pkg is not None:
cmd.append("--no-install-project")
if self.options.verbosity > 2: # noqa: PLR2004
if self.options.verbosity > 3: # noqa: PLR2004
cmd.append("-v")
outcome = self.execute(cmd, stdin=StdinSource.OFF, run_id="uv-sync", show=self.options.verbosity > 1)
outcome.assert_success()
Expand Down
2 changes: 1 addition & 1 deletion src/tox_uv/_venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def create_python_env(self) -> None:
version_spec = f"{uv_imp or ''}{base.major}.{base.minor}" if base.minor else f"{uv_imp or ''}{base.major}"

cmd: list[str] = [self.uv, "venv", "-p", version_spec, "--allow-existing"]
if self.options.verbosity > 2: # noqa: PLR2004
if self.options.verbosity > 3: # noqa: PLR2004
cmd.append("-v")
if self.conf["uv_seed"]:
cmd.append("--seed")
Expand Down
8 changes: 4 additions & 4 deletions tests/test_tox_uv_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def test_uv_lock_list_dependencies_command(tox_project: ToxProjectCreator) -> No
assert calls == expected


@pytest.mark.parametrize("verbose", [True, False])
def test_uv_lock_command(tox_project: ToxProjectCreator, verbose: bool) -> None:
@pytest.mark.parametrize("verbose", ["", "-v", "-vv", "-vvv"])
def test_uv_lock_command(tox_project: ToxProjectCreator, verbose: str) -> None:
project = tox_project({
"tox.ini": """
[testenv]
Expand All @@ -53,12 +53,12 @@ def test_uv_lock_command(tox_project: ToxProjectCreator, verbose: bool) -> None:
"""
})
execute_calls = project.patch_execute(lambda r: 0 if r.run_id != "venv" else None)
result = project.run(*["-vv"] if verbose else [])
result = project.run(*[verbose] if verbose else [])
result.assert_success()

calls = [(i[0][0].conf.name, i[0][3].run_id, i[0][3].cmd) for i in execute_calls.call_args_list]
uv = find_uv_bin()
v_args = ["-v"] if verbose else []
v_args = ["-v"] if verbose not in {"", "-v"} else []
expected = [
(
"py",
Expand Down