スキル一覧に戻る
martinffx

pythonbuild-tools

by martinffx

A software development atelier for Claude Code - spec-driven development, code quality, deep thinking, and language specific patterns.

1🍴 0📅 2026年1月22日
GitHubで見るManusで実行

SKILL.md


name: python:build-tools description: Python project tooling with uv, mise, ruff, basedpyright, and pytest. Use when setting up pyproject.toml, running builds, typechecking, configuring tests, linting, formatting, or managing Python environments. user-invocable: false

Python Build Tools

Modern Python development tooling using uv, mise, ruff, basedpyright, and pytest.

Quick Start

Minimal pyproject.toml

[project]
name = "my-project"
version = "0.1.0"
requires-python = ">=3.12"
dependencies = ["fastapi", "pydantic"]

[project.optional-dependencies]
dev = ["pytest>=8.0.0", "ruff>=0.8.0", "basedpyright>=1.0.0"]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.ruff]
target-version = "py312"

[tool.ruff.lint]
select = ["E", "F", "I", "N", "UP", "RUF"]

[tool.basedpyright]
typeCheckingMode = "strict"

[tool.pytest.ini_options]
testpaths = ["tests"]

Setup Project

uv init my-project && cd my-project
uv sync
uv add fastapi pydantic
uv add --dev pytest ruff basedpyright

Tool Overview

ToolPurposeReplaces
uvPackage managementpip, virtualenv
miseVersion & taskspyenv, asdf
ruffLint & formatblack, isort, flake8
basedpyrightType checkingmypy
pytestTestingunittest

Common Commands

Lint and Format

uv run ruff check --fix .
uv run ruff format .

Type Check

uv run basedpyright
uv run basedpyright src/main.py

Test

uv run pytest
uv run pytest --cov=src --cov-report=html

Manage Dependencies

uv add fastapi
uv add --dev pytest
uv lock --upgrade
uv tree

Mise Configuration

Create .mise.toml for consistent development:

[tools]
python = "3.12"

[tasks.lint]
run = "uv run ruff check --fix ."

[tasks.format]
run = "uv run ruff format ."

[tasks.typecheck]
run = "uv run basedpyright"

[tasks.test]
run = "uv run pytest"

[tasks.check]
depends = ["lint", "format", "typecheck", "test"]

Usage:

mise install
mise run check

Type Hints Example

from decimal import Decimal
from typing import Optional

def calculate_discount(
    total: Decimal,
    rate: Optional[Decimal] = None
) -> Decimal:
    if rate is None:
        rate = Decimal("0.1")
    return total * rate

Best Practices

  1. Use uv for all package management (faster, reliable)
  2. Pin Python version with mise
  3. Configure tools in pyproject.toml
  4. Enable strict type checking
  5. Run checks before commit

References

For detailed configuration and advanced patterns:

スコア

総合スコア

65/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

0/5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です