# Python プロジェクトセットアップガイド (デフォルト設定)
## 1. 仮想環境のセットアップ
### 1.1. 仮想環境の初期化
```bash
uv init
```
### 1.2. 開発依存関係の追加
```bash
uv add ruff mypy pytest pytest-cov -G dev
```
## 2 `pyproject.toml` の手動追加編集
```toml
[tool.ruff]
line-length = 119
indent-width = 4
exclude = [
".ruff_cache",
".venv",
"__pypackages__",
"*.egg-info",
]
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"D",
"ANN201",
"T201",
"INP001",
"COM812", # Trailing comma missing (conflicts with formatter)
]
fixable = ["ALL"]
[tool.ruff.lint.per-file-ignores]
"test_*.py" = ["S101", "PLR2004"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "lf"
```