-
Notifications
You must be signed in to change notification settings - Fork 107
/
pyproject.toml
141 lines (126 loc) · 3.6 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
[project]
name = "magentic"
version = "0.34.1"
description = "Seamlessly integrate LLMs as Python functions"
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
"filetype>=1.2.0",
"logfire-api>=0.1.0",
"openai>=1.40.0",
"pydantic>=2.7.0",
"pydantic-settings>=2.0.0",
]
[project.optional-dependencies]
anthropic = ["anthropic>=0.27.0"]
litellm = ["litellm>=1.41.12"]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[dependency-groups]
dev = [
"anthropic",
"inline-snapshot>=0.14.0",
"litellm",
"logfire>=0.46.1,<0.50.0",
"mypy",
"pytest>=7.0.0",
"pytest-asyncio>=0.18.0",
"pytest-clarity>=0.1.0",
"pytest-cov>=4.0.0",
"python-dotenv>=1.0.1",
"ruff>=0.3",
"pytest-recording>=0.13.2",
"coverage>=7.6.4",
"pytest-mock>=3.14.0",
"vcrpy>=6.0.2",
"pydeps>=2.0.1",
]
docs = [
"blacken-docs>=1.16.0",
"mkdocs>=1.5.3",
"mkdocs-glightbox>=0.4.0",
"mkdocs-jupyter>=0.24.6",
"mkdocs-material>=9.5.11",
]
examples = ["ghapi>=1.0.5", "jupyter", "pandas>=2.2.1"]
[tool.coverage.report]
skip_covered = "true"
show_missing = "true"
[tool.mypy]
check_untyped_defs = true
disable_error_code = ["empty-body"]
disallow_untyped_defs = false
strict = true
[[tool.mypy.overrides]]
module = [
"filetype",
"litellm",
"litellm.utils",
"litellm.integrations.custom_logger",
"vcr.*",
]
ignore_missing_imports = true
[tool.pyright]
venvPath = "."
venv = ".venv"
[tool.pytest.ini_options]
addopts = "--block-network --cov-report=html --cov-report=term --cov=magentic"
asyncio_default_fixture_loop_scope = "function"
asyncio_mode = "auto"
markers = [
"anthropic: Tests that query the Anthropic API. Requires the ANTHROPIC_API_KEY environment variable to be set.",
"litellm_anthropic: Tests that query the Anthropic API via litellm. Requires the ANTHROPIC_API_KEY environment variable to be set.",
"litellm_ollama: Tests that query Ollama via litellm. Requires ollama to be installed and running on localhost:11434.",
"litellm_openai: Tests that query the OpenAI API via litellm. Requires the OPENAI_API_KEY environment variable to be set.",
"mistral: Tests that query the Mistral API (via openai). Requires the MISTRAL_API_KEY environment variable to be set.",
"openai: Tests that query the OpenAI API. Requires the OPENAI_API_KEY environment variable to be set.",
"openai_ollama: Tests that query Ollama via openai. Requires ollama to be installed and running on localhost:11434.",
]
[tool.ruff]
include = ["*.py", "*.pyi", "**/pyproject.toml", "*.ipynb"]
[tool.ruff.format]
docstring-code-format = true # TODO: replace blacken-docs
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"C90", # mccabe
"D", # pydocstyle
"ANN", # flake8-annotations
"A", # flake8-builtins
"COM", # flake8-commas
"FA", # flake8-future-annotations
"INP", # flake8-no-pep420
"PIE790", # flake8-pie: Unnecessary `...` literal
"SLF", # flake8-self
"ARG", # flake8-unused-arguments
"TD", # flake8-todos
"FIX", # flake8-fixme
"PL", # Pylint
"S101", # assert
# Compatibility with ruff formatter
"E501",
"ISC001",
"Q000",
"Q001",
"Q002",
"Q003",
"W191",
]
[tool.ruff.lint.flake8-pytest-style]
mark-parentheses = false
[tool.ruff.lint.isort]
known-first-party = ["magentic"]
split-on-trailing-comma = false
[tool.ruff.lint.per-file-ignores]
"docs/examples/*" = [
"T20", # flake8-print
]
"examples/*" = [
"T20", # flake8-print
]
"tests/*" = [
"S", # flake8-bandit
]
[tool.uv]
default-groups = ["dev", "docs"]