-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpyproject.toml
More file actions
240 lines (218 loc) · 6.91 KB
/
pyproject.toml
File metadata and controls
240 lines (218 loc) · 6.91 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
[project]
name = "zndraw"
dynamic = ["version"]
description = "ZnDraw - Interactive visualization for atomistic simulations"
license = { file = "LICENSE" }
authors = [
{ name = "Fabian Zills", email = "fzills@icp.uni-stuttgart.de" },
{ name = "Rokas Elijošius", email = "re344@cam.ac.uk" },
{ name = "Paul Hohenberger"},
]
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"argon2-cffi>=25.1.0",
"ase>=3.27.0",
"asebytes[h5,lmdb]>=0.3.1",
"fakeredis>=2.33.0",
"fastapi>=0.128.0",
"httpx>=0.28.0",
"msgpack>=1.0.0",
"msgpack-numpy>=0.4.8",
"networkx>=3.6.1",
"pydantic-settings>=2.3.0",
"pyjwt>=2.10.1",
"python-multipart>=0.0.18",
"python-socketio[asyncio_client,client]>=5.16.0",
"redis>=7.1.0",
"scipy>=1.12.0",
"scikit-image>=0.24.0",
"requests>=2.32.5",
"splines>=0.3.3",
"sqlalchemy[asyncio, aiosqlite]>=2.0.46",
"sqlmodel>=0.0.31",
"typer>=0.21.1",
"uvicorn>=0.40.0",
"vesin>=0.4.2",
"fastapi-users[sqlalchemy]>=14.0.0",
"taskiq>=0.12.1",
"taskiq-redis>=1.2.2",
"zndraw-socketio>=0.1.6",
"pandas>=2.0.0",
"plotly>=6.5.2",
"rich>=14.3.1",
"molify>=0.2.2",
"tqdm>=4.67.3",
]
[project.scripts]
zndraw = "zndraw.cli:app"
zndraw-cli = "zndraw.cli_agent:app"
zndraw-db = "zndraw.cli:db_app"
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[tool.hatch.version]
source = "vcs"
fallback-version = "0.0.0-dev"
[tool.hatch.build.hooks.vcs]
version-file = "src/zndraw/_version.py"
[tool.hatch.build.hooks.custom]
[tool.hatch.build.targets.wheel]
packages = ["src/zndraw", "src/zndraw_auth", "src/zndraw_joblib"]
artifacts = ["src/zndraw/static/"]
exclude = [
"**/node_modules",
"**/__pycache__",
"**/*.pyc",
"**/.DS_Store",
"app/node_modules",
"dist",
".git",
".vscode",
".claude",
]
[project.optional-dependencies]
mongodb = ["asebytes[mongodb]>=0.3.1"]
postgres = ["asyncpg>=0.31.0"]
full = ["molify>=0.2.2"]
gif = ["Pillow>=10.0.0"]
[dependency-groups]
dev = [
"fsspec>=2023",
"httpx>=0.28.0",
"ipykernel>=7.1.0",
"numpy>=2.4.1",
"playwright>=1.55.0",
"pyright>=1.1.408",
"pyscf>=2.12.1",
"pytest>=9.0.2",
"pytest-asyncio>=1.3.0",
"pytest-cov>=7.0.0",
"ruff>=0.14.14",
]
docs = [
"furo>=2025.9.25",
"nbsphinx>=0.9.8",
"sphinx>=8.2.3",
"sphinx-copybutton>=0.5.2",
"sphinx-design>=0.6.0",
"sphinxcontrib-mermaid>=1.2.3",
]
[tool.ruff]
target-version = "py311"
line-length = 88
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"ASYNC", # flake8-async
"S", # flake8-bandit (security)
"SIM", # flake8-simplify
"RUF", # Ruff-specific rules
"PT", # flake8-pytest-style
"PERF", # perflint (performance)
"TCH", # flake8-type-checking
"FA", # flake8-future-annotations
"FAST", # FastAPI-specific rules
"PIE", # flake8-pie (misc lints)
"ARG", # flake8-unused-arguments
"PTH", # flake8-use-pathlib
"RET", # flake8-return
"RSE", # flake8-raise
"TRY", # tryceratops (exception handling)
"FLY", # flynt (f-string conversion)
"LOG", # flake8-logging
"DTZ", # flake8-datetimez (timezone aware datetimes)
"ISC", # flake8-implicit-str-concat
"ICN", # flake8-import-conventions
"PGH", # pygrep-hooks
"FBT", # flake8-boolean-trap
"A", # flake8-builtins
"COM", # flake8-commas
"EM", # flake8-errmsg
"G", # flake8-logging-format
"INP", # flake8-no-pep420
"Q", # flake8-quotes
"T20", # flake8-print
"SLF", # flake8-self
"SLOT", # flake8-slots
"TID", # flake8-tidy-imports
"BLE", # flake8-blind-except
"N", # pep8-naming
]
ignore = [
"S101", # assert used (needed for pytest)
"S104", # binding to 0.0.0.0 (expected for servers)
"S105", # hardcoded password (false positive for token literals in tests)
"S106", # hardcoded password (false positive for token_type="bearer")
"S108", # insecure temp file (false positive for test fixtures)
"TRY003", # avoid long messages outside exception class (too strict)
"EM101", # raw string in exception (allow for simplicity)
"EM102", # f-string in exception (allow for simplicity)
"FBT001", # boolean positional arg (common in FastAPI)
"FBT002", # boolean default arg (common in FastAPI)
"FBT003", # boolean positional value (third-party APIs: typer, ASE)
"COM812", # trailing comma missing (conflicts with formatter)
"ISC001", # implicit string concat (conflicts with formatter)
]
fixable = ["ALL"]
unfixable = [
"T20", # print statements - require manual review
"F841", # unused variables - might be intentional
]
[tool.ruff.lint.flake8-bugbear]
extend-immutable-calls = ["fastapi.Depends", "fastapi.Query", "fastapi.Path", "fastapi.Body"]
[tool.ruff.lint.flake8-type-checking]
runtime-evaluated-decorators = ["pydantic.validate_call"]
runtime-evaluated-base-classes = ["pydantic.BaseModel", "sqlmodel.SQLModel"]
[tool.ruff.lint.isort]
known-first-party = ["zndraw", "zndraw_auth", "zndraw_joblib"]
combine-as-imports = true
[tool.ruff.lint.pep8-naming]
classmethod-decorators = ["pydantic.validator", "pydantic.root_validator"]
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false
[tool.ruff.lint.pylint]
max-args = 10 # Allow up to 10 args for FastAPI endpoints
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = [
"ARG001", # unused function argument (fixtures)
"S106", # hardcoded password in tests
"S105", # hardcoded password string in tests
"PLR2004", # magic values in tests are OK
"INP001", # tests don't need __init__.py
"N803", # fixture names matching class names (e.g. Echo)
"SLF001", # accessing internals for testing
]
"docs/**/*.py" = [
"INP001", # docs don't need __init__.py
"A001", # copyright shadows builtin (Sphinx convention)
]
"hatch_build.py" = [
"ARG002", # unused args (framework interface)
]
"__init__.py" = [
"F401", # unused imports in __init__.py (re-exports)
]
[tool.pytest.ini_options]
testpaths = ["tests/zndraw", "tests/zndraw_auth", "tests/zndraw_joblib"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
markers = ["integration: marks tests as integration tests (require running server)"]
filterwarnings = [
'error:[\s\S]*You probably want to use .session\.exec:DeprecationWarning',
'ignore::DeprecationWarning:fastapi_users_db_sqlalchemy',
]
[tool.codespell]
skip = "frontend/bun.lock,docs/source/_static/*.svg,.planning/*"
ignore-words-list = "nd,trough"
[tool.uv.sources]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"