Skip to content

Commit 26cddfd

Browse files
Docs: Update Upgrading Python section to use uv instead of pyenv
Co-Authored-By: Amp <amp@ampcode.com>
1 parent f5ac383 commit 26cddfd

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

docs/versions/index.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -228,21 +228,22 @@ Python 3.13 → Python 3.14 Better GC pauses, new heapq functions
228228

229229
```bash
230230
# Test with newer version
231-
pyenv install 3.12.0
232-
pyenv shell 3.12.0
233-
python -m pytest # Run tests
231+
uv python install 3.12
232+
uv run --python 3.12 pytest # Run tests
234233

235234
# Check for deprecations
236-
python -W all your_script.py
235+
uv run --python 3.12 python -W all your_script.py
237236
```
238237

239238
### Gradual Adoption
240239

241240
```bash
242-
# Keep older version
243-
pyenv install 3.11.0
244-
pyenv local 3.11.0 # Use 3.11 for this project
245-
pyenv global 3.12.0 # Use 3.12 everywhere else
241+
# Pin version for this project
242+
echo "3.11" > .python-version
243+
uv sync # Installs Python 3.11 and dependencies
244+
245+
# Use different version for one-off commands
246+
uv run --python 3.12 python script.py
246247
```
247248

248249
## Related Documentation

0 commit comments

Comments
 (0)