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.1.tar.gz (94.6 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.1-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: python_project_2026-0.1.1.tar.gz
  • Upload date:
  • Size: 94.6 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.1.tar.gz
Algorithm Hash digest
SHA256 6d837db19bc7b1087eb1dabf24ae41d9bb847502baf422260f02f408dab3d16e
MD5 cf484a5fb6df62bd25eea602c7401b4a
BLAKE2b-256 6e810ba141f6e04bd08317a0af22260f506736ce54df4edb39ad70036c85d2ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_project_2026-0.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for python_project_2026-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c06323bac2edfe40192ca3181e43bb3f9c4f5bcc2ccc9d98c26c1081fd03476f
MD5 6b3902bd8bc9096ee3583a1d2e8db6eb
BLAKE2b-256 6fce16f869ca4ef24f457fe938aa0f534964b98287db57f12157267b11465e15

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_project_2026-0.1.1-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