dapr-agents/docs/development
Sam cee485fbad
test: init test setup and some tests + dev docs and proper setup with pyproject.toml (#137)
* test: add init tests and setup for tests

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: clean up unused / autogen files now

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: ignore req files that we can now autogen

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: make linter happy

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix(build): pin deps

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: update doc ordering

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix(build): update imports

Signed-off-by: Samantha Coyle <sam@diagrid.io>

---------

Signed-off-by: Samantha Coyle <sam@diagrid.io>
Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
2025-06-30 14:36:05 -07:00
..
README.md test: init test setup and some tests + dev docs and proper setup with pyproject.toml (#137) 2025-06-30 14:36:05 -07:00

README.md

Development Guide

Dependencies

This project uses modern Python packaging with pyproject.toml. Dependencies are managed as follows:

  • Main dependencies are in [project.dependencies]
  • Test dependencies are in [project.optional-dependencies.test]
  • Development dependencies are in [project.optional-dependencies.dev]

Generating Requirements Files

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

Installing Dependencies

# 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]"

Testing

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

Code Quality

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

Development Workflow

  1. Install development dependencies:

    pip install -e ".[dev]"
    
  2. Run tests before making changes:

    tox -e pytest
    
  3. Make your changes

  4. Run code quality checks:

    tox -e flake8
    tox -e ruff
    tox -e type
    
  5. Run tests again:

    tox -e pytest
    
  6. Submit your changes