-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathpyproject.toml
More file actions
560 lines (524 loc) ยท 16.4 KB
/
Copy pathpyproject.toml
File metadata and controls
560 lines (524 loc) ยท 16.4 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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
[project]
name = "reflex"
dynamic = ["version"]
description = "Web apps in pure Python."
license.text = "Apache-2.0"
authors = [
{ name = "Nikhil Rao" },
{ name = "Alek Petuskey" },
{ name = "Masen Furer" },
{ name = "Elijah Ahianyo" },
{ name = "Thomas Brandeho" },
{ name = "Khaleel Al-Adhami" },
]
maintainers = [
{ name = "Masen Furer" },
{ name = "Khaleel Al-Adhami" },
{ email = "maintainers@reflex.dev" },
]
readme = "README.md"
keywords = ["web", "framework"]
requires-python = ">=3.10,<4.0"
dependencies = [
"click >=8.2",
"granian[reload] >=2.7.4",
"httpx >=0.26,<1.0",
"packaging >=24.2,<27",
"psutil >=7.0.0,<8.0; sys_platform == 'win32'",
"python-multipart >=0.0.32,<1.0",
"python-socketio >=5.12.0,<6.0",
"redis >=6.4,<8.0",
"rich >=13,<16",
"starlette >=1.3.1",
"typing_extensions >=4.13.0",
"wrapt >=1.17.0,<2.4",
"reflex-base >= 0.9.12.dev0",
"reflex-components-code >= 0.9.0",
"reflex-components-core >= 0.9.6",
"reflex-components-dataeditor >= 0.9.0",
"reflex-components-gridjs >= 0.9.0",
"reflex-components-lucide >= 0.9.0",
"reflex-components-markdown >= 0.9.0",
"reflex-components-moment >= 0.9.4",
"reflex-components-plotly >= 0.9.0",
"reflex-components-radix >= 0.9.9",
"reflex-components-react-player >= 0.9.0",
"reflex-components-recharts >= 0.9.0",
"reflex-components-sonner >= 0.9.0",
"reflex-hosting-cli >= 0.1.71",
]
classifiers = [
"Development Status :: 4 - Beta",
"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",
"Programming Language :: Python :: 3.14",
]
[project.optional-dependencies]
db = [
"alembic >=1.15.2,<2.0",
"pydantic >=2.12.0,<3.0",
"sqlmodel >=0.0.24,<0.1",
]
pydantic = ["reflex-base[pydantic]"]
testing = [
"psutil >=7.0.0,<8.0",
"selenium >=4.0.0,<5.0",
"uvicorn >=0.34.0,<1.0",
]
[project.urls]
homepage = "https://reflex.dev"
repository = "https://github.com/reflex-dev/reflex"
documentation = "https://reflex.dev/docs/getting-started/introduction"
[project.scripts]
reflex = "reflex.reflex:cli"
[dependency-groups]
dev = [
"alembic",
"asynctest",
"codespell",
"darglint",
"dill",
"fastapi",
"hatchling",
"libsass",
"numpy",
"opentelemetry-sdk",
"pandas",
"pillow",
"playwright",
"plotly",
"pre-commit",
"psutil",
# No cp315 psycopg-binary wheels yet; use pure-python psycopg on 3.15+.
# This only affects dev/test environments (3.15 CI), not the published
# package. TODO: revert to a single "psycopg[binary]" once a psycopg
# release ships cp315 wheels for psycopg-binary.
"psycopg[binary]; python_version < '3.15'",
"psycopg; python_version >= '3.15'",
"pydantic",
"pyright",
"pytest-asyncio",
"pytest-benchmark",
"pytest-codspeed",
"pytest-cov",
"pytest-mock",
"pytest-playwright",
"pytest-rerunfailures",
"pytest-split",
"pytest",
"python-dotenv",
"pyyaml",
"reflex-docgen",
"reflex-otel",
"reflex-release",
"reflex-build-sdk[aiohttp,httpx,httpx2]",
"reflex-site-shared",
"ruff",
"selenium",
"sqlalchemy",
"sqlmodel",
"starlette-admin",
"toml",
"towncrier",
"ty",
"typer",
"uvicorn",
]
[build-system]
requires = ["hatchling", "uv-dynamic-versioning"]
build-backend = "hatchling.build"
[tool.hatch.version]
source = "uv-dynamic-versioning"
[tool.uv-dynamic-versioning]
fallback-version = "0.0.0dev0"
[tool.hatch.build]
# Leading slashes anchor to the repo root; unanchored patterns match nested
# directories under packages/ too.
include = ["/reflex"]
# Include uncommitted pyi stubs generated for this package.
artifacts = ["/reflex/**/*.pyi"]
# The build hook is only needed to build the wheel from the sdist.
targets.sdist.include = ["/reflex", "/scripts/hatch_build.py"]
[tool.hatch.build.hooks.custom]
path = "scripts/hatch_build.py"
dependencies = ["plotly", "ruff"]
require-runtime-dependencies = true
[tool.pyright]
extraPaths = [
"packages/reflex-code/src",
"packages/reflex-components/src",
"packages/reflex-dataeditor/src",
"packages/reflex-gridjs/src",
"packages/reflex-lucide/src",
"packages/reflex-markdown/src",
"packages/reflex-moment/src",
"packages/reflex-plotly/src",
"packages/reflex-radix/src",
"packages/reflex-release/src",
"packages/reflex-react-player/src",
"packages/reflex-react-router/src",
"packages/reflex-recharts/src",
"packages/reflex-sonner/src",
"packages/reflex-components-internal/src",
"packages/reflex-otel/src",
"packages/reflex-build-sdk/src",
"packages/reflex-site-shared/src",
"packages/integrations-docs/src",
]
exclude = [
".venv",
"**/__pycache__",
"**/.*",
"**/.templates",
"**/node_modules",
"docs",
"packages/reflex-site-shared",
"packages/integrations-docs",
"packages/reflex-ui-shared",
]
reportIncompatibleMethodOverride = false
[tool.ruff]
target-version = "py310"
output-format = "concise"
extend-exclude = ["tests/units/reflex_base/utils/pyi_generator/golden"]
lint.isort.split-on-trailing-comma = false
lint.select = ["ALL"]
lint.ignore = [
"A",
"ANN002",
"ANN003",
"ANN2",
"ANN4",
"ARG",
# Background event handlers hold `async with self` across `yield` by design.
"ASYNC119",
"BLE",
"C901",
"COM",
"CPY001",
"D205",
"DOC202",
"DOC501",
"DOC502",
"DTZ",
"E501",
"F403",
"FBT",
"FIX",
"FURB189",
"FURB140",
"G004",
"ISC003",
"PLC",
"PLR",
"PLW",
"PT011",
"PT012",
"PYI",
"RUF012",
"RUF067",
# State managers deliberately skip write-back when the `with` body raises.
"RUF075",
# `noqa` comments stay readable to non-ruff tooling and to older ruff versions.
"RUF105",
"RUF201",
"S",
"SLF",
"SLOT",
"TC",
"TD",
"TRY0",
"TRY400", # User-facing errors deliberately omit tracebacks; debug logs carry diagnostics where appropriate.
]
lint.pydocstyle.convention = "google"
lint.flake8-bugbear.extend-immutable-calls = [
"reflex_base.utils.types.Unset",
"reflex_base.vars.base.Var.create",
]
preview = true
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
"tests/*.py" = [
"ANN001",
"D100",
"D103",
"D104",
"INP",
"B018",
"PERF",
"T",
"N",
]
"benchmarks/*.py" = ["ANN001", "D100", "D103", "D104", "B018", "PERF", "T", "N"]
"*/.templates/*.py" = ["D100", "D103", "D104"]
"*.pyi" = ["D301", "D415", "D417", "D418", "E742", "N", "PGH"]
"pyi_generator.py" = ["N802"]
"packages/reflex-base/src/reflex_base/constants/*.py" = ["N"]
# Generated from async generators, which cannot `yield from`.
"packages/reflex-build-sdk/src/reflex_build_sdk/_sync/**/*.py" = ["UP028"]
"packages/reflex-hosting-cli/src/reflex_cli/**/*.py" = [
"B008",
"D420",
"EM101",
"EM102",
"RET504",
]
"tests/units/reflex_cli/**/*.py" = ["DOC201", "PT006", "RUF052"]
# Generated from async comprehensions, which have no list() equivalent.
"tests/units/reflex_build_sdk/_sync/**/*.py" = ["C416"]
"*/.templates/apps/blank/code/*" = ["INP001"]
"*/blank.py" = ["I001"]
"docs/package/scripts/*.py" = ["INP001"]
"packages/reflex-build-sdk/scripts/*.py" = ["INP001", "T201"]
"scripts/changed_paths.py" = ["T201"]
"scripts/check_min_deps.py" = ["T201"]
"scripts/check_outdated_deps.py" = ["T201"]
"scripts/verify_pyi.py" = ["T201"]
# Skill helper scripts are CLIs whose whole job is printing a report.
".claude/skills/*/scripts/*.py" = ["T201"]
[tool.pytest.ini_options]
filterwarnings = "ignore:fields may not start with an underscore:RuntimeWarning"
asyncio_default_fixture_loop_scope = "function"
asyncio_mode = "auto"
markers = [
"performance: scheduled wall-time, service, memory, lifecycle, or browser benchmark",
]
[tool.codespell]
skip = "*.html, examples, *.pyi, */nba.csv, */olympic-winners.json, packages/reflex-build-sdk/openapi.json, uv.lock, */bun.lock, node_modules"
ignore-words-list = "te, TreeE, selectin"
[tool.coverage.run]
source = [
"reflex",
"reflex_components_code",
"reflex_components_core",
"reflex_components_dataeditor",
"reflex_components_gridjs",
"reflex_components_lucide",
"reflex_components_markdown",
"reflex_components_moment",
"reflex_components_plotly",
"reflex_components_radix",
"reflex_components_react_player",
"reflex_components_recharts",
"reflex_components_sonner",
"reflex_base",
"reflex_docgen",
"reflex_otel",
"reflex_release",
"reflex_build_sdk",
"reflex_site_shared",
"reflex_components_internal",
"reflex_integrations_docs",
]
branch = true
omit = [
"*/pyi_generator.py",
"reflex/__main__.py",
"reflex/app_module_for_backend.py",
"reflex/components/chakra/*",
"reflex/experimental/*",
]
[tool.coverage.report]
show_missing = true
# TODO bump back to 79
fail_under = 72
precision = 2
ignore_errors = true
exclude_also = [
"def __repr__",
# Don't complain about missing debug-only code:
"if self.debug",
# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",
# Regexes for lines to exclude from consideration
"if 0:",
# Don't complain if non-runnable code isn't run:
"if __name__ == .__main__.:",
# Don't complain about abstract methods, they aren't run:
"@(abc.)?abstractmethod",
# Don't complain about overloaded methods:
"@overload",
]
[tool.coverage.html]
directory = "coverage_html_report"
[tool.reflex-release]
# The release path runs the reflex-release bundled in this repository, resolved
# from uv.lock, rather than a version published to PyPI. That pins the whole
# pipeline to one commit: the workflows below are generated from the templates
# in packages/reflex-release, and the sync --check on every pull request
# compares them against the templates of that same commit. A workflow edited by
# hand and a template updated without regenerating are both drift, and both
# fail the same check.
cli-command = "uv run --frozen --package reflex-release reflex-release"
root-package = "reflex"
root-source-dirs = ["reflex"]
packages-dir = "packages"
package-source-subdirs = ["src"]
# Changelog dates and r/pre-<date> branch names are stamped in the project's
# home timezone, so an evening release is not dated tomorrow by a UTC runner.
release-timezone = "America/Los_Angeles"
# No changelog, no news fragments: patch-released on every push to main that
# touches them.
internal-packages = ["reflex-components-internal", "reflex-site-shared"]
# Built for the docs site rather than published to PyPI: no release checkbox, no
# changelog detection, no news fragment, and publish refuses it.
never-publish-packages = ["integrations-docs"]
# reflex's metadata pins reflex-base exactly, so the two always release together
# at one version and reflex uploads only after reflex-base is on PyPI.
[[tool.reflex-release.lockstep]]
members = ["reflex", "reflex-base"]
publish-last = ["reflex"]
pin-exact = true
[tool.towncrier]
# Shared monorepo config. package/name intentionally empty โ each invocation
# passes --dir <package_path> --name <package> --version <vX.Y.Z> to target a
# specific package. See https://towncrier.readthedocs.io/en/stable/monorepo.html
package = ""
name = ""
directory = "news"
filename = "CHANGELOG.md"
title_format = "## {version} ({project_date})"
issue_format = "[#{issue}](https://github.com/reflex-dev/reflex/issues/{issue})"
start_string = "<!-- towncrier release notes start -->\n"
[[tool.towncrier.type]]
directory = "breaking"
name = "Breaking Changes"
showcontent = true
[[tool.towncrier.type]]
directory = "deprecation"
name = "Deprecations"
showcontent = true
[[tool.towncrier.type]]
directory = "feature"
name = "Features"
showcontent = true
[[tool.towncrier.type]]
directory = "bugfix"
name = "Bug Fixes"
showcontent = true
[[tool.towncrier.type]]
directory = "performance"
name = "Performance"
showcontent = true
[[tool.towncrier.type]]
directory = "docs"
name = "Documentation"
showcontent = true
[[tool.towncrier.type]]
directory = "misc"
name = "Miscellaneous"
showcontent = true
# Packages that must not be reported by scripts/check_outdated_deps.py. An entry matches by
# exact name, or by prefix when it ends in `*`.
#
# `*_held` is for packages blocked on work we own: the script errors if one is already at its
# latest version, since that means the blocker is gone and the entry should be deleted.
# `*_pinned` is for packages we do not drive -- pinned by policy or owned by another repo --
# where reaching latest says nothing about whether the entry can go, so staleness is not
# checked.
[tool.check-outdated-deps]
backend_held = [
# Exact-pinned by pydantic and playwright respectively, so they can only move when
# their parent does. Drop these once the parent releases pick up the newer version.
"pydantic-core",
"pyee",
# Held at 7.x: redis-py 8 hangs three redis-backed tests on Python 3.10/3.11
# (including `get_state`, so it is not test-only). See #7026 for the reproduction
# and the A/B that isolated it; requested in #6764.
"redis",
]
backend_pinned = [
# Linters are pinned deliberately and bumped on their own cadence.
"pyright",
"ruff",
]
frontend_held = [
# 2.x restructures the component props and drops the `filter` prop, so `rx.moment`
# needs a migration first (#7003).
"react-moment",
# plotly.js and plotly.js-locales move in lockstep, and 4.x removes the mapbox traces
# and subplot that `rx.plotly.mapbox` is built on, so both need a deprecation first
# (#7002). `react-plotly.js` is current and deliberately not held.
"plotly.js",
"plotly.js-locales",
# Held at 4.3.0: 4.3.1+ reworked source-file scanning (tailwindlabs/tailwindcss#20214)
# and walks the git-ignored `.web` tree, which collapses the docs prod build at scale.
# See the note on `Constants.VERSION` in reflex_base/plugins/tailwind_v4.py and #7022.
"tailwindcss",
"@tailwindcss/postcss",
]
frontend_pinned = [
# Pinned in other repos (reflex-enterprise and friends), so their versions are not
# ours to advance.
"@chakra-ui/*",
"lucide-react",
"@splinetool/runtime",
"framer-motion",
# ag-grid-community, -enterprise and -react release in lockstep; the shell filter
# needed both `ag-grid` and `ag-grid-react` to cover them.
"ag-grid*",
]
[tool.uv]
# 0.11.8 is the first release that resolves a URL dependency reached through a
# URL build requirement. reflex's build hook sets require-runtime-dependencies,
# so every workspace package it depends on is a file:// build requirement, and
# reflex-hosting-cli reaches reflex-build-sdk the same way. Older uv refuses the
# second hop and `uv sync` cannot build reflex at all.
required-version = ">=0.11.8"
exclude-newer = "7 days"
# Internal Reflex packages release in lockstep and are routinely pinned (>=) at a version
# published within the exclude-newer window; disable the floor for them so resolution
# always sees their latest release. The floor still applies to third-party dependencies.
# Add any new internal package that is published and pinned as a (build or runtime)
# dependency here.
[tool.uv.exclude-newer-package]
hatch-reflex-pyi = false
reflex = false
reflex-base = false
reflex-build-sdk = false
reflex-components-code = false
reflex-components-core = false
reflex-components-dataeditor = false
reflex-components-gridjs = false
reflex-components-internal = false
reflex-components-lucide = false
reflex-components-markdown = false
reflex-components-moment = false
reflex-components-plotly = false
reflex-components-radix = false
reflex-components-react-player = false
reflex-components-recharts = false
reflex-components-sonner = false
reflex-enterprise = false
reflex-hosting-cli = false
[tool.uv.sources]
hatch-reflex-pyi.workspace = true
reflex-base.workspace = true
reflex-components-code.workspace = true
reflex-components-core.workspace = true
reflex-components-dataeditor.workspace = true
reflex-components-gridjs.workspace = true
reflex-components-lucide.workspace = true
reflex-components-markdown.workspace = true
reflex-components-moment.workspace = true
reflex-components-plotly.workspace = true
reflex-components-radix.workspace = true
reflex-components-react-player.workspace = true
reflex-components-recharts.workspace = true
reflex-components-sonner.workspace = true
reflex-docgen.workspace = true
reflex-release.workspace = true
reflex-hosting-cli.workspace = true
reflex-otel.workspace = true
reflex-build-sdk.workspace = true
reflex-components-internal.workspace = true
reflex-site-shared.workspace = true
reflex-integrations-docs.workspace = true
reflex.workspace = true
[tool.uv.workspace]
members = ["packages/*", "docs/app", "docs/package"]