# The Python stack we would set up today

> Source: https://learn-python.com/tools/
> Part of Learn Python, free to read.

Every recommendation here is something we would put on a real project. Where we have not used something in anger, we say so. Where the free tier is genuinely enough, we say that too — including when it means we earn nothing.

:::note Where the money comes from
Some links on this page are affiliate links, marked as such by your browser (`sponsored`). If you buy through one we get a commission; it costs you nothing extra and it is what keeps this site free and free of display ads. It does not buy a place on this page — several of the tools we recommend most strongly have no affiliate programme at all.
:::

## The non-negotiables

These four are free, open source, and we would not start a project without them.

### Package management: `uv`

Replaces `pip`, `pip-tools`, `pipenv`, `poetry`, `pyenv` and `virtualenv` with one binary that is fast enough to be invisible. The speed matters more than it sounds: an agent can run `uv sync` in a loop without you noticing, which means environment drift stops being a category of problem.

```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
uv init --python 3.12 && uv add --dev pytest ruff mypy
```

:::verdict
If you are still on `poetry`, migrating is an afternoon and it is worth it. If you are still on bare `pip` with a `requirements.txt`, it is an hour and it is definitely worth it.
:::

### Linting and formatting: `ruff`

One tool, replacing `flake8`, `isort`, `black`, `pyupgrade`, `bandit` and about thirty plugins, running roughly two orders of magnitude faster. In an agent workflow the speed is the feature: `ruff` can run on every single edit as a hook and still feel instant.

The default rule set is too small. See [the failure-mode catalogue](/review/failure-modes/) for the config we actually use.

### Type checking: `mypy` or `pyright`

Pick one and turn it on for new code. `mypy` is the reference implementation and integrates with everything; `pyright` (and `basedpyright`) is faster and stricter by default and is what powers Pylance in VS Code.

The honest recommendation: **`pyright` if you are starting fresh, `mypy` if you have an existing codebase** with a large `# type: ignore` population, because `mypy`'s per-module override system makes incremental adoption much less painful.

### Testing: `pytest` + `hypothesis`

`pytest` needs no defence. `hypothesis` is the one people skip and should not — property tests are the single most effective check against generated code that has been quietly shaped to satisfy your examples. There is a full worked example in [the verification loop](/ai/feedback-loops/).

Add `pytest-xdist` on day one. `-n auto` is usually a 3–4x speedup for zero effort.

## Editor and agent

This is the fastest-moving part of the stack and anything specific will age badly. The durable advice:

- **You want both a CLI agent and an editor-integrated one.** They are good at different things. The CLI is better for multi-file refactors, migrations and anything that needs to run commands in a loop. The editor integration is better for the ten-second change you would otherwise type yourself.
- **Whatever you pick, configure permissions before your first real session.** See [agent setup](/ai/agent-setup/).
- **A real debugger still beats reading generated code.** This is the strongest argument for a full IDE alongside your agent: when generated code is subtly wrong, stepping through it finds the problem in ninety seconds and reading it can take twenty minutes.

:::promo jetbrains
:::

VS Code plus Pylance is free and excellent, and for many people it is the right answer. The JetBrains case is the debugger, the refactoring engine and the database tooling — if you spend your day in a large Python codebase, it earns the licence.

## Hosting

For a small service or an API you built with an agent and want to put somewhere real:

:::promo digitalocean
:::

App Platform is the least-effort path from a Python repo to a URL with TLS: point it at the repo, it detects Python, and you are done. Roughly $5–12/month for something small.

If you would rather have a plain server and full control, Hetzner is materially cheaper for the same hardware and is the standard answer for self-hosted agent runners and background workers.

:::promo hetzner
:::

:::verdict Honest note
For a hobby project, both of these are beaten by free tiers on Fly.io, Railway or Cloudflare Workers (for the parts of your app that can run on Workers). We get nothing for saying that. Start free; move when the free tier stops fitting.
:::

## Learning, when you want more than a reference page

The tutorials on this site are deliberately short. When you want the long version:

:::promo boot-dev
:::

The strongest recommendation on this page for someone building back-end Python. It is project-based in a way that survives the agent era well — you cannot get through it by pasting, because the thing being taught is the reasoning.

:::promo datacamp
:::

The right shape for data work specifically: pandas, NumPy and SQL in a browser sandbox, no local setup. If you came here from [the pandas lesson](/pandas-basics/), this is the sensible next step.

:::promo educative
:::

Text-first and skimmable, which matters when you already know how to program and need one specific gap filled quickly rather than eight hours of video.

## What we would skip

Being useful means saying this part too.

- **Coding bootcamps.** The market contracted hard between 2023 and 2026, several large providers failed, and the entry-level hiring picture they were built for has changed substantially. If you are considering one, get current outcome data for the specific cohort you would join, in writing, before paying anything. We do not run bootcamp ads on this site.
- **"Learn to prompt" courses.** The half-life is a few months and the durable content is a blog post.
- **Paid AI code-review SaaS, for a small team.** For most repositories, `ruff` with a strong rule set plus a type checker plus one thoughtful human reviewer catches more than the tools do, at zero cost. Revisit at fifty engineers.
- **A second linter.** `ruff` covers what `flake8`, `isort`, `bandit` and `pyupgrade` did. Running both is a slower build and two sources of truth.

## The whole thing, as a file

```toml pyproject.toml
[project]
name = "yourapp"
requires-python = ">=3.12"

[dependency-groups]
dev = ["pytest", "pytest-xdist", "pytest-cov", "hypothesis", "ruff", "mypy"]

[tool.ruff.lint]
select = ["E","F","B","S","DTZ","ASYNC","BLE","A","PL","SIM","UP","I","RUF"]
ignore = ["E501"]
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["S101"]

[tool.mypy]
python_version = "3.12"
strict = true
warn_unused_ignores = true
files = ["src", "tests"]

[tool.pytest.ini_options]
addopts = "-q --strict-markers -m 'not integration and not slow'"
markers = ["integration: needs external services", "slow: over one second"]
```

```bash
uv sync && uv run ruff check . && uv run mypy src && uv run pytest -q -n auto
```

That is the whole stack. Everything else is preference.

## Common questions

### Is uv production-ready?

Yes — it is widely used in production and in CI across the ecosystem, and it reads and writes standard `pyproject.toml` and lockfile formats, so the migration path away from it is short if you ever want one. That reversibility is the main reason we recommend it without hedging.

### mypy or pyright?

`pyright` if you are starting fresh or already live in VS Code; `mypy` if you have an existing codebase with a lot of type debt, because its per-module override system makes gradual adoption much less painful. Running both is not worth the friction.

### Do you take payment for placement on this page?

No. Some links are affiliate links, which means we earn a commission if you buy — but the ordering and the recommendations are not for sale, and several tools listed here (uv, ruff, pytest, hypothesis) have no affiliate programme at all. When we would tell you to use the free option, we say so.

### Why no display ads?

Because they make a technical reference worse and they pay badly at this size. If this site ever runs ads, they will be a single unobtrusive slot, and this sentence will change.
