dotfile collection/templates
Python is managed by uv.
Default behavior:
pythonandpython3should resolve from~/.local/bin.- The uv-managed global default is pinned in
~/.config/uv/.python-version. - Current default: Python 3.12.
Recreate on a new machine:
- Install uv if it is not already installed:
command -v uv >/dev/null || curl -LsSf https://astral.sh/uv/install.sh | sh- Make sure
~/.local/binis on PATH before system locations like/usr/bin:
export PATH="$HOME/.local/bin:$PATH"Keep that line in the relevant shell startup file, such as ~/.zshrc, if the machine does not already have it.
- Install and pin the default Python:
uv python install 3.12 --default
uv python pin --global 3.12
rehashuv python pin --global 3.12 recreates ~/.config/uv/.python-version, which is intentionally machine-local and does not need to live in this dotfiles repo.
Smoke-test:
which python
python --version
which python3
python3 --version
uv python list --only-installedDaily usage:
# Run normal scripts with the default Python
python script.py
# Run a one-off script/command with temporary dependencies
uv run --with requests -- python script.py
# Add dependencies to a reusable standalone script
uv add --script ~/.local/bin/my-script requests rich
# Install Python CLI tools globally, each in its own isolated uv env
uv tool install ruff
uv tool install ipythonAvoid installing packages into the uv-managed base Python. Prefer script metadata, uv run --with, or uv tool install.
1 - add the new thing to the appropriate bash profile
2 - merge into master
3 - pull down the newest changes from the dotfiles repo on your computer
4 - reload any open terminals to get the changes