mirror of
https://github.com/astral-sh/uv
synced 2026-01-08 15:13:24 -05:00
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:
3
scripts/packages/fake-uv/README.md
Normal file
3
scripts/packages/fake-uv/README.md
Normal 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.
|
||||
11
scripts/packages/fake-uv/pyproject.toml
Normal file
11
scripts/packages/fake-uv/pyproject.toml
Normal 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"
|
||||
4
scripts/packages/fake-uv/scripts/uv
Executable file
4
scripts/packages/fake-uv/scripts/uv
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
echo "This is a fake uv binary"
|
||||
|
||||
1
scripts/packages/fake-uv/scripts/uv.exe
Normal file
1
scripts/packages/fake-uv/scripts/uv.exe
Normal file
@@ -0,0 +1 @@
|
||||
This is a fake uv binary
|
||||
1
scripts/packages/fake-uv/src
Symbolic link
1
scripts/packages/fake-uv/src
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../python/
|
||||
Reference in New Issue
Block a user