Skip to content

Commit 434ffb8

Browse files
Python: [BREAKING] Cleanup of dependencies (#1803)
* removed extra and non-released deps * added comments * added space and lock * fix pyright config
1 parent abfdf75 commit 434ffb8

File tree

14 files changed

+51
-345
lines changed

14 files changed

+51
-345
lines changed

python/packages/a2a/pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ omit = [
5555
]
5656

5757
[tool.pyright]
58-
extend = "../../pyproject.toml"
59-
exclude = ['tests']
58+
extends = "../../pyproject.toml"
6059

6160
[tool.mypy]
6261
plugins = ['pydantic.mypy']

python/packages/azure-ai/pyproject.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ dependencies = [
2525
"agent-framework-core",
2626
"azure-ai-projects >= 1.0.0b11",
2727
"azure-ai-agents == 1.2.0b5",
28-
"aiohttp ~= 3.8",
2928
]
3029

3130
[tool.uv]
@@ -55,8 +54,7 @@ omit = [
5554
]
5655

5756
[tool.pyright]
58-
extend = "../../pyproject.toml"
59-
exclude = ['tests']
57+
extends = "../../pyproject.toml"
6058

6159
[tool.mypy]
6260
plugins = ['pydantic.mypy']

python/packages/copilotstudio/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ omit = [
5555
]
5656

5757
[tool.pyright]
58-
extend = "../../pyproject.toml"
59-
exclude = ['tests']
58+
extends = "../../pyproject.toml"
59+
6060

6161
[tool.mypy]
6262
plugins = ['pydantic.mypy']

python/packages/core/agent_framework/_workflows/_viz.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ def export(self, format: Literal["svg", "png", "pdf", "dot"] = "svg", filename:
8080
import graphviz # type: ignore
8181
except ImportError as e:
8282
raise ImportError(
83-
"viz extra is required for export. Install it with: pip install agent-framework[viz] --pre. "
83+
"viz extra is required for export. Install it with: pip install graphviz>=0.20.0 "
84+
"The version needs to be at least 0.20.0. "
8485
"You also need to install graphviz separately. E.g., sudo apt-get install graphviz on Debian/Ubuntu "
8586
"or brew install graphviz on macOS. See https://graphviz.org/download/ for details."
8687
) from e

python/packages/core/agent_framework/observability.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,17 @@ def _get_azure_monitor_exporters(
279279
credential: "TokenCredential | None" = None,
280280
) -> list["LogExporter | SpanExporter | MetricExporter"]:
281281
"""Create Azure Monitor Exporters, based on the connection strings and optionally the credential."""
282-
from azure.monitor.opentelemetry.exporter import (
283-
AzureMonitorLogExporter,
284-
AzureMonitorMetricExporter,
285-
AzureMonitorTraceExporter,
286-
)
282+
try:
283+
from azure.monitor.opentelemetry.exporter import (
284+
AzureMonitorLogExporter,
285+
AzureMonitorMetricExporter,
286+
AzureMonitorTraceExporter,
287+
)
288+
except ImportError as e:
289+
raise ImportError(
290+
"azure-monitor-opentelemetry-exporter is required for Azure Monitor exporters. "
291+
"Install it with: pip install azure-monitor-opentelemetry-exporter>=1.0.0b41"
292+
) from e
287293

288294
exporters: list["LogExporter | SpanExporter | MetricExporter"] = []
289295
for conn_string in connection_strings:

python/packages/core/pyproject.toml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,33 +22,29 @@ classifiers = [
2222
"Typing :: Typed",
2323
]
2424
dependencies = [
25-
"openai>=1.99.0,<2",
25+
# utilities
26+
"typing-extensions",
2627
"pydantic>=2,<3",
2728
"pydantic-settings>=2,<3",
28-
"typing-extensions",
29+
# telemetry
2930
"opentelemetry-api>=1.24",
3031
"opentelemetry-sdk>=1.24",
31-
"mcp[ws]>=1.13",
32-
"azure-monitor-opentelemetry>=1.7.0",
33-
"azure-monitor-opentelemetry-exporter>=1.0.0b41",
3432
"opentelemetry-exporter-otlp-proto-grpc>=1.36.0",
3533
"opentelemetry-semantic-conventions-ai>=0.4.13",
36-
"aiofiles>=24.1.0",
34+
# connectors and functions
35+
"openai>=1.99.0,<2",
3736
"azure-identity>=1,<2",
37+
"mcp[ws]>=1.13",
3838
]
3939

4040
[project.optional-dependencies]
41-
viz = [
42-
"graphviz>=0.20.0"
43-
]
4441
all = [
4542
"agent-framework-a2a",
4643
"agent-framework-azure-ai",
4744
"agent-framework-copilotstudio",
4845
"agent-framework-mem0",
4946
"agent-framework-redis",
5047
"agent-framework-devui",
51-
"graphviz>=0.20.0"
5248
]
5349

5450
[tool.uv]
@@ -87,8 +83,7 @@ omit = [
8783
extend = "../../pyproject.toml"
8884

8985
[tool.pyright]
90-
extend = "../../pyproject.toml"
91-
exclude = ['tests']
86+
extends = "../../pyproject.toml"
9287

9388
[tool.mypy]
9489
plugins = ['pydantic.mypy']

python/packages/devui/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ omit = [
6262
]
6363

6464
[tool.pyright]
65-
extend = "../../pyproject.toml"
66-
exclude = ['tests']
65+
extends = "../../pyproject.toml"
66+
6767

6868
[tool.mypy]
6969
plugins = ['pydantic.mypy']

python/packages/lab/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ omit = [
119119
]
120120

121121
[tool.pyright]
122-
extend = "../../pyproject.toml"
122+
extends = "../../pyproject.toml"
123123
exclude = ['gaia/tests', 'lightning/tests', 'tau2/tests', 'namespace', '**/samples']
124124

125125
[tool.mypy]

python/packages/mem0/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ omit = [
5555
]
5656

5757
[tool.pyright]
58-
extend = "../../pyproject.toml"
59-
exclude = ['tests']
58+
extends = "../../pyproject.toml"
59+
6060

6161
[tool.mypy]
6262
plugins = ['pydantic.mypy']

python/packages/purview/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ omit = [
5454
]
5555

5656
[tool.pyright]
57-
extend = "../../pyproject.toml"
58-
exclude = ['tests']
57+
extends = "../../pyproject.toml"
58+
5959

6060
[tool.mypy]
6161
plugins = ['pydantic.mypy']

0 commit comments

Comments
 (0)