diff --git a/src/tox_uv/_installer.py b/src/tox_uv/_installer.py index 315b5e0..5fa463a 100644 --- a/src/tox_uv/_installer.py +++ b/src/tox_uv/_installer.py @@ -6,9 +6,10 @@ import sys from collections import defaultdict from pathlib import Path -from typing import TYPE_CHECKING, Any, Sequence +from typing import TYPE_CHECKING, Any, Sequence, cast from packaging.requirements import Requirement +from tox.config.of_type import ConfigDynamicDefinition from tox.config.types import Command from tox.execute.request import StdinSource from tox.tox_env.errors import Recreate @@ -24,6 +25,12 @@ class UvInstaller(Pip): """Pip is a python installer that can install packages as defined by PEP-508 and PEP-517.""" + def _register_config(self) -> None: + super()._register_config() + if self._with_list_deps: # pragma: no branch + conf = cast(ConfigDynamicDefinition[Command], self._env.conf._defined["list_dependencies_command"]) # noqa: SLF001 + conf.default = Command([self.uv, "pip", "freeze"]) + @property def uv(self) -> str: return str(Path(sys.executable).parent / "uv")