Skip to content

Commit c1f2e75

Browse files
committed
hatch: Update the implementation to use --python switch
Switch from --directory to --python switch to simplify `uv pip install` command.
1 parent 376784d commit c1f2e75

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/hatch/cli/application.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def ensure_plugin_dependencies(self, dependencies: list[Requirement], *, wait_me
166166
uv_bin = find_uv_bin()
167167
pip_command = [uv_bin, 'pip']
168168

169-
pip_command.extend(['install', '--directory', str(pathlib.Path(sys.executable).parent.parent), '--disable-pip-version-check'])
169+
pip_command.extend(['install', '--disable-pip-version-check', '--python', sys.executable])
170170

171171
# Default to -1 verbosity
172172
add_verbosity_flag(pip_command, self.verbosity, adjustment=-1)

tests/helpers/helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ def assert_plugin_installation(subprocess_run, dependencies: list[str], *, verbo
5656
'pip',
5757
'install',
5858
'--disable-pip-version-check',
59-
'--directory',
60-
str(pathlib.Path(sys.executable).parent.parent),
59+
'--python',
60+
sys.executable,
6161
]
6262
add_verbosity_flag(command, verbosity, adjustment=-1)
6363
command.extend(dependencies)

0 commit comments

Comments
 (0)