mirror of
https://github.com/microsoft/autogen.git
synced 2025-12-30 00:30:23 +00:00
* Add token counting to chat completion client * fix mypy * ignore pyright for object type * format
172 lines
3.7 KiB
TOML
172 lines
3.7 KiB
TOML
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[project]
|
|
name = "agnext"
|
|
version = "0.0.1"
|
|
description = "A small example package"
|
|
readme = "README.md"
|
|
requires-python = ">=3.10"
|
|
classifiers = [
|
|
"Programming Language :: Python :: 3",
|
|
"License :: OSI Approved :: MIT License",
|
|
"Operating System :: OS Independent",
|
|
]
|
|
dependencies = [
|
|
"openai>=1.3",
|
|
"pillow",
|
|
"aiohttp",
|
|
"typing-extensions",
|
|
"pydantic>=1.10,<3",
|
|
"types-aiofiles",
|
|
"grpcio",
|
|
"protobuf",
|
|
"tiktoken"
|
|
]
|
|
|
|
[tool.hatch.envs.default]
|
|
installer = "uv"
|
|
dependencies = [
|
|
"pyright==1.1.368",
|
|
"mypy==1.10.0",
|
|
"ruff==0.4.8",
|
|
"tiktoken",
|
|
"types-Pillow",
|
|
"polars",
|
|
"chess",
|
|
"tavily-python",
|
|
"aiofiles",
|
|
"types-aiofiles",
|
|
"colorama",
|
|
"textual",
|
|
"textual-dev",
|
|
"textual-imageview",
|
|
"pytest-asyncio",
|
|
"pip",
|
|
"pytest",
|
|
"pytest-xdist",
|
|
"pytest-mock",
|
|
"grpcio-tools",
|
|
"markdownify",
|
|
"types-protobuf",
|
|
"python-dotenv"
|
|
]
|
|
|
|
[tool.hatch.envs.default.extra-scripts]
|
|
pip = "{env:HATCH_UV} pip {args}"
|
|
|
|
[tool.hatch.envs.default.scripts]
|
|
fmt = "ruff format"
|
|
lint = "ruff check"
|
|
test = "pytest -n auto"
|
|
check = [
|
|
"ruff format",
|
|
"ruff check --fix",
|
|
"pyright",
|
|
"mypy --non-interactive --install-types",
|
|
"pytest -n auto",
|
|
]
|
|
|
|
[tool.hatch.envs.test-matrix]
|
|
template = "default"
|
|
|
|
[[tool.hatch.envs.test-matrix.matrix]]
|
|
python = ["3.10", "3.11", "3.12"]
|
|
|
|
[tool.hatch.envs.docs]
|
|
dependencies = [
|
|
"sphinx",
|
|
"furo",
|
|
"sphinxcontrib-apidoc",
|
|
"myst-parser",
|
|
"sphinx-autobuild",
|
|
]
|
|
|
|
[tool.hatch.envs.docs.scripts]
|
|
build = "sphinx-build docs/src docs/build"
|
|
serve = "sphinx-autobuild --watch src docs/src docs/build"
|
|
check = "sphinx-build --fail-on-warning docs/src docs/build"
|
|
|
|
# Benchmark environments
|
|
[tool.hatch.envs.bench-humaneval-teamone]
|
|
installer = "uv"
|
|
detached = true
|
|
dependencies = [
|
|
"agnext@{root:uri}",
|
|
"agbench@{root:uri}/tools/agbench",
|
|
"team-one@{root:uri}/teams/team-one",
|
|
]
|
|
|
|
[tool.hatch.envs.bench-humaneval-twoagents]
|
|
installer = "uv"
|
|
detached = true
|
|
dependencies = [
|
|
"agnext@{root:uri}",
|
|
"agbench@{root:uri}/tools/agbench",
|
|
]
|
|
|
|
[tool.ruff]
|
|
line-length = 120
|
|
fix = true
|
|
exclude = ["build", "dist", "src/agnext/worker/protos"]
|
|
target-version = "py310"
|
|
include = ["src/**", "samples/*.py"]
|
|
|
|
[tool.ruff.format]
|
|
docstring-code-format = true
|
|
|
|
[tool.ruff.lint]
|
|
select = ["E", "F", "W", "B", "Q", "I", "ASYNC"]
|
|
ignore = ["F401", "E501"]
|
|
|
|
[tool.ruff.lint.flake8-tidy-imports]
|
|
[tool.ruff.lint.flake8-tidy-imports.banned-api]
|
|
"unittest".msg = "Use `pytest` instead."
|
|
|
|
[tool.mypy]
|
|
files = ["src", "samples", "tests"]
|
|
exclude = ["src/agnext/worker/protos"]
|
|
|
|
strict = true
|
|
python_version = "3.10"
|
|
ignore_missing_imports = true
|
|
|
|
# from https://blog.wolt.com/engineering/2021/09/30/professional-grade-mypy-configuration/
|
|
disallow_untyped_defs = true
|
|
no_implicit_optional = true
|
|
check_untyped_defs = true
|
|
warn_return_any = true
|
|
show_error_codes = true
|
|
warn_unused_ignores = false
|
|
|
|
disallow_incomplete_defs = true
|
|
disallow_untyped_decorators = true
|
|
disallow_any_unimported = true
|
|
|
|
[tool.pyright]
|
|
include = ["src", "tests", "samples"]
|
|
typeCheckingMode = "strict"
|
|
reportUnnecessaryIsInstance = false
|
|
reportMissingTypeStubs = false
|
|
exclude = ["src/agnext/worker/protos"]
|
|
|
|
[tool.pytest.ini_options]
|
|
minversion = "6.0"
|
|
testpaths = ["tests"]
|
|
|
|
[tool.hatch.build.hooks.protobuf]
|
|
dependencies = ["hatch-protobuf", "mypy-protobuf~=3.0"]
|
|
generate_pyi = false
|
|
proto_paths = ["../protos"]
|
|
output_path = "src/agnext/worker/protos"
|
|
|
|
|
|
[[tool.hatch.build.hooks.protobuf.generators]]
|
|
name = "mypy"
|
|
outputs = ["{proto_path}/{proto_name}_pb2.pyi"]
|
|
|
|
[[tool.hatch.build.hooks.protobuf.generators]]
|
|
name = "mypy_grpc"
|
|
outputs = ["{proto_path}/{proto_name}_pb2_grpc.pyi"]
|