Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
284 lines (264 loc) · 8.54 KB
/
Copy pathpyproject.toml
File metadata and controls
284 lines (264 loc) · 8.54 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
[build-system]
requires = ["setuptools>=77", "wheel", "setuptools_scm>=8.0"]
build-backend = "setuptools.build_meta"
[tool.setuptools]
# Declare package data explicitly (instead of the default include-package-data
# manifest scan) so build_py does not warn that asset/template directories are
# "absent from the `packages` configuration". The second glob is needed because
# `**` does not match hidden files (the package templates ship .gitignore files).
include-package-data = false
# The `.agents/**` glob is needed because `**` does not match hidden
# directories: Agent Skills ship inside the package under `shiny/.agents/skills/`
# (the library-skills convention). Guarded by tests/pytest/test_packaging.py.
[tool.setuptools.package-data]
shiny = ["**", "**/.gitignore", ".agents/**"]
[tool.setuptools.packages.find]
where = ["."]
include = ["shiny*"]
# Keep `false` so only directories with an `__init__.py` are packaged as code.
# `true` would register every asset/template directory (shiny/www/..., etc.) as
# a PEP 420 namespace package and sweep in any stray directory or .py file that
# lands under shiny/, over-exposing the package surface. Those directories are
# instead shipped as data files via the package-data globs above.
namespaces = false
# Keep files the `package-data` globs above sweep up out of the wheel: the
# `api-examples/` trees are only read when building the docs (`@add_example()`).
# Guarded by tests/pytest/test_packaging.py.
[tool.setuptools.exclude-package-data]
"*" = [
"api-examples/**",
"**/api-examples/**",
"__pycache__/**",
"**/__pycache__/**",
]
[tool.setuptools_scm]
write_to = "shiny/_version.py"
local_scheme = "no-local-version"
[project]
name = "shiny"
dynamic = ["version"]
authors = [{ name = "Winston Chang", email = "winston@posit.co" }]
description = "A web development framework for Python."
readme = "README.md"
requires-python = ">=3.10"
license = "MIT"
license-files = ["LICENSE"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Natural Language :: English",
"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",
]
dependencies = [
"typing-extensions>=4.10.0",
"uvicorn>=0.23.0;platform_system!='Emscripten'",
"starlette>=0.17.1",
"websockets>=13.0",
"htmltools>=0.7.0",
"click>=8.1.4;platform_system!='Emscripten'",
"markdown-it-py>=1.1.0",
"mdit-py-plugins>=0.3.0",
"linkify-it-py>=1.0",
"platformdirs>=2.1.0",
"asgiref>=3.5.2",
"packaging>=20.9",
"watchfiles>=0.18.0;platform_system!='Emscripten'",
"questionary>=2.0.0;platform_system!='Emscripten'",
"prompt-toolkit>=3.0.0;platform_system!='Emscripten'",
"python-multipart>=0.0.7;platform_system!='Emscripten'",
"setuptools;python_version>='3.12'",
"narwhals>=2.26.0",
"orjson>=3.10.2",
"shinychat>=0.1.0",
# 1.24.0+ required: older SDKs formatted span exception stack traces from
# the active exception instead of the sanitized one shiny passes to
# `record_exception()`, leaking unsanitized error messages
"opentelemetry-api>=1.24.0",
]
[project.optional-dependencies]
theme = ["libsass>=0.23.0", "brand_yml>=0.2.0"]
otel = [
# 1.24.0+ required: same sanitized-stack-trace floor as opentelemetry-api above
"opentelemetry-sdk>=1.24.0",
# Enables zero-code auto-instrumentation via `opentelemetry-instrument shiny run
# app.py`. The [otlp] extra provides the default `otlp` exporter so the bare
# command works without extra flags (and allows switching between gRPC/HTTP).
"opentelemetry-distro[otlp]>=0.45b0",
]
test = [
"pytest>=6.2.4",
"pytest-asyncio>=0.17.2",
"pytest-playwright[base-url]>=0.5.2",
"playwright>=1.48.0",
"pytest-xdist",
"pytest-shard",
"pytest-timeout",
"pytest-rerunfailures",
"pytest-cov",
"coverage",
"syrupy>=5.5.1",
# tests/pytest/test_packaging.py builds a wheel to check its contents.
# `[build-system].requires` only guarantees setuptools inside an isolated
# PEP 517 build, and shiny itself requires it at runtime only on 3.12+.
"setuptools>=77",
"psutil",
"astropy",
"suntime",
"timezonefinder ; platform_system != 'Windows'",
"ipyleaflet",
"shinywidgets",
"shinychat>=0.6.0",
"seaborn",
"plotnine",
"plotly",
"anywidget",
"duckdb",
"holoviews",
"bokeh",
"xarray",
"geopandas",
"geodatasets",
"missingno",
"rsconnect-python",
"scikit-learn",
"folium",
"palmerpenguins>=0.1.5", # type stubs available
"faicons",
"ridgeplot",
"great_tables",
"polars",
"dask[dataframe]",
"pyarrow",
"pyarrow-stubs",
"opentelemetry-sdk>=1.24.0",
"logfire>=4.0.0",
]
dev = [
"black>=26.1.0",
"flake8>=6.0.0",
"flake8-bugbear>=23.2.13",
"Flake8-pyproject>=1.2.3",
"isort>=5.10.1",
"libsass>=0.23.0",
"brand_yml>=0.2.0",
"pyrefly>=1.2.0",
"pyright>=1.1.407",
"pre-commit>=2.15.0",
"wheel",
"matplotlib",
"pandas",
"pandas-stubs",
"polars",
"numpy",
"shinyswatch>=0.7.0",
"python-dotenv",
"chatlas>=0.21.1",
"aiohttp",
"beautifulsoup4",
]
doc = [
"jupyter",
"jupyter_client < 8.0.0",
"tabulate",
"shinylive>=0.8.13",
"pydantic>=2.7.4",
"quartodoc>=0.8.1",
"griffe>=1.3.2,<2.0.0",
]
add-test = [
"chatlas[anthropic,openai]",
"openai>=1.104.1",
"anthropic>=0.62.0",
"inspect-ai>=0.3.129;python_version>='3.10'",
"pytest-timeout",
"pytest>=6.2.4",
"pytest-playwright>=0.5.2",
"playwright>=1.48.0",
]
[project.urls]
Homepage = "https://github.com/posit-dev/py-shiny"
Documentation = "https://shiny.posit.co/py/"
Repository = "https://github.com/posit-dev/py-shiny"
"Bug Tracker" = "https://github.com/posit-dev/py-shiny/issues"
[project.scripts]
shiny = "shiny._main:main"
[project.entry-points.pytest11]
shiny-test = "shiny.pytest._pytest"
[tool.pytest.ini_options]
testpaths = ["tests"]
[tool.flake8]
extend-exclude = ["docs", ".venv", "venv", "typings", "build", "_dev", ".context"]
ignore = ["E302", "E501", "F403", "F405", "W503", "E203", "E701", "E704"]
[tool.black]
extend-exclude = ".context"
[tool.isort]
profile = "black"
skip = [
"__init__.py",
"typings/",
"_dev/",
".context/",
".venv",
"venv",
".tox",
"build",
"_version.py",
]
[tool.mypy]
# The goal of our usage of mypy is to make to sure mypy can run, not that it catches any errors (we use pyright to find our errors).
# Therefore, ignore_errors but do not ignore runtime errors while checking
# Note: This setting can not be done via CLI and must be set within a config
ignore_errors = true
exclude = ["shiny/api-examples", "shiny/templates"]
# Pyrefly's default project preset is the migration target for Pyright strict;
# its similarly named strict preset additionally enables checks (including
# mandatory @override decorators) that Pyright strict explicitly leaves off.
[tool.pyrefly]
infer-with-first-use = false
# Until pyright is completely removed, we need to maintain `permissive-ignores = true`.
# Once removed, convert all `# pyright: ignore` to `# pyrefly: ignore`. Use specific rules when possible.
permissive-ignores = true
# Known pre-existing diagnostics are baselined so `pyrefly check` only fails
# on new errors. Regenerate with `make update-pyrefly-baseline` after
# intentionally fixing baselined errors.
baseline = "pyrefly-baseline.json"
site-package-path = ["typings"]
search-path = [
".",
"tests/pytest",
"tests/playwright",
"tests/playwright/examples",
"tests/playwright/shiny/bugs/0666-sidebar",
"tests/playwright/shiny/bugs/0696-resolve-id",
"tests/playwright/shiny/TODO/sidebar",
]
project-excludes = [
"shiny/api-examples",
"examples",
"build",
"dist",
"typings",
"sandbox",
"_dev",
".context",
"docs",
"tests/playwright/deploys/*/app.py",
"shiny/templates",
"tests/playwright/ai_generated_apps/*/*/app*.py",
"tests/inspect-ai/apps/*/app*.py",
"shiny/pytest/_generate/_main.py",
"tests/inspect-ai/scripts/evaluation.py",
]
[tool.pyrefly.errors]
no-access = "ignore"
unused-ignore = "error"
implicit-any = "error"
[[tool.pyrefly.sub-config]]
matches = "tests/playwright/**"
# The repository has separate top-level conftest modules for pytest and
# Playwright. A single project search path cannot disambiguate both names.
replace-imports-with-any = ["conftest"]