Skip to content

Commit

Permalink
Use uv freeze over pip
Browse files Browse the repository at this point in the history
Signed-off-by: Bernát Gábor <[email protected]>
  • Loading branch information
gaborbernat committed Feb 16, 2024
1 parent 07b35a1 commit 38fe40d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/tox_uv/_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
Expand Down

0 comments on commit 38fe40d

Please sign in to comment.