A newer version of the Gradio SDK is available: 6.20.0
AGENTS.md
Context of the Project
- Python: 3.13
- Package Manager: uv
Tooling & Environment
- This project uses
uvfor dependency and environment management. - CRITICAL: Always use
uv runto execute scripts, tests, or tools. Never use globalpytestorpython.
Code Generation
For function signatures, include the type from typing package. Optional arguments should be put after mandatory arguments.
You have to add documentation for new functions and classes that you generate. For existing functions, update the documentation for functions and classes that you edit. The documentation should follow NumPy style. The documentation should contain what is the function for (basically the description), a brief summary of the steps, and input and output parameters. If your function has the ability to throw error, please state it in the documentation as well.
You have to add unit tests as well. Make sure to put unit tests in tests folder.
Testing Standards
- Mandatory Coverage: Every new feature or bug fix must include corresponding unit tests.
- Framework: Use
pytest. Prefer functional tests with fixtures over heavily mocked class-based tests. - Async Code: If testing async functions, use
@pytest.mark.anyioor@pytest.mark.asyncioas appropriate for the project stack. - Mocking: Use
pytest-mock(mocker fixture) instead of standardunittest.mockwhere possible for cleaner teardowns.
Required Commands
- Lint code before committing:
make lint - Format code:
make lint/fix - Type-checking:
make ty - Run test suite:
make test