-
Notifications
You must be signed in to change notification settings - Fork 96
Expand file tree
/
Copy pathpyproject.toml
More file actions
198 lines (176 loc) · 5.11 KB
/
pyproject.toml
File metadata and controls
198 lines (176 loc) · 5.11 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
193
194
195
196
197
198
[build-system]
requires = ["hatchling", "hatch-fancy-pypi-readme"]
build-backend = "hatchling.build"
[project]
name = "xai-sdk"
dynamic = ["readme", "version"]
description = "The official Python SDK for the xAI API"
license = "Apache-2.0"
authors = [{ name = "xAI", email = "support@x.ai" }]
dependencies = [
"grpcio>=1.72.1,<2",
"protobuf>=5.29.4,<7",
"googleapis-common-protos>=1.65.0,<2",
"pydantic>=2.5.3,<3",
"requests>=2.31.0,<3",
"aiohttp>=3.8.6,<4",
"packaging>=25.0,<26",
"opentelemetry-sdk>=1.36.0,<2",
]
requires-python = ">=3.10"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Typing :: Typed",
]
[project.urls]
Homepage = "https://github.com/xai-org/xai-sdk-python"
Documentation = "https://docs.x.ai"
Repository = "https://github.com/xai-org/xai-sdk-python"
[project.optional-dependencies]
telemetry-http = ["opentelemetry-exporter-otlp-proto-http>=1.36.0,<2"]
telemetry-grpc = ["opentelemetry-exporter-otlp-proto-grpc>=1.36.0,<2"]
[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true
[tool.hatch.version]
path = "src/xai_sdk/__about__.py"
# hatch respects .gitignore and will ignore all files that the .gitignore file specifies by default
[tool.hatch.build.targets.sdist]
exclude = [".github", ".gitleaks.toml", ".pre-commit-config.yaml"]
[tool.hatch.build.targets.wheel]
packages = ["src/xai_sdk"]
[tool.hatch.metadata.hooks.fancy-pypi-readme]
content-type = "text/markdown"
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
path = "README.md"
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)'
replacement = '[\1](https://github.com/xai-org/xai-sdk-python/tree/main\g<2>)'
[tool.ruff]
exclude = ["src/xai_sdk/proto"]
target-version = "py310"
line-length = 120
[tool.ruff.lint]
select = [
"A",
"ARG",
"B",
"C",
"D",
"DTZ",
"E",
"EM",
"F",
"FBT",
"I",
"ICN",
"ISC",
"N",
"PLC",
"PLE",
"PLR",
"PLW",
"Q",
"RUF",
"S",
"T",
"TID",
"UP",
"W",
"YTT",
]
ignore = [
"D100", # Allow missing docstring in top level module
"D104", # Allow missing docstring in public package
"D105", # Allow missing docstring in magic method
"D203", # Allow docstring directly below class definition (as enforced by D211)
"D213", # Allow multi-line-summary on first line of docstring (as enforced by D212)
"D401", # Allow non imperative mood in docstring
"D413", # Allow no new line at end of docstring.
"EM101", # Allow `raise ValueError(msg)`
"EM102", # Allow f strings in `raise` statements
"FBT003", # Allow boolean positional values in function calls, like `dict.get(... True)`
"TID252", # Allow relative imports
"UP007", # Allow `from typing import Optional` instead of `X | None`
"UP035", # Allow `from typing import Optional` instead of `X | None`
"UP045", # Allow `from typing import Sequence` instead of `Sequence[X]`
"PLR0913",
]
unfixable = ["F401"]
[tool.ruff.lint.isort]
known-first-party = ["xai_sdk"]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.per-file-ignores]
"tests/**/*" = [
"D",
"DTZ005",
"PLR0911",
"PLR0912",
"PLR0915",
"PLR2004",
"S101",
"S105",
"S106",
"S107",
"TID252",
]
"examples/**/*" = ["D", "S101", "T201"]
[tool.coverage.run]
source_pkgs = ["src/xai_sdk", "tests"]
branch = true
parallel = true
omit = ["src/xai_sdk/__about__.py", "src/xai_sdk/proto"]
[tool.coverage.paths]
xai = ["src/xai_sdk"]
tests = ["test"]
[tool.coverage.report]
exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"]
[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "strict"
asyncio_default_fixture_loop_scope = "session"
asyncio_default_test_loop_scope = "session"
[tool.pyright]
pythonversion = "3.10"
include = ["src/xai_sdk", "tests", "examples"]
exclude = ["src/xai_sdk/proto"]
venvPath = ".venv"
typeCheckingMode = "basic"
[dependency-groups]
dev = [
"absl-py>=2.2.2",
"grpcio-tools>=1.71.0",
"hatch>=1.14.1",
"packaging>=25.0",
"portpicker>=1.6.0",
"pre-commit>=4.2.0",
"pyright==1.1.400",
"pytest>=7.4.4",
"pytest-asyncio>=0.21.2",
"pytest-cov>=6.1.1",
"pytest-repeat>=0.9.4",
"pytest-xdist>=3.6.1",
"ruff>=0.11.7",
"tqdm>=4.67.1",
]