Principle:Microsoft Agent framework Python Workspace Configuration
| Knowledge Sources | |
|---|---|
| Domains | Build_System, Python_Packaging |
| Last Updated | 2026-02-11 17:00 GMT |
Overview
Principle of organizing a multi-package Python repository as a unified workspace with centralized dependency resolution, shared tooling configuration, and automated task orchestration.
Description
Workspace Configuration addresses the challenge of managing a monorepo containing many interdependent Python packages. Instead of each package independently managing its own dependencies, build tools, and CI configuration, a workspace model provides:
- Centralized dependency resolution: A single lock file ensures all packages use compatible dependency versions.
- Shared tool configuration: Linting rules (ruff), type checking (pyright, mypy), testing (pytest), and security scanning (bandit) are configured once at the root.
- Task orchestration: A task runner (poethepoet) provides uniform commands that operate across all packages (e.g., poe test runs tests in every package).
- Meta-package publishing: A root package re-exports the core package, so users can install a single package to get all functionality.
This pattern reduces configuration drift across packages and ensures consistent quality standards.
Usage
Apply this principle when designing a Python monorepo with multiple publishable packages that share common dependencies and need coordinated CI/CD workflows. It is the foundational build architecture for the Microsoft Agent Framework Python SDK.
Theoretical Basis
The workspace model follows the dependency inversion principle applied to build systems:
Pseudo-code Logic:
# Abstract workspace pattern (NOT real implementation)
workspace = Workspace(
members=["packages/*"],
shared_config={
"linter": RuffConfig(rules=[...]),
"type_checker": PyrightConfig(mode="strict"),
"test_runner": PytestConfig(paths=["packages/**/tests"]),
},
)
# Resolves all dependencies in one pass
workspace.resolve_dependencies()
# Runs task across all members
for package in workspace.members:
package.run("test")
Key properties:
- Single source of truth: One pyproject.toml configures all shared rules
- Workspace-aware resolution: Internal dependencies resolve to local packages, not PyPI
- Override mechanism: Dependency conflicts can be resolved centrally via override-dependencies