Add test cases for find_uv_bin (#15110)

Adds test cases to unblock

- https://github.com/astral-sh/uv/pull/14181
- https://github.com/astral-sh/uv/pull/14182
- https://github.com/astral-sh/uv/pull/14184
- https://github.com/astral-sh/uv/pull/14184
- https://github.com/tox-dev/pre-commit-uv/issues/70

We use a package with a symlink to the Python module to get a mock
installation of uv without building (or packaging) the uv binary. This
lets us test real patterns like `uv pip install --prefix` without
encoding logic about where things are placed during those installs.

---------

Co-authored-by: konstin <konstin@mailbox.org>
This commit is contained in:
Zanie Blue
2025-08-07 07:14:01 -05:00
committed by GitHub
parent aec90f0a3c
commit 278295ef02
9 changed files with 442 additions and 75 deletions

View File

@@ -0,0 +1,3 @@
This fake uv package symlinks the Python module of uv in-tree and has a fake `uv` binary, allowing
testing of the Python module behaviors. Consumers can replace the `uv` binary with a debug binary or
similar if they need it to actually work.

View File

@@ -0,0 +1,11 @@
[project]
name = "uv"
version = "0.1.0"
requires-python = ">=3.8"
[tool.uv.build-backend.data]
scripts = "scripts"
[build-system]
requires = ["uv_build>=0.8.0,<0.9"]
build-backend = "uv_build"

View File

@@ -0,0 +1,4 @@
#!/usr/bin/env sh
echo "This is a fake uv binary"

View File

@@ -0,0 +1 @@
This is a fake uv binary

View File

@@ -0,0 +1 @@
../../../python/