-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpyproject.toml
More file actions
152 lines (140 loc) · 4.63 KB
/
Copy pathpyproject.toml
File metadata and controls
152 lines (140 loc) · 4.63 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "shinyreact"
version = "0.1.0"
description = "Shiny UI infrastructure for React-based component rendering"
readme = "pkg-py/README.md"
license = "MIT"
license-files = ["LICENSE"]
authors = [{ name = "Barret Schloerke", email = "barret@posit.co" }]
keywords = ["shiny", "react", "web", "dashboard"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"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",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
]
requires-python = ">=3.10"
dependencies = [
"shiny>=1.8.0",
"htmltools>=0.7.0",
]
[project.urls]
Homepage = "https://posit-dev.github.io/shinyreact/py/"
Documentation = "https://posit-dev.github.io/shinyreact/py/"
Repository = "https://github.com/posit-dev/shinyreact"
Changelog = "https://github.com/posit-dev/shinyreact/blob/main/pkg-py/CHANGELOG.md"
Issues = "https://github.com/posit-dev/shinyreact/issues"
# The sdist is the Python package only, not the monorepo.
[tool.hatch.build.targets.sdist]
only-include = ["pkg-py/src", "pkg-py/README.md", "pkg-py/CHANGELOG.md"]
[tool.hatch.build.targets.wheel]
packages = [
"pkg-py/src/shinyreact",
]
[dependency-groups]
examples = [
"matplotlib>=3.8.0",
"numpy>=1.26.0",
"pandas>=2.1.0",
"python-dotenv>=1.0.0",
"chatlas>=0.1.0",
"shinywidgets>=0.8.0",
"plotly>=6.7.0",
]
dev = [
"pytest>=8.0.0",
"pytest-asyncio>=0.24.0",
# starlette.testclient (used by tests/test_app.py) requires httpx; without
# it pytest fails at *collection*, not with a test failure.
"httpx>=0.27.0",
"pyright>=1.1.0",
"ruff>=0.6.0",
"pytest-cov>=5.0.0",
"tox>=4.0.0",
"tox-uv>=1.0.0",
"pre-commit>=4.0.0",
]
docs = [
"quartodoc>=0.11.0",
# quartodoc 0.11 passes docstring-parser options griffe 2.x dropped
# (`allow_section_blank_line`), so `quartodoc build` crashes against 2.x.
"griffe<2",
]
tests-e2e = [
# `pytest-playwright` pulls in `playwright` itself. py-shiny has no
# `playwright` extra (theme, otel, test, dev, doc, add-test), and asking for
# one uv cannot find is a warning on every `uv sync`, not an error -- which
# is exactly how a real extras problem would hide.
"pytest-playwright>=0.5.0",
"shiny>=1.8.0",
"shinywidgets>=0.8.0",
"plotly>=6.7.0",
"pandas>=2.1.0",
]
[tool.pytest.ini_options]
# Default test runs exclude `pkg-py/tests/playwright` — everything in there
# needs the `tests-e2e` extras (browser, shiny[playwright]), and most of it
# spins up a real Shiny process per app, which is too heavy for the unit test
# loop. Run it explicitly via `make py-test-e2e`.
#
# "Needs the extras" is the membership rule, not "drives a browser":
# test_wire_tap.py uses a fake page and no browser, but importing
# `shinyreact.playwright` pulls in `playwright.sync_api`. Left in
# `pkg-py/tests/` it broke *collection* of the whole unit suite whenever the
# extras were absent — precisely the run that is supposed to need none.
#
# The example apps keep their own tests beside the app (examples/*/tests). They
# run by default: they are fast, need no extra dependencies, and a package
# change that breaks an example should fail the package's test run.
testpaths = ["pkg-py/tests", "examples"]
addopts = "--ignore=pkg-py/tests/playwright"
[tool.pyright]
# Tests and examples are checked too, not just the package. They are the only
# place the *caller's* view of the API is exercised, so a signature that is
# unusable from user code -- a `reactive_output` that rejects the `dict` every
# app returns -- shows up here and nowhere else.
include = [
"pkg-py/src/shinyreact",
"pkg-py/tests",
"examples",
]
exclude = [
"examples/shiny-react-upstream",
"**/node_modules",
]
pythonVersion = "3.10"
typeCheckingMode = "basic"
[tool.ruff]
line-length = 88
extend-exclude = [
"examples/shiny-react-upstream",
# Generated by `make update-skills`; ruff formats Python code blocks inside
# Markdown, which would silently rewrite the shipped copy away from its
# source in .claude/skills/.
"pkg-py/src/shinyreact/.agents",
]
[tool.ruff.lint]
select = ["E", "F", "I"]
[tool.tox]
legacy_tox_ini = """
[tox]
env_list = type-py3{10,11,12,13,14}, py3{10,11,12,13,14}
isolated_build = True
[testenv]
package = wheel
wheel_build_env = .pkg
commands = pytest
[testenv:type]
deps =
pyright
pytest
commands = pyright
"""