# Hatch vs PDM: Python プロジェクトマネージャー比較

> Hatch vs PDM を環境、lockfile、build backend、PEP 標準で比較。どの Python プロジェクトマネージャーがあなたのワークフローと CI に合うか。

Source: https://latchkey.dev/ja/learn/tool-comparisons/hatch-vs-pdm  
Updated: 2026-06-30

高速な resolver、組み込みの lockfile、PEP 582 スタイルのローカルインストールが欲しいなら PDM を、標準化された build backend、環境マトリクス、プロジェクトのスクリプティングを 1 つのツールで欲しいなら Hatch を選びましょう。

Hatch (PyPA 製) と PDM は、どちらも古い setup.py + virtualenv + pip のフローを置き換える、モダンで標準ベースの Python プロジェクトマネージャーです。両者は多くの点で重なりますが、強調する点が異なります。Hatch は再現可能な環境とその hatchling build backend を中心にしており、PDM は高速な依存関係 resolver とコミットされた lockfile (pdm.lock) を中心にしています。どちらも pyproject.toml を読み取ります。

## Comparison

|  | Hatch | PDM |
| --- | --- | --- |
| 設定 | pyproject.toml ([tool.hatch]) | pyproject.toml ([tool.pdm]) |
| Lockfile | 組み込みの lock なし (hatch-pip-compile または外部を使用) | pdm.lock を組み込み |
| Build backend | hatchling (人気のスタンドアロン backend) | pdm-backend |
| 環境 | 名前付き環境とテストマトリクス | 単一のプロジェクト venv (プロジェクト内 .venv) |
| スクリプト/タスク | hatch run + scripts | pdm run + scripts |
| 標準 | PEP 517/518/621 | PEP 517/518/621、PEP 582 の履歴 |

## それぞれが本当に勝る場面

PDM は、追加のツールを付け足さずに、コミットされたクロスプラットフォームの lockfile と高速な resolver が欲しいときに勝ちます。その `pdm.lock` と `pdm install` のフローは、そのままで再現可能です。Hatch は、パッケージを公開し、クリーンで広く採用された build backend (`hatchling`) に加えて、1 つの CLI で管理されるテスト環境のマトリクスが欲しいときに勝ちます。日々のワークフローが pip や uv であっても、多くのプロジェクトが `hatchling` を build backend として使っています。

## CI において

PDM は CI で便利です。`pdm install` が `pdm.lock` から正確でロックされた環境を復元するからです。Hatch では、lock の再現性は通常 `pyproject.toml` でのピン留め、または `pip-tools`/`uv` との組み合わせから得られます。CI におけるその強みは、同じ `hatch run test` マトリクスをローカルと runner の両方で実行できることです。

## 正直な注意点

どちらも普遍的に「優れている」わけではありません。Hatch は意図的にロックをやや外部に委ねており、それを嫌うチームもあります。PDM はより多く (lock、scripts、plugins) をまとめますが、それは PDM 固有の概念を学ぶ必要が増えることを意味します。急速に進化する uv ツールは両者と重なるため、コミットする前に評価してください。

## Decide with your own numbers, not a feature table

Feature comparisons age badly and rarely decide anything, because both tools in a mature category can do the job. What differs is how each behaves on your repository, and that takes one afternoon to measure.

```Terminal
# time a cold install with each candidate, cache cleared
hyperfine --prepare "rm -rf node_modules" --warmup 1 \
  "<tool-a> install" "<tool-b> install"

# and the thing CI actually pays for: a cold run with no local cache
docker run --rm -v "$(pwd):/w" -w /w node:22 sh -c "<tool> install"
```

> Measure the cold path. Warm local benchmarks favour whichever tool you already have cached, which is exactly the condition a CI runner never has.

## What actually changes when you switch

- Lockfile format. A switch is a one-way door for anyone still on the old tool until everyone migrates, so plan it as a single coordinated change.
- Resolution strictness. Tools differ on whether an undeclared transitive import works, and the stricter one will surface latent bugs as new failures.
- CI cache configuration. The cache path and key differ per tool; carrying over the old ones silently disables caching.
- Everyone on the team and every runner must move together. Pin the version so they cannot drift.

## 結論

標準の build backend と環境マトリクスを求めるライブラリ作者には、Hatch がよく合います。組み込みの lockfile と高速な resolver を 1 つのツールで求めるアプリケーションチームには、PDM がより完成度の高いデフォルトです。

## FAQ

### Hatch vs PDM: Python Project Managers Compared?

Hatch (from the PyPA) and PDM are both modern, standards-based Python project managers that replace the older setup.py plus virtualenv plus pip flow. They overlap a lot but emphasize different things: Hatch centers on reproducible environments and its hatchling build backend, while PDM centers on a fast dependency resolver and a

### Where each genuinely wins?

PDM wins when you want a committed cross-platform lockfile and a quick resolver without bolting on extra tools; its pdm.lock and pdm install flow are reproducible out of the box. Hatch wins when you publish packages and want a clean, widely adopted build backend (hatchling) plus a matrix of test environments managed by one CLI.

### In CI?

PDM is convenient in CI because pdm install restores an exact, locked environment from pdm.lock. With Hatch, lock reproducibility usually comes from pinning in pyproject.toml or pairing it with pip-tools/uv; its strength in CI is running the same hatch run test matrix locally and on the runner.

### Honest caveats?

Neither is universally "better". Hatch deliberately leaves locking somewhat external, which some teams dislike. PDM bundles more (lock, scripts, plugins) but that means more PDM-specific concepts to learn. The fast-moving uv tool overlaps with both, so evaluate it before committing.

### Which should I choose?

For library authors who want a standard build backend and an env matrix, Hatch fits well. For application teams who want a built-in lockfile and a fast resolver in one tool, PDM is the more complete default.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
