Skip to main content

2026年の最新Python開発テンプレート

Project description

Python Project 2026

2026年の最新Python開発テンプレート - uv、ruff、pytestを使った現代的な開発環境

特徴

  • 🚀 超高速: uvによる爆速パッケージ管理
  • 🛠️ 最新ツール: ruff、mypy、pytest、Claude Code hooks、pre-commit
  • 📦 モダンな構成: pyproject.tomlによる一元管理
  • 🧪 完全なテスト: カバレッジ測定とCI/CD
  • 🔧 開発者体験: リンター、フォーマッター、型チェック
  • 🚀 自動リリース: release-pleaseによるセマンティックバージョニング

必要要件

  • Python 3.12+
  • uv (推奨)

セットアップ

uvを使用(推奨)

# uvのインストール(まだの場合)
curl -LsSf https://astral.sh/uv/install.sh | sh

# プロジェクトのセットアップ
uv sync

# 品質管理ツールのセットアップ
uv run pre-commit install              # Git hooks(手動開発時)
# Claude Code hooks(AI統合)は .claude/settings.local.json で設定済み

従来の方法

python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -e ".[dev]"
pre-commit install

開発コマンド

# テスト実行
uv run pytest

# テスト(カバレッジ付き)
uv run pytest --cov

# コードフォーマット
uv run ruff format .

# リンティング
uv run ruff check .

# 型チェック
uv run mypy

# 品質チェック実行
.claude/scripts/pre-commit-replacement.sh   # Claude Code hooks(推奨)
uv run pre-commit run --all-files           # 従来のpre-commit

# アプリケーション実行
uv run python-project-2026 hello --name "開発者"

プロジェクト構造

python-project-2026/
├── src/
│   └── python_project_2026/
│       ├── __init__.py
│       ├── main.py
│       └── utils.py
├── tests/
│   ├── test_main.py
│   └── test_utils.py
├── pyproject.toml
├── README.md
└── .pre-commit-config.yaml

設定ファイル

すべての設定は pyproject.toml に統一されています:

  • ruff: リンティングとフォーマット
  • pytest: テストの実行と設定
  • mypy: 型チェック
  • coverage: カバレッジ測定

CI/CD

GitHub Actionsによる自動化:

  • マルチプラットフォーム(Linux、Windows、macOS)
  • 複数Python バージョン(3.12、3.13)
  • テスト、リンティング、型チェック
  • セキュリティ監査

自動リリース管理

release-pleaseによる自動リリース:

Conventional Commits使用例

# パッチバージョン更新 (0.1.0 → 0.1.1)
git commit -m "fix: バリデーションエラーを修正"

# マイナーバージョン更新 (0.1.0 → 0.2.0)
git commit -m "feat: 新しい機能を追加"

# メジャーバージョン更新 (0.1.0 → 1.0.0)
git commit -m "feat!: 破壊的変更を実装"

自動化される処理

  • バージョン更新: Conventional Commitsに基づいてセマンティックバージョニング
  • CHANGELOG生成: コミットメッセージから自動的にCHANGELOGを更新
  • GitHub Releases: 新しいバージョンのリリースを自動作成
  • PyPI公開: 本番環境とテスト環境への自動パッケージ公開

ライセンス

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_project_2026-0.1.0.tar.gz (94.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_project_2026-0.1.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file python_project_2026-0.1.0.tar.gz.

File metadata

  • Download URL: python_project_2026-0.1.0.tar.gz
  • Upload date:
  • Size: 94.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for python_project_2026-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b91d68834eb826b832504f0cb57003c85f828059bf346e08d85d0aca59b67276
MD5 478ef175dada3ff9f4649ddb48887568
BLAKE2b-256 f5fe20a29d35456e0e6ca16cb6b2e2bb0d93888ed8650c2cfbd6b31094fd49db

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_project_2026-0.1.0.tar.gz:

Publisher: release-please.yml on koboriakira/python-project-2026

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_project_2026-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for python_project_2026-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 588ba231c0366b6cd29579caa716656c3569e0a640d75b8a86cd1a45f3416c00
MD5 dfc93ec600223cda5b79ae7e8fac06de
BLAKE2b-256 5a497842a73d5de20117236279117a3c44227feca2abf9b91832ce8e2d3ce2e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_project_2026-0.1.0-py3-none-any.whl:

Publisher: release-please.yml on koboriakira/python-project-2026

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page