Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ jobs:

- name: Check linting
run: |
uv run --frozen ruff check .
continue-on-error: true
uv run --frozen ruff check . --preview

- name: Check formatting
run: |
Expand Down
15 changes: 7 additions & 8 deletions generate_dependency_diagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import re
import tomllib
from pathlib import Path
from typing import Dict, List, Set


class PackageInfo:
Expand All @@ -19,16 +18,16 @@ def __init__(self, name: str, package_type: str, path: Path):
self.name = name
self.package_type = package_type
self.path = path
self.dependencies: Set[str] = set()
self.dependencies: set[str] = set()


def read_pyproject_toml(path: Path) -> Dict:
def read_pyproject_toml(path: Path) -> dict:
"""Read and parse a pyproject.toml file."""
with open(path, "rb") as f:
return tomllib.load(f)


def extract_dependencies(pyproject_data: Dict, package_names: Set[str]) -> Set[str]:
def extract_dependencies(pyproject_data: dict, package_names: set[str]) -> set[str]:
"""Extract internal package dependencies from pyproject.toml data."""
dependencies = set()

Expand All @@ -45,7 +44,7 @@ def extract_dependencies(pyproject_data: Dict, package_names: Set[str]) -> Set[s
return dependencies


def generate_mermaid_diagram(packages: List[PackageInfo]) -> str:
def generate_mermaid_diagram(packages: list[PackageInfo]) -> str:
"""Generate a Mermaid diagram from package information."""

# Color scheme based on package types
Expand Down Expand Up @@ -96,7 +95,7 @@ def generate_mermaid_diagram(packages: List[PackageInfo]) -> str:
lines.append(" %% Styling")

# Group packages by type for styling
packages_by_type: Dict[str, List[str]] = {}
packages_by_type: dict[str, list[str]] = {}
for pkg in packages:
if pkg.package_type not in packages_by_type:
packages_by_type[pkg.package_type] = []
Expand Down Expand Up @@ -170,8 +169,8 @@ def main():

# Collect all package names first and cache pyproject data
all_package_names = set()
packages: List[PackageInfo] = []
pyproject_data_cache: Dict[str, Dict] = {}
packages: list[PackageInfo] = []
pyproject_data_cache: dict[str, dict] = {}

for path_str, pkg_type in package_configs:
pyproject_path = repo_root / path_str / "pyproject.toml"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

"""
Microsoft Agent 365 Notifications
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

from __future__ import annotations

from collections.abc import Awaitable, Callable, Iterable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

from .agent_notification_activity import AgentNotificationActivity
from .email_reference import EmailReference
from .wpx_comment import WpxComment
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

from enum import Enum


Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

from typing import Any, Optional, Type, TypeVar
from microsoft_agents.activity import Activity
from .notification_types import NotificationTypes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

from enum import Enum


Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

from typing import Optional, Literal
from microsoft_agents.activity.entity import Entity
from .notification_types import NotificationTypes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

from typing import Literal
from microsoft_agents.activity.activity import Activity
from microsoft_agents.activity.entity import Entity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

from enum import Enum


Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

from typing import Optional, Literal
from microsoft_agents.activity.entity import Entity
from .notification_types import NotificationTypes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ target-version = ['py311']
line-length = 100
target-version = "py311"

[tool.ruff.lint.flake8-copyright]
notice-rgx = "# Copyright \\(c\\) Microsoft Corporation\\.\\r?\\n# Licensed under the MIT License\\."
min-file-size = 1

[tool.mypy]
python_version = "3.11"
strict = true
Expand Down
2 changes: 1 addition & 1 deletion libraries/microsoft-agents-a365-notifications/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
helper_path = Path(__file__).parent.parent.parent / "versioning" / "helper"
sys.path.insert(0, str(helper_path))

from setup_utils import get_dynamic_dependencies
from setup_utils import get_dynamic_dependencies # noqa: E402

# Use minimum version strategy:
# - Internal packages get: >= current_base_version (e.g., >= 0.1.0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

# Microsoft Agent 365 Python SDK for OpenTelemetry tracing.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

import logging
import threading
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

# Constants for SDK OpenTelemetry implementation.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

# Execution type enum.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

# pip install opentelemetry-sdk opentelemetry-api requests

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

import json
import logging
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

from dataclasses import dataclass

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

from enum import Enum

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

# Data class for invoke agent details.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

# Middleware components for Microsoft Agent 365 SDK.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

# Per request baggage builder for OpenTelemetry context propagation.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

# Base class for OpenTelemetry tracing scopes.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

# Request class.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

# Source metadata class.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

# Tenant details class.
from dataclasses import dataclass
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

# Data class for tool call details.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

# Tool type enum.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

"""
Trace Processors
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Copyright (c) Microsoft. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

Span processor for copying OpenTelemetry baggage entries onto spans.
"""Span processor for copying OpenTelemetry baggage entries onto spans.

This implementation assumes `opentelemetry.baggage.get_all` is available with the
signature `get_all(context: Context | None) -> Mapping[str, object]`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

from .. import constants as consts

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ target-version = ['py311']
line-length = 100
target-version = "py311"

[tool.ruff.lint.flake8-copyright]
notice-rgx = "# Copyright \\(c\\) Microsoft Corporation\\.\\r?\\n# Licensed under the MIT License\\."
min-file-size = 1

[tool.mypy]
python_version = "3.11"
strict = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
helper_path = Path(__file__).parent.parent.parent / "versioning" / "helper"
sys.path.insert(0, str(helper_path))

from setup_utils import get_dynamic_dependencies
from setup_utils import get_dynamic_dependencies # noqa: E402

# Use minimum version strategy:
# - Internal packages get: >= current_base_version (e.g., >= 0.1.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ target-version = ['py311']
line-length = 100
target-version = "py311"

[tool.ruff.lint.flake8-copyright]
notice-rgx = "# Copyright \\(c\\) Microsoft Corporation\\.\\r?\\n# Licensed under the MIT License\\."
min-file-size = 1

[tool.mypy]
python_version = "3.11"
strict = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
helper_path = Path(__file__).parent.parent.parent / "versioning" / "helper"
sys.path.insert(0, str(helper_path))

from setup_utils import get_dynamic_dependencies
from setup_utils import get_dynamic_dependencies # noqa: E402

# Use minimum version strategy:
# - Internal packages get: >= current_base_version (e.g., >= 0.1.0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

"""
Wraps the Langchain Agents SDK tracer to integrate with our Telemetry Solution.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

import logging
import re
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

from __future__ import annotations

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

import json
from collections.abc import Iterable, Iterator, Mapping, Sequence
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ target-version = ['py311']
line-length = 100
target-version = "py311"

[tool.ruff.lint.flake8-copyright]
notice-rgx = "# Copyright \\(c\\) Microsoft Corporation\\.\\r?\\n# Licensed under the MIT License\\."
min-file-size = 1

[tool.mypy]
python_version = "3.11"
strict = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
helper_path = Path(__file__).parent.parent.parent / "versioning" / "helper"
sys.path.insert(0, str(helper_path))

from setup_utils import get_dynamic_dependencies
from setup_utils import get_dynamic_dependencies # noqa: E402

# Use minimum version strategy:
# - Internal packages get: >= current_base_version (e.g., >= 0.1.0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

"""
Wraps the OpenAI Agents SDK tracer to integrate with the Microsoft Agent 365 Telemetry Solution.
Expand Down
Loading
Loading