poethepoet (poe)
Python용 태스크 러너. pyproject.toml에 스크립트를 정의하고 poe <task>로 실행한다. Node.js의 npm run <script>에 해당한다.
기본 사용법
# pyproject.toml
[tool.poe.tasks]
start = "uvicorn app.main:app --reload"
test = "pytest"
lint = "ruff check ."
migrate = "alembic upgrade head"
poe start # 태스크 실행
uv run poe start # uv 가상환경 활성화 + 태스크 실행
태스크 타입
| 타입 | 설명 | 예시 |
|---|
cmd | 단일 쉘 명령 (기본) | start = "uvicorn app:app" |
script | Python 함수 호출 | setup = { script = "scripts:setup" } |
shell | 쉘 스크립트 (파이프 등) | check = { shell = "ruff check . && pytest" } |
sequence | 여러 태스크 순차 실행 | all = ["lint", "test"] |
Node.js 비교
| Node.js | Python (poe) |
|---|
package.json → scripts | pyproject.toml → [tool.poe.tasks] |
npm run start | poe start |
npx | uvx |
| 태스크 러너 내장 | uv는 미내장 → poe로 보완 |
관련 문서
- uv — 함께 사용하는 패키지 매니저 (
uv run poe <task>)