modern-python by antoinebou12/uml-mcp
npx skills add https://github.com/antoinebou12/uml-mcp --skill modern-python现代 Python 工具和实践:使用 uv 管理依赖,ruff 进行代码检查和格式化,ty 进行类型检查,pytest 进行测试。适用于本项目以及设置或重构 Python 代码库时。
优先使用 uv 而非原始的 python/pip。当要运行传统命令时,请使用:
| 传统命令 | 替代命令 |
|---|---|
python | uv run python |
python script.py |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
uv run script.py |
pip install pkg | uv add pkg 或 uv run --with pkg |
pip uninstall pkg | uv remove pkg |
pip freeze | uv export |
python -m pip install | uv add / uv sync |
已经使用 uv run 的命令(例如 uv run pytest)无需更改。
src/ 布局(包位于 src/<package_name>/ 下)。本项目使用了顶层包结构(mcp_core、kroki、plantuml 等);添加新包时,请将其保持在仓库根目录下或置于清晰的命名空间下。pyproject.toml 文件。[project] 中优先使用 Python 3.11+;本仓库使用 3.10+。pyproject.toml 的 [tool.ruff] 和 [tool.ruff.format] 下进行配置。运行:
uv run ruff check .uv run ruff format .修复可自动修复的问题:uv run ruff check --fix .
pyproject.toml 的 [tool.ty] 下进行配置。运行:uv run ty check
tests/;使用 conftest.py 存放共享的 fixture。pytest-cov。强制执行最低覆盖率阈值,以便当覆盖率下降时 CI 会失败。运行:
uv run pytestuv run pytest --cov=mcp_core --cov-report=term-missinguv run pytest -v tests/良好实践:
@pytest.fixture 进行设置/清理和共享状态管理。@pytest.mark.parametrize 处理多个输入/输出。uv run pip-audit 或在 CI 中使用。pyproject.toml,并包含清晰的 requires-python 和依赖组pip install每周安装数
1
仓库
GitHub 星标数
72
首次出现
1 天前
安全审计
安装于
zencoder1
amp1
cline1
openclaw1
opencode1
cursor1
Modern Python tooling and practices: uv for dependencies, ruff for lint/format, ty for type checking, pytest for tests. Use for this project and when setting up or refactoring Python codebases.
Prefer uv over raw python/pip. When about to run legacy commands, use:
| Legacy command | Use instead |
|---|---|
python | uv run python |
python script.py | uv run script.py |
pip install pkg | uv add pkg or uv run --with pkg |
pip uninstall pkg | uv remove pkg |
pip freeze | uv export |
python -m pip install | uv add / uv sync |
Commands that already use uv run (e.g. uv run pytest) do not need changing.
src/ layout (package under src/<package_name>/). This project uses top-level packages (mcp_core, kroki, plantuml, etc.); when adding new packages, keep them at repo root or under a clear namespace.pyproject.toml at repo root.[project] for new projects; this repo uses 3.10+.pyproject.toml under [tool.ruff] and [tool.ruff.format].Run:
uv run ruff check .uv run ruff format .Fix auto-fixable issues: uv run ruff check --fix .
pyproject.toml under [tool.ty] if needed.Run: uv run ty check
tests/ at repo root; use conftest.py for shared fixtures.pytest-cov. Enforce a minimum coverage threshold so CI fails when coverage drops.Run:
uv run pytestuv run pytest --cov=mcp_core --cov-report=term-missinguv run pytest -v tests/Good practices:
@pytest.fixture for setup/teardown and shared state.@pytest.mark.parametrize for multiple inputs/outputs.uv run pip-audit or use in CI.pyproject.toml with clear requires-python and dependency groupspip install in instructionsWeekly Installs
1
Repository
GitHub Stars
72
First Seen
1 day ago
Security Audits
Gen Agent Trust HubPassSocketFailSnykPass
Installed on
zencoder1
amp1
cline1
openclaw1
opencode1
cursor1
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
147,400 周安装