# Migrate a Slack Bolt for Python App From pip to uv

Yes. An agent locks a Bolt for Python app with uv, moves the dev extras to a dependency group, switches CI and the README to uv sync and uv run, and opens a PR.

[Run this on Rush](https://cloud.getrush.ai/run/migrate-to-uv/slack-bolt/). Opens the console with this prompt ready to send, in a Project that has your repository.

## What the agent does

The agent reads how the app is installed and tested before it changes a line, because a Bolt app's install path is spread over four files. In an app laid out like slack-samples/bolt-python-starter-template, `pyproject.toml` already has a PEP 621 `[project]` table: the name `bolt-python-starter-template`, version `0.0.0`, `requires-python = ">=3.11"`, one dependency `slack-bolt==1.30.0`, and a `dev` extra under `[project.optional-dependencies]` with `pytest==9.2.0` and `ruff==0.17.3`. There is no `[build-system]` table, only `[tool.setuptools.packages.find]` with `include = ["listeners*"]`, so `pip install -e ".[dev]"` builds the package through setuptools' legacy fallback. `[tool.ruff]` sets `line-length = 125`, and `[tool.pytest.ini_options]` sets `testpaths = ["tests"]` and a `logs/pytest.log` file. `.github/workflows/ci.yml` has a `lint` job on Python 3.15 and a `test` job with a matrix of 3.11 through 3.15, both running `pip install -U pip` then `pip install -e ".[dev]"`, then `ruff check .`, `ruff format --check .` and `pytest . -v`. `.github/dependabot.yml` watches the `pip` ecosystem monthly. `README.md` tells a developer to `python3 -m venv .venv`, activate it and `pip install -e ".[dev]"`, and `AGENTS.md` tells a coding agent to run `ruff check .`, `ruff format --check .` and `pytest` before finishing. `.gitignore` ignores `.python-version` and a bare `pip` line.

Then it decides what uv needs that pip did not. The two dev tools move from the `dev` extra to `[dependency-groups]`, since they are for contributors and should not be installable as an extra of the app; `uv sync` installs a `dev` group by default, so `uv sync --locked` is the whole install step. The exact pins stay exact: `slack-bolt==1.30.0`, `pytest==9.2.0` and `ruff==0.17.3` go into the lock unchanged, so the migration moves no version. The build question matters more here than in most apps: with no `[build-system]`, uv treats the directory as a project that is not itself a package and installs only its dependencies, which is enough because `app.py` and `tests/` import `listeners` from the repository root. The agent keeps it that way, deletes the `[tool.setuptools.packages.find]` table that nothing reads any more, and says in the pull request that `[build-system]` with `uv_build` is the one line to add if the listeners are ever published as a package. It also writes `.python-version` as `3.11`, the floor in `requires-python`, and removes that file's line from `.gitignore` so contributors share it.

The CI change is where a careless migration breaks. The agent replaces `actions/setup-python` with `astral-sh/setup-uv` pinned to a commit with its version in a comment, `enable-cache: true` and the uv version written in `version`, then `uv python install ${{ matrix.python-version }}` so the matrix of 3.11 through 3.15 still runs every interpreter rather than the one in `.python-version`, `uv sync --locked` so a stale `uv.lock` fails the build instead of resolving silently, and `uv run ruff check .`, `uv run ruff format --check .` and `uv run pytest . -v`. The `lint` job keeps 3.15 the same way. `dependabot.yml` switches its `pip` entry to the `uv` ecosystem, which reads `uv.lock`, and keeps the monthly schedule and the two labels; the `dependencies.yml` auto-merge workflow needs no change because it reads `dependabot/fetch-metadata`, not the package manager. The README's setup section becomes `uv sync`, with `uv run python3 app.py` beside `slack run` for starting the app, and `AGENTS.md` gets the same three commands with `uv run` in front, so agents and people run the identical check.

Then the agent proves the result in its own sandbox. `uv lock` writes `uv.lock`, and `uv export --no-hashes` is compared against `pip freeze` from a fresh pip install of the old extras, so the pull request can say the same packages at the same versions came out of both. `uv sync --locked` builds the environment, `uv run ruff check .` and `uv run ruff format --check .` pass or report what they found in the files the agent touched, `uv run pytest . -v` runs the thirteen listener tests under `tests/`, and `uv run python -c "import slack_bolt; print(slack_bolt.__version__)"` prints `1.30.0`. It does not start the app, because `app.py` opens a Socket Mode connection with `SLACK_APP_TOKEN` and `SLACK_BOT_TOKEN` that the sandbox does not have; the pull request says so and that `uv run python3 app.py` is the command a developer runs with those exported. The workflow file is checked with `actionlint` before it is committed.

## Start it with one API call

`POST https://api.phoenix.so/o/{org}/sessions`

```json
{
  "agent": "claude",
  "input": "Migrate this Bolt for Python app from pip to uv. Read pyproject.toml, .github/workflows/ci.yml, .github/dependabot.yml, README.md, AGENTS.md and .gitignore first. Keep every pinned version exactly as it is. Move the dev extra to a dependency-groups table, decide whether the project needs a build-system table from how app.py and the tests import the listeners package and say why, write a .python-version at the requires-python floor and stop ignoring it, and run uv lock. In the CI workflow replace setup-python with astral-sh/setup-uv pinned to a commit with caching on, install each matrix interpreter with uv python install, use uv sync --locked, and run ruff and pytest through uv run; keep the lint job and the version matrix as they are. Switch the Dependabot pip entry to the uv ecosystem. Update the README setup and the AGENTS.md check commands to uv. Then run uv sync --locked, both ruff commands and pytest, compare uv export with a pip freeze of the old install, lint the workflow with actionlint, and open a pull request that quotes each command's output and says that no version changed.",
  "resources": [
    {
      "url": "https://github.com/your-org/your-app"
    }
  ]
}
```

1. **Get an API key.** In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
2. **Send the request.** POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
3. **Read what came back.** Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

## What comes back

What comes back is a pull request that edits `pyproject.toml`, adds `uv.lock` and `.python-version`, changes `.gitignore`, `.github/workflows/ci.yml`, `.github/dependabot.yml`, `README.md` and `AGENTS.md`, and touches nothing under `listeners/` or `tests/`. The description shows the old extras table beside the new dependency group, the `uv export` and `pip freeze` lists side by side with no difference, and the output of `uv sync --locked`, both `ruff` commands and `pytest`, so a reviewer sees the environment and the suite before opening a file.

The repository's own `CI` workflow runs on the pull request, now through uv, and its `lint` and `test` jobs are the checks a reviewer reads. The Dependabot auto-merge workflow is unchanged, so the next monthly update arrives as a change to `uv.lock` and merges the way `pip` updates did.

Before merging, a reviewer decides two things the agent flags rather than settles: whether to add a `[build-system]` table now so the app is also installable as a package, and whether the lock should be refreshed with `uv lock --upgrade` in a separate pull request now that upgrades are one command. The pins the team chose are still the pins.

## Run it on every Python repository still on pip

A team that keeps several Slack apps on this template starts one run per repository from its own server: a `POST /o/{org}/sessions` each, with this prompt as `input`, the repository in `resources` and a `request_id` that is a UUID v5 of the repository's full name, so a retried call returns the run already started. Each run reads its own `pyproject.toml`, so an app whose template still has `requirements.txt` and `requirements-dev.txt` gets them translated into `dependencies` and a group, and an app that already has a `[build-system]` keeps it.

`GET /o/{org}/github` lists the repositories the Rush GitHub App installation reaches, and the key's `webhook_url` receives `run.completed` for each run, with the `session_url` to read the pull request link from, so the script that started ten migrations can post the ten links in one message when the last run ends.

## Why run it on Rush?

A pip-to-uv migration is small enough to do by hand and easy to get subtly wrong: a dev extra left in place so `uv sync` installs nothing to test with, a CI matrix that silently collapses to one interpreter because `.python-version` won the argument, or a `uv sync` without `--locked` that resolves fresh on every run and hides a stale lock. The agent runs the new install, the linter and the suite in its own sandbox, compares the two package lists before it deletes anything, and checks the workflow with `actionlint`, so the pull request arrives with the evidence rather than the promise.

Every command stays with the run, from `uv lock` to the last `pytest` line, and the pull request quotes them. The same migration across every Bolt app a team owns costs no more attention than one, because each run has its own machine, its own record and its own pull request, and none of them needs a Slack token to prove the install.

## Frequently asked questions

### Will any dependency version change?

No. The three pins in `pyproject.toml` are exact and go into `uv.lock` as they are, and the pull request shows `uv export` beside a `pip freeze` of the old install so you can see the same packages at the same versions. Upgrading is a separate `uv lock --upgrade`, which the description names as a follow-up.

### Why a dependency group instead of keeping the dev extra?

An extra is part of the published package and can be installed by anyone who installs the app, while a dependency group is for people working in the repository. `pytest` and `ruff` belong to the second kind, and `uv sync` installs the `dev` group by default, so the install step gets shorter rather than longer. The template's `pip install -e ".[dev]"` line is replaced everywhere it appears.

### Does the CI matrix still test every Python version?

Yes. The workflow installs each matrix interpreter with `uv python install` and the version from the matrix, so 3.11 through 3.15 each get their own job as before. `.python-version` only picks the interpreter for a developer who runs `uv sync` locally.

### What about the slack run command and the Slack CLI?

Untouched. The Slack CLI starts `app.py` through its own manifest and reads the tokens from the environment, and the pull request adds `uv run python3 app.py` beside it rather than replacing it. The agent does not start the app in its sandbox because it has no Slack tokens, and says so.

### Does Dependabot keep updating the dependencies?

Yes. The `pip` entry in `.github/dependabot.yml` becomes a `uv` entry on the same monthly schedule with the same labels, so updates arrive as changes to `uv.lock`, and the existing auto-merge workflow approves patch and minor updates the way it did before.

## More Slack Bolt jobs

- [Write Unit Tests for a Slack Bolt App](https://getrush.ai/run/write-unit-tests/slack-bolt/)
- [Add an App Home Tab to a Bolt for JavaScript Slack App](https://getrush.ai/run/add-app-home-tab/slack-bolt/)
- [Add Test Coverage to CI for a Slack Bolt App](https://getrush.ai/run/add-coverage-to-ci/slack-bolt/)

## The same job on other stacks

- [Migrate a Textual App From Poetry to uv](https://getrush.ai/run/migrate-to-uv/textual/)
- [Migrate a Django REST Framework Project to uv](https://getrush.ai/run/migrate-to-uv/django-rest-framework/)
- [Migrate a Flask Project to uv](https://getrush.ai/run/migrate-to-uv/flask/)

## Keep reading

- [How a Rush run works on your repository, from request to pull request](https://getrush.ai/cloud/)
- [Compare cloud agents, agent sandboxes and AI code review](https://getrush.ai/compare/)
- [Rush pricing: Free, Pro and Max](https://getrush.ai/pricing/)
