AgentSkillsCN

python-pdm

采用PDM、Ruff、MyPy构建Python 3.13项目。适用于Python编码规范、依赖管理与代码静态分析。

SKILL.md
--- frontmatter
name: python-pdm
description: Python 3.13 project with PDM, Ruff, MyPy. Use for Python conventions, dependency management, and linting.

Python Project (PDM)

Environment

Always activate venv first:

bash
source .venv/bin/activate

Commands

TaskCommand
Install depspdm install
Add dependencypdm add <package>
Add dev dependencypdm add -dG dev <package>
Lintpdm run ruff check .
Formatpdm run ruff format .
Type checkpdm run mypy
Testpdm run pytest
All checksmake check

Conventions

  • Python 3.13
  • Line length 120
  • Strict mypy mode
  • src/ layout
  • No comments unless explicitly requested

After Editing

Always run:

bash
pdm run ruff check . && pdm run ruff format . && pdm run mypy

Important Files

  • pyproject.toml - Project config
  • Makefile - Common commands
  • .env.example - Environment template