Implementation:Microsoft Semantic kernel Python Pyproject Configuration
| Knowledge Sources | |
|---|---|
| Domains | Python, Build_Configuration, Package_Management |
| Last Updated | 2026-02-11 00:00 GMT |
Overview
Python project configuration and build metadata file (pyproject.toml) for the semantic-kernel Python SDK package, defining dependencies, optional extras, dev tools, and build system settings.
Description
This pyproject.toml file is the central build and project configuration for the Semantic Kernel Python SDK. It defines the package metadata, core dependencies, optional dependency groups for various AI providers and vector stores, development tooling configuration, and the build system.
Project metadata:
- Package name:
semantic-kernel - Python requirement: >=3.10
- License: MIT
- Development status: Production/Stable
- Build system: Flit (flit-core >= 3.9,<4.0)
- Version: Dynamically read from
__init__.py
Core dependencies include:
azure-ai-projects,azure-ai-agents,azure-identity- Azure service integrationspydantic(>=2.0),pydantic-settings- Data validation and settingsopenai(>=1.98.0,<2) - OpenAI API clientopentelemetry-api,opentelemetry-sdk- Observability and tracingnumpy- Embedding computations (version varies by Python version)jinja2,pybars4- Template renderingopenapi_core,prance- OpenAPI/Swagger supportmcp- Model Context Protocol support
Optional dependency groups (extras):
- AI Providers:
anthropic,aws(boto3),google(google-genai, vertex AI),hugging_face(transformers, sentence-transformers),mistralai,ollama,onnx - Vector Stores:
azure(azure-search, cosmos),chroma,milvus,mongo,pinecone,postgres(psycopg),qdrant,redis,usearch,weaviate,faiss,oracledb - Other:
autogen,copilotstudio,dapr,notebooks,pandas,realtime,sql
Development tools:
pytest(~=8.2) with asyncio, coverage, xdist, and timeout pluginsmypy(>=1.10) for static type checkingruff(~=0.9) for linting and formatting with Google pydocstyle conventionpre-commit(~=3.7) for git hooks
Usage
This file is used by Python package managers (pip, uv, flit) to install the semantic-kernel package and its dependencies. Developers install the base package with pip install semantic-kernel or specific extras with pip install semantic-kernel[google,redis]. Contributors use the dev dependency group for testing and linting. The file is also the source of truth for tool configurations (ruff, pytest, bandit).
Code Reference
Source Location
- Repository: Microsoft_Semantic_kernel
- File: python/pyproject.toml
- Lines: 1-262
Signature
[project]
name = "semantic-kernel"
description = "Semantic Kernel Python SDK"
authors = [{ name = "Microsoft", email = "SK-Support@microsoft.com"}]
readme = "README.md"
dynamic = ["version"]
requires-python = ">=3.10"
license = {file = "LICENSE"}
urls.homepage = "https://learn.microsoft.com/en-us/semantic-kernel/overview/"
urls.source = "https://github.com/microsoft/semantic-kernel/tree/main/python"
dependencies = [
"azure-ai-projects ~= 1.0.0b12",
"pydantic >=2.0,!=2.10.0,!=2.10.1,!=2.10.2,!=2.10.3,<2.12",
"openai >= 1.98.0,<2",
"opentelemetry-api ~= 1.24",
"numpy >= 1.25.0; python_version < '3.12'",
"jinja2 ~= 3.1",
"mcp>=1.26.0",
]
Import
# Install the base semantic-kernel package
pip install semantic-kernel
# Install with specific optional dependencies
pip install semantic-kernel[google,redis,anthropic]
# Install with all development dependencies
pip install semantic-kernel
pip install --group dev
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| Python version | runtime | yes | Python >=3.10 required to install and use the package |
| extras | string list | no | Optional dependency groups to install (e.g., "google", "redis", "anthropic") |
Outputs
| Name | Type | Description |
|---|---|---|
| semantic-kernel package | Python package | Installed semantic_kernel module with all core dependencies |
| optional integrations | Python packages | Additional provider-specific or store-specific packages based on selected extras |
| dev tools | Python packages | pytest, mypy, ruff, and other development tools when dev group is installed |
Usage Examples
Installing with Specific Extras
# Install for use with Google AI and Qdrant vector store
pip install semantic-kernel[google,qdrant]
# Install for Azure ecosystem (AI Inference, Cosmos, Search)
pip install semantic-kernel[azure]
# Install for Hugging Face local models
pip install semantic-kernel[hugging_face]
Running the Test Suite
# Install development dependencies
cd python
pip install -e .
pip install --group dev
# Run tests with pytest (configured in pyproject.toml)
pytest tests/ -ra -q
Running Ruff Linter
# Lint the project (configuration from pyproject.toml)
ruff check python/semantic_kernel/
# Format code
ruff format python/semantic_kernel/