Skip to main content

Python Project 2026

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

🚀 クイックスタート

ワンコマンドで新しいPythonプロジェクトを作成:

curl -fsSL https://raw.githubusercontent.com/koboriakira/python-project-2026/main/install.sh | sh -s my-new-project

作成後:

cd my-new-project
uv run pytest  # テスト実行
uv run my-new-project --help  # アプリケーション確認

📋 テンプレートとして使用

手動でテンプレートを使用する場合:

# このリポジトリをクローン
git clone https://github.com/koboriakira/python-project-2026.git
cd python-project-2026

# 新しいプロジェクトを作成
./install.sh my-new-project

# 作成されたプロジェクトに移動
cd my-new-project

# 開発開始!
uv run pytest  # テスト実行
uv run my-new-project --help  # アプリケーション確認

install.shの機能

  • ✅ 自動ダウンロード: GitHubから最新のテンプレートを取得
  • ✅ 完全なファイルコピー: すべてのテンプレートファイルを新しいディレクトリにコピー
  • ✅ 名前の一括置換: プロジェクト名・パッケージ名を適切に変換
  • ✅ Git初期化: 新しいGitリポジトリの初期化と初回コミット
  • ✅ 環境セットアップ: uv syncによる依存関係のインストール
  • ✅ エラーハンドリング: 無効な名前や既存ディレクトリの検証

特徴

  • 🚀 超高速: 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

Metadata

Release files for python-project-2026 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-project-2026 0.3.0
File Size Uploaded Provenance Actions
python_project_2026-0.3.0.tar.gz 113.8 kB With provenance Details for python_project_2026-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for python-project-2026 0.3.0
File Interpreter ABI Platform Actions
python_project_2026-0.3.0-py3-none-any.whl Python 3 none any Details for python_project_2026-0.3.0-py3-none-any.whl

Total release size: 122.6 kB

Release files / python_project_2026-0.3.0.tar.gz

Download URL python_project_2026-0.3.0.tar.gz
Size 113.8 kB
Tags Source
SHA-256 checksum
How to use checksums
926d00769b3e2f7f8866e25e754090d9d7da8c5d843812b3d3c700949cfc2349
BLAKE2b-256 checksum
How to use checksums
722e8f5762097b18b9945774ad7bf70752244c74fadb68cce26911d2dc7ee80a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 2, 2026.

Transparency log

Release files / python_project_2026-0.3.0-py3-none-any.whl

Download URL python_project_2026-0.3.0-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
03f83cbe5d5c696f348073fe910446384985af52c7c22a2706e7bfc7bc9ba2b7
BLAKE2b-256 checksum
How to use checksums
a935488c957c1582f7618fbadd8a09d1ead587e52a842f2507a38fc32ee82d9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 2, 2026.

Transparency log

Security for python-project-2026 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for python_project_2026-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page