Skip to content

Commit

Permalink
hatch: Update to use find_uv_bin()
Browse files Browse the repository at this point in the history
  • Loading branch information
vpetrigo committed Jan 11, 2025
1 parent 306dd82 commit a565a5f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/hatch/cli/application.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
from __future__ import annotations

import os
import pathlib
import sys
from functools import cached_property
from typing import TYPE_CHECKING, cast

from uv import find_uv_bin

from hatch.cli.terminal import Terminal
from hatch.config.user import ConfigFile, RootConfig
from hatch.project.core import Project
from hatch.utils.fs import Path
from hatch.utils.platform import Platform
from hatch.utils.runner import ExecutionContext

from uv import find_uv_bin

if TYPE_CHECKING:
from collections.abc import Generator

Expand Down Expand Up @@ -165,7 +166,7 @@ def ensure_plugin_dependencies(self, dependencies: list[Requirement], *, wait_me
uv_bin = find_uv_bin()
pip_command = [uv_bin, 'pip']

pip_command.extend(['install'])
pip_command.extend(['install', '--directory', str(pathlib.Path(sys.executable).parent.parent)])

# Default to -1 verbosity
add_verbosity_flag(pip_command, self.verbosity, adjustment=-1)
Expand Down
9 changes: 8 additions & 1 deletion tests/helpers/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import importlib
import json
import os
import pathlib
import re
import sys
from datetime import datetime, timezone
Expand Down Expand Up @@ -50,7 +51,13 @@ def get_current_timestamp():

def assert_plugin_installation(subprocess_run, dependencies: list[str], *, verbosity=0, count=1):
uv_bin = find_uv_bin()
command = [uv_bin, 'pip', 'install']
command = [
uv_bin,
'pip',
'install',
'--directory',
str(pathlib.Path(sys.executable).parent.parent),
]
add_verbosity_flag(command, verbosity, adjustment=-1)
command.extend(dependencies)

Expand Down

0 comments on commit a565a5f

Please sign in to comment.