Development¶
Setup¶
git clone https://github.com/yeongseon/azure-functions-langgraph.git
cd azure-functions-langgraph
make install
This will:
- Create a Python virtual environment in
.venv/ - Install Hatch as the build and environment manager
- Create the Hatch environment with all dev dependencies
- Install pre-commit hooks
Project structure¶
azure-functions-langgraph/
├── src/azure_functions_langgraph/ # Source code
│ ├── __init__.py # Package init, version, lazy import
│ ├── app.py # LangGraphApp class
│ ├── contracts.py # Pydantic models
│ ├── protocols.py # Protocol interfaces
│ └── py.typed # PEP 561 typed marker
├── tests/ # Test suite
│ ├── conftest.py # Shared fixtures (FakeCompiledGraph, etc.)
│ ├── test_app.py # Core app tests
│ ├── test_contracts.py # Contract model tests
│ ├── test_protocols.py # Protocol tests
│ └── test_public_api.py # Public API surface tests
├── examples/ # Example applications
│ └── simple_agent/
│ └── graph.py
├── docs/ # Documentation (MkDocs)
├── pyproject.toml # Project metadata and tool config
├── Makefile # Development commands
└── .pre-commit-config.yaml # Pre-commit hooks
Makefile commands¶
| Command | Description |
|---|---|
make install |
Create environment and install dependencies |
make test |
Run pytest test suite |
make lint |
Run ruff check + mypy |
make format |
Auto-format code with ruff |
make typecheck |
Run mypy type checker |
make security |
Run bandit security scan |
make build |
Build sdist and wheel |
make cov |
Run tests with HTML coverage report |
make docs |
Build MkDocs documentation |
make docs-serve |
Serve docs locally |
make check |
Run lint + typecheck |
make check-all |
Run lint + typecheck + test + security |
make clean |
Remove build artifacts |
make clean-all |
Remove all generated files including venv |
Code style¶
- Formatter: ruff format (line length 100)
- Linter: ruff check (E, F, I rules)
- Type checker: mypy (strict mode)
- Target: Python 3.10+
Adding a new feature¶
- Write tests first in
tests/ - Implement in
src/azure_functions_langgraph/ - Run
make check-allto verify everything passes - Update documentation if the public API changed
Pre-commit hooks¶
Pre-commit hooks run automatically on git commit:
- ruff format check
- ruff lint check
- trailing whitespace removal
- end-of-file fixer
- YAML/TOML syntax check
- mypy type check
- bandit security scan
To run manually: