small update in init (#189)

This commit is contained in:
Eduard van Valkenburg
2025-07-15 17:09:32 +02:00
committed by GitHub
Unverified
parent c30d726914
commit 2e6f6a4008
9 changed files with 373 additions and 122 deletions
+49 -4
View File
@@ -26,6 +26,52 @@ dependencies = [
"agent-framework",
]
[dependency-groups]
dev = [
"pre-commit >= 3.7",
"ruff>=0.11.8",
"pytest>=8.4.1",
"pytest-asyncio>=1.0.0",
"pytest-cov>=6.2.1",
"pytest-xdist[psutil]>=3.8.0",
"pytest-timeout>=2.3.1",
"mypy>=1.16.1",
"pyright>=1.1.402",
#tasks
"poethepoet>=0.36.0",
"rich",
"tomli",
"tomli-w",
"markdownify",
# Documentation
"myst-nb==1.1.2",
"pydata-sphinx-theme==0.16.0",
"sphinx-copybutton",
"sphinx-design",
"sphinx",
"sphinxcontrib-apidoc",
"autodoc_pydantic~=2.2",
"pygments",
"sphinxext-rediraffe",
"opentelemetry-instrumentation-openai",
"markdown-it-py[linkify]",
# Documentation tooling
"diskcache",
"redis",
"sphinx-autobuild",
]
[tool.uv]
prerelease = "if-necessary-or-explicit"
environments = [
"sys_platform == 'darwin'",
"sys_platform == 'linux'",
"sys_platform == 'win32'"
]
[tool.uv-dynamic-versioning]
fallback-version = "0.0.0"
[tool.pytest.ini_options]
testpaths = 'tests'
addopts = "-ra -q -r fEX"
@@ -57,7 +103,7 @@ disallow_untyped_decorators = true
disallow_any_unimported = true
[tool.bandit]
targets = ["agent_framework"]
targets = ["agent_framework_azure"]
exclude_dirs = ["tests"]
[tool.poe]
@@ -65,10 +111,9 @@ executor.type = "uv"
include = "../../shared_tasks.toml"
[tool.uv.build-backend]
module-name = "agent_framework.azure"
module-name = "agent_framework_azure"
module-root = ""
namespace = true
[build-system]
requires = ["uv_build>=0.7.19,<0.8.0"]
build-backend = "uv_build"
build-backend = "uv_build"
@@ -1,10 +1,7 @@
# Copyright (c) Microsoft. All rights reserved.
from pytest import mark
@mark.xfail(reason="Not solved")
def test_self():
def test_self_through_main():
try:
from agent_framework.azure import __version__
except ImportError:
@@ -13,20 +10,19 @@ def test_self():
assert __version__ is not None
@mark.xfail(reason="Not solved")
def test_openai():
def test_self():
try:
from agent_framework.openai import __version__
from agent_framework_azure import __version__
except ImportError:
__version__ = None
assert __version__ is not None
def test_agent_framework():
try:
from agent_framework import TextContent
from agent_framework import __version__
except ImportError:
TextContent = None
assert TextContent is not None
text = TextContent("Hello, world!")
assert text is not None
__version__ = None
assert __version__ is not None
@@ -0,0 +1,32 @@
# Copyright (c) Microsoft. All rights reserved.
import importlib
from typing import TYPE_CHECKING, Any
PACKAGE_EXTRA = "azure"
_IMPORTS = {
"__version__": "agent_framework_azure",
}
def __getattr__(name: str) -> Any:
if name in _IMPORTS:
submod_name = _IMPORTS[name]
try:
module = importlib.import_module(submod_name, package=__name__)
return getattr(module, name)
except ModuleNotFoundError as exc:
raise ModuleNotFoundError(
f"The '{PACKAGE_EXTRA}' extra is not installed, "
f"please do `pip install agent-framework[{PACKAGE_EXTRA}]`"
) from exc
raise AttributeError(f"module {__name__} has no attribute {name}")
def __dir__() -> list[str]:
return list(_IMPORTS.keys())
if TYPE_CHECKING:
from agent_framework_azure import __version__ # noqa: F401
+9 -6
View File
@@ -25,6 +25,7 @@ classifiers = [
dependencies = [
"openai>=1.94.0",
"pydantic>=2.11.7",
"pydantic-settings>=2.10.1",
"typing-extensions>=4.14.0",
]
@@ -33,9 +34,8 @@ azure = [
"agent-framework-azure"
]
[tool.uv]
prerelease = "if-necessary-or-explicit"
dev-dependencies = [
[dependency-groups]
dev = [
"pre-commit >= 3.7",
"ruff>=0.11.8",
"pytest>=8.4.1",
@@ -69,12 +69,18 @@ dev-dependencies = [
"redis",
"sphinx-autobuild",
]
[tool.uv]
prerelease = "if-necessary-or-explicit"
environments = [
"sys_platform == 'darwin'",
"sys_platform == 'linux'",
"sys_platform == 'win32'"
]
[tool.uv-dynamic-versioning]
fallback-version = "0.0.0"
[tool.pytest.ini_options]
testpaths = 'tests'
addopts = "-ra -q -r fEX"
@@ -83,9 +89,6 @@ asyncio_default_fixture_loop_scope = "function"
filterwarnings = []
timeout = 120
[tool.uv-dynamic-versioning]
fallback-version = "0.0.0"
[tool.ruff]
extend = "../../pyproject.toml"
@@ -1,18 +1,6 @@
# Copyright (c) Microsoft. All rights reserved.
from pytest import mark
@mark.xfail(reason="Not solved")
def test_openai():
try:
from agent_framework.openai import __version__
except ImportError:
__version__ = None
assert __version__ is not None
@mark.xfail(reason="Not solved")
def test_azure():
try:
from agent_framework.azure import __version__