# pip / uv

import { Aside, Tabs, TabItem } from '@astrojs/starlight/components';

Avrea caches packages from PyPI so that `pip install` and `uv pip install`
resolve from the colocated cache on repeat runs.

## On Avrea runners

The index URL is pre-configured:

```bash
PIP_INDEX_URL="https://cache.avrea.com:8443/pypi/simple/"
```

Your workflow needs no changes:

```yaml title="workflow.yml"
jobs:
  test:
    runs-on: avrea-ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-python@v7
        with:
          python-version: '3.14'
      - run: pip install -r requirements.txt
      - run: pytest
```

## Manual setup

<Tabs>
  <TabItem label="pip">
```bash
export PIP_INDEX_URL="https://cache.avrea.com:8443/pypi/simple/"
```
  </TabItem>
  <TabItem label="uv">
```bash
export UV_INDEX_URL="https://cache.avrea.com:8443/pypi/simple/"
```

<Aside type="caution" title="uv caching is optional">
uv is already fast, so registry caching is rarely worth the setup - most projects
can skip it. Unlike pip, the uv index URL is **not pre-configured** on Avrea
runners; you must export `UV_INDEX_URL` yourself.

It also **only takes effect when not resolving from a lock file**. `uv.lock`
(used by `uv sync` and `uv pip sync`) pins the original index URLs, so
`UV_INDEX_URL` is ignored for lock-based installs.
</Aside>
  </TabItem>
</Tabs>