When contributing to Dapr Agents, the following rules and best-practices should be followed.
The examples directory contains code samples for users to run to try out specific functionality of the various Dapr Agents packages and extensions. When writing new and updated samples keep in mind:
This project uses modern Python packaging with pyproject.toml
. Dependencies are managed as follows:
[project.dependencies]
[project.optional-dependencies.test]
[project.optional-dependencies.dev]
If you need to generate requirements files (e.g., for deployment or specific environments):
# Generate requirements.txt
pip-compile pyproject.toml
# Generate dev-requirements.txt
pip-compile pyproject.toml --extra dev
# Install main package with test dependencies
pip install -e ".[test]"
# Install main package with development dependencies
pip install -e ".[dev]"
# Install main package with all optional dependencies
pip install -e ".[test,dev]"
The project uses pytest for testing. To run tests:
# Run all tests
tox -e pytest
# Run specific test file
tox -e pytest tests/test_random_orchestrator.py
# Run tests with coverage
tox -e pytest --cov=dapr_agents
The project uses several tools to maintain code quality:
# Run linting
tox -e flake8
# Run code formatting
tox -e ruff
# Run type checking
tox -e type
Install development dependencies:
pip install -e ".[dev]"
Run tests before making changes:
tox -e pytest
Make your changes
Run code quality checks:
tox -e flake8
tox -e ruff
tox -e type
Run tests again:
tox -e pytest
Submit your changes
Checkout the daprbot documentation for GitHub commands you can run in this repo for common tasks. For example, you can run the /assign
(as a comment on an issue) to assign issues to a user or group of users.
Was this page helpful?