11
22# Project: uv python shims
33
4+ -> [ What is this?] ( #what-is-this )
5+ -> [ How does this work?] ( #how-does-this-work )
6+ -> [ How to install this?] ( #how-to-install-this )
7+ -> [ How to run tests] ( #how-to-run-tests )
8+ -> [ Why did I make this?] ( #why-did-i-make-this )
9+ -> [ Does this work with ...?] ( #does-this-work-with-uv-hatch-poetry-pyenv-pixi-and-pipx )
10+ -> [ Notes and caveats] ( #notes-and-caveats )
11+
12+ ## What is this?
13+
414A small, pyenv-like shim layer for ` python ` that delegates interpreter
515resolution to ` uv ` .
616
17+ A "shim" in this context is a small script that intercepts the invocation of
18+ a python interpreter and then dispatches to some auto-discovered python path.
719The goal is to let you type ` python ` , ` python3.11 ` , etc. and have it resolve
8- to a uv-managed python consistent with your project’s ` .python-version `
9- (and/or uv’s project discovery), without needing pyenv.
20+ to the correct python path by using uv's python discovery rules. The result is
21+ very similar to the result from shims installed by ` pyenv ` but with greater
22+ visibility into more installed pythons (like the pythons installed by uv itself).
1023
1124This project provides:
1225
@@ -26,7 +39,7 @@ References:
2639 https://docs.astral.sh/uv/concepts/python-versions/#finding-a-python-executable
2740
2841
29- ## The main shim ( ` ./python ` )
42+ ## How does this work?
3043
3144** Requires:** ` bash ` and ` uv ` installed and on your ` PATH `
3245
@@ -46,7 +59,7 @@ working directory:
4659 3 . The first suitable python found on the ` PATH ` .
4760
4861- If a suitable python is found, that python is executed via its absolute path.
49- If a suitable python can NOT be found, the script will exit and display the
62+ If a suitable python is NOT found, the script will exit and display the
5063 error message given by uv.
5164
5265If the shim is invoked via a symlink with a versioned name like ` python3.10 `
@@ -62,7 +75,7 @@ of `uv python find`. See the commented-out section near the top of the shim scri
6275and uncomment the flags desired to control python discovery.
6376
6477
65- ## Install main shim and symlinks
78+ ## How to install this?
6679
6780** Requires:** ` bash ` (macOS default bash 3.2 is fine)
6881
@@ -149,7 +162,7 @@ UV_PYTHON_SHIMS_FORCE=1 bash ./install.bash
149162```
150163
151164
152- ## Running tests
165+ ## How to run tests?
153166
154167The tests are written in bash and do ** not** require a real ` uv ` install.
155168
@@ -286,6 +299,7 @@ Many tools will "just work" as long as they select the python found from the cur
286299 note above. If you need more than just a python shim, you probably would do better
287300 with a different solution.
288301
302+
289303## License
290304
291305Licensed under the MIT License; see ` LICENSE ` .
0 commit comments