Python project structure — pyproject.toml, src layout, __init__.py, .gitignore, dependency groups, type hints, py.typed, test structure, entry points, ruff/mypy configuration
91
87%
Does it follow best practices?
Impact
99%
1.03xAverage score across 5 eval scenarios
Passed
No known issues
A SaaS company is adding a notification microservice to their platform. The service receives notification requests via a FastAPI REST API (email, SMS, push) and queues them for delivery. It needs to integrate with external providers (SendGrid for email, Twilio for SMS) but for now the implementations can be stubs.
The team has been burned by untested code before, so they want the project set up with a solid test foundation from day one. They also want proper CI tooling: linting with ruff, type checking with mypy, and test coverage reporting.
Produce a complete project structure with:
pyproject.toml -- [build-system], [project] with name/version/requires-python >= 3.11, production dependencies (fastapi, uvicorn, pydantic, pydantic-settings), [project.optional-dependencies] with separate dev group (ruff, mypy) and test group (pytest, pytest-asyncio, pytest-cov, httpx), [tool.ruff] with lint rules, [tool.mypy] with strict = true, [tool.pytest.ini_options] with testpaths and asyncio_mode.gitignore -- .venv/, pycache/, dist/, .env, .coverage, htmlcov/, .mypy_cache/, .ruff_cache/__init__.py in every directory:
main.py -- App factory with router registration and error handlersconfig.py -- BaseSettings with provider API keys, database URL, environment namemodels.py -- NotificationType (Literal), NotificationRequest, NotificationStatus, NotificationRecordroutes/notifications.py -- POST /notifications, GET /notifications/{id}, GET /notifications (list with filters)db.py -- In-memory storage for notification recordsservices/email.py -- Email provider integration (stub)services/sms.py -- SMS provider integration (stub)errors.py -- Custom exceptions with error handler registrationtests/ with:
__init__.pyconftest.py -- App fixture, async test client fixture, sample notification data fixturetest_notifications.py -- Tests for notification endpoints (create, get, list)test_models.py -- Tests for Pydantic model validationAll functions must have type hints. Focus on project structure and test infrastructure.
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
skills
python-project-structure
verifiers