> ## Documentation Index
> Fetch the complete documentation index at: https://docs.root.io/llms.txt
> Use this file to discover all available pages before exploring further.

# uv

> Configure uv to use Root Library Catalog for secure Python packages.

## Authentication

```bash theme={null}
echo "machine pkg.root.io login token password YOUR_ROOT_TOKEN" >> ~/.netrc
chmod 600 ~/.netrc
```

## Configure the Registry

Add to `pyproject.toml`:

```toml theme={null}
[[tool.uv.index]]
name = "root"
url = "https://pkg.root.io/pypi/simple/"
```

## Install and Sync

```bash theme={null}
uv add requests==2.31.0
uv sync --upgrade
```

## CI/CD

```bash theme={null}
echo "machine pkg.root.io login token password $ROOT_TOKEN" >> ~/.netrc
chmod 600 ~/.netrc
```

uv reads `~/.netrc` automatically - no additional configuration needed in CI.

## Troubleshooting

| Issue              | Solution                                                      |
| ------------------ | ------------------------------------------------------------- |
| `401 Unauthorized` | Check `~/.netrc` token and `chmod 600`                        |
| Wrong index used   | Confirm `[[tool.uv.index]]` (double brackets) not `[tool.uv]` |
