-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathpyproject.toml
More file actions
213 lines (195 loc) · 6.16 KB
/
Copy pathpyproject.toml
File metadata and controls
213 lines (195 loc) · 6.16 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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
[project]
name = "llmwhisperer-client"
dynamic = ["version"]
description = "Client library for LLM Whisperer"
readme = "README.md"
urls = { Homepage = "https://unstract.com/llmwhisperer/", Source = "https://github.com/Zipstack/llm-whisperer-python-client" }
license = { text = "MIT" }
authors = [{ name = "Zipstack Inc", email = "devsupport@zipstack.com" }]
keywords = ["llmwhisperer tools-development-kit apps development-kit sdk"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python",
"Topic :: Software Development :: Libraries :: Python Modules",
]
requires-python = ">=3.12"
# `requests` remains a dependency for its exception classes: callers catch
# ConnectionError and Timeout by name, and the httpx equivalents are not
# subclasses of them.
# httpx is pinned to the single minor series the generated transport is written
# against: a bump has to be regenerated and re-tested, not resolved into.
dependencies = ["httpx>=0.28,<0.29", "attrs>=23.2", "requests>=2", "tenacity>=8.0"]
[dependency-groups]
test = [
"pytest>=8.2.2",
"pytest-mock>=3.14.0",
"pytest-dotenv>=0.5.2",
"pytest-cov>=5.0.0",
"pytest-md-report>=0.6.2",
]
dev = [
"docutils~=0.20.1",
"mypy~=1.2.0",
"pre-commit~=3.3.1",
"yamllint>=1.35.1",
"ruff==0.11.9",
"pytest>=8.0.1",
"pycln>=2.5.0",
"poethepoet>=0.34.0",
# Stub-only packages. Without them mypy reports the import itself as an
# error and cannot check any use of what it names.
"types-requests>=2.32",
"types-setuptools>=75",
]
[tool.poe.tasks]
test.cmd = "pytest -s -v"
test.envfile = "tests/.env"
test.help = "Runs pytests for LLM Whisperer client"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.version]
path = "src/unstract/llmwhisperer/__init__.py"
[tool.hatch.build.targets.wheel]
packages = ["src/unstract"]
#Added pyright to detect vertual environment in IDE.
[tool.pyright]
venvPath = "."
venv = ".venv"
# === Development tool configurations ===
[tool.ruff]
line-length = 120
target-version = "py312"
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
# Generated and vendored code is overwritten wholesale by its refresh
# script, so a lint finding there can never be fixed in place.
"src/unstract/llmwhisperer/_sdk_llmwhisperer",
"tests/baseline",
]
[tool.ruff.lint]
select = [
"E", # pycodestyle (formatting)
"F", # Pyflakes (static analysis)
"I", # isort (import sorting)
"B", # bugbear (security/performance)
"W", # warnings
"C90", # mccabe complexity
"N", # pep8-naming
"D", # pydocstyle
"UP", # pyupgrade
"ANN", # flake8-annotations
"TCH", # flake8-type-checking
"PYI", # flake8-pyi
]
fixable = ["ALL"]
ignore = [
"D205",
# docformatter pulls a closing quote back onto the last line and ruff moves
# it off again, so with both enabled every multi-line docstring flips on
# every run and pre-commit never converges. docformatter wins here because
# it is the one that also rewraps.
"D209",
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D104", # Missing docstring in public package
"D103", # Missing docstring in public function
"D106", # Missing docstring in public nested class
"D417", # Missing argument description in the docstring
"ANN101", # Missing type annotation for self
"ANN102", # Missing type annotation for cls
"N818",
]
[tool.ruff.lint.per-file-ignores]
# The client mirrors a service that takes and returns arbitrary JSON, and its
# published signatures say so. Narrowing these annotations would describe an API
# that is not the one callers have.
"src/unstract/llmwhisperer/client_v2.py" = ["ANN401"]
"tests/**" = ["ANN401"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
line-ending = "auto"
docstring-code-format = true
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.pycln]
all = true
expand-stars = true
no-gitignore = false
verbose = true
[tool.pyupgrade]
keep-runtime-typing = true
py39-plus = true
keep-dict-typing = true
[tool.pytest.ini_options]
python_files = ["tests.py", "test_*.py", "*_tests.py", "*_test.py"]
testpaths = ["tests"]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration (deselect with '-m \"not integration\"')",
]
[tool.mypy]
python_version = "3.12"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = false
no_implicit_optional = true
strict_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
allow_untyped_globals = false
allow_redefinition = false
local_partial_types = true
implicit_reexport = true
follow_imports = "silent"
ignore_missing_imports = true
pretty = true
show_column_numbers = true
show_error_codes = true
exclude = ["venv", ".venv", "tests/baseline/"]
# `unstract` is a namespace package: without a root to compute module names
# from, the generated tree is reachable under two names and mypy refuses to
# check either.
mypy_path = "src"
explicit_package_bases = true
# Generated code is overwritten wholesale by its refresh script, so a finding
# there can never be fixed in place. Silenced rather than excluded: excluding it
# also stops mypy resolving its types for the facade, which is where the calls
# into it -- by keyword names the spec owns -- most need checking.
[[tool.mypy.overrides]]
module = "unstract.llmwhisperer._sdk_llmwhisperer.*"
ignore_errors = true