-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathpyproject.toml
More file actions
192 lines (169 loc) · 5.54 KB
/
pyproject.toml
File metadata and controls
192 lines (169 loc) · 5.54 KB
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
[project]
name = "celeste-ai"
version = "0.10.2"
description = "Open source, type-safe primitives for multi-modal AI. All capabilities, all providers, one interface"
authors = [{name = "Kamilbenkirane", email = "kamil@withceleste.ai"}]
readme = "README.md"
license = {text = "MIT"}
requires-python = ">=3.12"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Typing :: Typed",
]
keywords = ["ai", "multimodal", "sdk", "openai", "anthropic", "claude", "gemini", "text-generation", "image-generation", "video-generation", "speech-generation", "text-embeddings"]
dependencies = [
"pydantic>=2.0",
"pydantic-settings>=2.0",
"httpx>=0.27.0",
"httpx-sse>=0.4.0",
"python-dotenv>=1.0.0",
"websockets>=15.0",
"asgiref>=3.11.0",
"filetype>=1.2.0",
]
[project.optional-dependencies]
gcp = ["google-auth[requests]>=2.0.0"]
[project.urls]
Homepage = "https://withceleste.ai"
Documentation = "https://withceleste.ai/docs"
Repository = "https://github.com/withceleste/celeste-python"
Issues = "https://github.com/withceleste/celeste-python/issues"
[dependency-groups]
dev = [
"pytest>=8.0",
"pytest-cov>=7.0",
"pytest-asyncio>=1.2.0",
"pytest-xdist>=3.0.0",
"ruff>=0.8.0",
"mypy>=1.13.0",
"bandit[toml]>=1.7.5",
"pre-commit>=3.5.0",
"pytest-rerunfailures>=16.1",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/celeste"]
[tool.pytest.ini_options]
minversion = "8.0"
testpaths = ["tests"]
addopts = "-ra --strict-markers --strict-config"
asyncio_mode = "auto"
pythonpath = ["src"]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"smoke: quick checks for critical paths",
"integration: marks tests as integration tests (require API keys)",
]
[tool.coverage.run]
branch = true
# dynamic_context handled by pytest-cov's --cov-context option
omit = [
# Provider/protocol implementations (tested via integration tests, not unit tests)
"src/celeste/providers/*",
"src/celeste/protocols/*",
"src/celeste/modalities/*",
"src/celeste/namespaces/*"
]
[tool.coverage.report]
show_missing = true
fail_under = 80
[tool.ruff]
# Same as Black's default
line-length = 88
target-version = "py312"
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"F", # Pyflakes (unused imports, undefined names)
"I", # isort (import sorting)
"UP", # pyupgrade (upgrade syntax for newer Python)
"B", # flake8-bugbear (catches common bugs)
"SIM", # flake8-simplify (code simplification)
"RUF", # Ruff-specific rules
"ANN", # flake8-annotations (enforce type annotations)
"A", # flake8-builtins (prevent shadowing builtins)
]
ignore = [
"E501", # Line too long - trust formatter's judgment
"SIM108", # Use ternary operator instead of if-else-block (sometimes less readable)
]
fixable = ["ALL"]
unfixable = []
[tool.ruff.format]
# Match Black's style
quote-style = "double"
indent-style = "space"
docstring-code-format = true
[tool.ruff.lint.isort]
known-first-party = ["celeste"]
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["D"] # No docstrings required in tests
"**/client.py" = ["ANN401"] # Allow Any return types in mixin client classes
[tool.mypy]
python_version = "3.12"
mypy_path = "src"
# Strict type checking for production code
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true # Require type hints
disallow_any_unimported = true
disallow_incomplete_defs = true
check_untyped_defs = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
strict_equality = true
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false # Relax for tests
disallow_incomplete_defs = false
disable_error_code = ["override", "return-value", "arg-type", "call-arg", "assignment", "no-any-return", "attr-defined", "unused-ignore"]
[[tool.mypy.overrides]]
module = "httpx"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "httpx_sse"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "websockets.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "filetype"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "google.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = [
"celeste.modalities.text.client",
"celeste.modalities.text.streaming",
"celeste.modalities.text.providers.*",
"celeste.modalities.images.client",
"celeste.modalities.images.streaming",
"celeste.modalities.images.providers.*",
"celeste.modalities.videos.client",
"celeste.modalities.videos.providers.*",
"celeste.modalities.audio.client",
"celeste.modalities.audio.streaming",
"celeste.modalities.audio.providers.*",
"celeste.modalities.embeddings.client",
"celeste.modalities.embeddings.providers.*",
"celeste.providers.*.client",
"celeste.providers.*.*",
"celeste.namespaces.domains",
]
disable_error_code = ["override", "return-value", "arg-type", "call-arg", "assignment", "no-any-return", "attr-defined"]
[tool.bandit]
exclude_dirs = [".venv", "__pycache__"]
skips = ["B101"] # Skip B101 (assert_used) since we use pytest
[tool.bandit.assert_used]
skips = ["*/test_*.py", "*_test.py"] # Allow assertions in test files