Skip to main content

python-review

Python code review guidelines for the Cog SDK

소스 정보

저장소
replicate/cog
최근 소스 활동
2026년 4월 24일 19:38
감지된 SKILL.md 언어
영어
스타
9,489
포크
698

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
python-review
description
Python code review guidelines for the Cog SDK
## Python review guidelines This project uses Python for the SDK (`python/cog/`) which defines the predictor interface, type system, and HTTP/queue server. ### What linters already catch (skip these) ruff handles pycodestyle (E), Pyflakes (F), isort (I), warnings (W), bandit (S), bugbear (B), and annotations (ANN). Don't flag issues these would catch. ### What to look for **Type annotations** - Required on all function signatures - Use `typing_extensions` for backward compatibility - Avoid `Any` where a concrete type is possible - Check that type annotations actually match runtime behavior **Compatibility** - Must support Python 3.10 through 3.13 - Watch for syntax/stdlib features only available in newer versions - `from __future__ import annotations` if using newer annotation syntax **Error handling** - No bare `except:` or `except Exception:` that swallows everything - Exceptions should have descriptive messages - Resource cleanup with context managers, not try/finally when avoidable **Async patterns** - Tests use pytest-asyncio -- async tests need proper fixtures - Watch for blocking calls inside async functions - Proper cleanup of async resources (aclose, async context managers) **Predictor interface** - `base_predictor.py` is the core interface -- changes here affect all users - `types.py` defines input/output types -- check backward compatibility - Server code in `python/cog/server/` handles HTTP -- watch for request handling bugs **Testing** - Uses pytest with fixtures - tox runs tests across Python 3.10-3.13 - Test isolation: don't rely on global state or test ordering
GitHub에서 보기