-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
268 lines (247 loc) · 6.03 KB
/
Copy pathpyproject.toml
File metadata and controls
268 lines (247 loc) · 6.03 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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "nustack-py"
version = "0.1.17"
description = "The interaction primitive. Build apps in one primitive that spans your whole stack (databases, UIs, AI agents, and services). No glue. 50x less code."
readme = "README.md"
license = "Apache-2.0"
authors = [{ name = "Gor Arakelyan", email = "gorarkln@gmail.com" }]
requires-python = ">=3.10"
dependencies = [
"typing-extensions>=4.7.0",
"click>=8.0",
"rich>=10.7",
"rich-click>=1.6",
]
keywords = [
"nu",
"nustack",
"python",
"state-management",
"distributed-systems",
"ai-agents",
"agentic",
"ray",
"llm",
"database",
"key-value-store",
"rocksdb",
"ui",
"real-time",
"observability",
]
classifiers = [
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
# One extra per fabric; name matches the `nu.<fabric>` import path.
[project.optional-dependencies]
kv = [
"virtuals-py>=0.1.2",
]
mem = [
"janus>=2.0.0",
]
ui = [
"fastapi>=0.115.0",
"uvicorn[standard]>=0.30.0",
"msgpack>=1.1.2",
"watchfiles>=0.24.0",
"nudle>=0.1.1",
]
ray = [
"ray>=2.50; sys_platform != 'darwin' or platform_machine == 'arm64'",
"ray>=2.0,<2.50; sys_platform == 'darwin' and platform_machine != 'arm64'",
]
proxy = [
"invisibles-py",
]
http = [
"httpx>=0.27",
]
cc = [
"claude-agent-sdk>=0.1.0",
]
all = [
"nustack-py[kv]",
"nustack-py[mem]",
"nustack-py[ui]",
"nustack-py[ray]",
"nustack-py[proxy]",
"nustack-py[http]",
"nustack-py[cc]",
"virtuals-py[rocksdb]>=0.1.2",
]
[project.urls]
Repository = "https://github.com/nustackdev/nu"
[project.scripts]
nu = "nu._cli:main"
[tool.hatch.build.targets.wheel]
packages = ["src/nu"]
exclude = [
"src/nu/ui/web/**",
]
[tool.hatch.build.targets.sdist]
exclude = [
"src/nu/ui/**/node_modules",
"src/nu/ui/**/dist",
]
[tool.uv.sources]
nudle = { path = "./src/nu/ui/web/nudle", editable = true }
[tool.uv]
default-groups = ["dev"]
[dependency-groups]
dev = [
"ruff>=0.8.0",
"pre-commit>=3.0.0",
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
"pytest-xdist>=3.0.0",
"pytest-timeout>=2.1.0",
"pytest-benchmark>=4.0.0",
"hypothesis>=6.0.0",
"pytest-asyncio>=1.3.0",
]
[tool.pytest.ini_options]
testpaths = [
"tests",
]
# Underscore prefix on `_support` keeps pytest from auto-collecting it as tests.
pythonpath = [
"tests/nu",
]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = ["-ra", "--strict-markers", "--strict-config", "--import-mode=importlib"]
asyncio_mode = "auto"
xfail_strict = true
markers = [
"slow: marks tests as slow",
"integration: marks tests as integration tests",
"inmemory: storage-backend parametrization — in-memory tkv",
"rocksdb: storage-backend parametrization — rocksdb tkv",
"lmdb: storage-backend parametrization — lmdb tkv",
"text: storage-backend parametrization — text/debug tkv",
]
[tool.coverage.run]
source = [
"src/nu",
]
omit = ["*/tests/*", "*/__pycache__/*"]
branch = true
parallel = true
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"def __str__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"if typing.TYPE_CHECKING:",
"@abstractmethod",
"@abc.abstractmethod",
]
precision = 2
show_missing = true
skip_covered = true
[tool.coverage.html]
directory = "reports/coverage"
[tool.ruff]
line-length = 100
target-version = "py310"
src = [
"src",
]
extend-exclude = [".venv", "build", "dist", "*.egg-info"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"N", # pep8-naming
"YTT", # flake8-2020
"S", # flake8-bandit (security)
"T20", # flake8-print
"D", # pydocstyle
"ANN", # flake8-annotations
"TC", # flake8-type-checking
"RUF", # ruff-specific rules
"PTH", # flake8-pathlib
]
ignore = [
"E501", # handled by formatter
"D105", # docstring in magic method
"D107", # docstring in __init__ (covered by class docstring)
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.per-file-ignores]
"**/tests/**/*.py" = [
"S101", "S108", "T20", "D", "E711", "E712", "ANN", "N806",
]
"**/testing/**/*.py" = [
"S101", "T20", "D", "E711", "E712", "ANN", "N806", "B017",
]
"examples/**/*.py" = [
"S101", "T20", "D", "ANN",
]
"benchmarks/**/*.py" = [
"S101", "T20", "D", "ANN", "B007",
]
"**/ops/control/**/*.py" = [
"ANN401", # Any needed for polymorphic control op parameters
]
"**/refs/std.py" = [
"N811", "N812", # std Forms (UUID, date, ...) aliased as *Form to not shadow stdlib types
]
"src/nu/ui/core/**/*.py" = [
"D102", "D103",
"ANN401", # _acompile athunks legitimately return Any (host-lifted primitive)
]
"src/nu/ui/refs/**/*.py" = [
"D102", # widget setters are one-liners; docstring per method is ceremony
"ANN401",
]
"src/nu/ui/nudle/**/*.py" = [
"D102", "D103", "D205", "ANN401", "S110",
]
"src/nu/http/methods.py" = [
"N802", # GET/POST/PUT/PATCH/DELETE mirror HTTP verbs
]
[tool.ruff.lint.isort]
known-first-party = [
"nu",
"virtuals", "invisibles",
]
force-single-line = false
lines-after-imports = 2
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
[tool.mypy]
python_version = "3.10"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = false
ignore_missing_imports = true
exclude = [
"build/",
"dist/",
".venv/",
]
[tool.bandit]
exclude_dirs = ["examples/"]