forked from reactive-python/reactpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
179 lines (161 loc) · 4.05 KB
/
pyproject.toml
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
[build-system]
requires = ["hatchling", "hatch-build-scripts>=0.0.4"]
build-backend = "hatchling.build"
# --- Project --------------------------------------------------------------------------
[project]
name = "reactpy"
dynamic = ["version"]
description = 'Reactive user interfaces with pure Python'
readme = "README.md"
requires-python = ">=3.9"
license = "MIT"
keywords = ["react", "javascript", "reactpy", "component"]
authors = [
{ name = "Ryan Morshead", email = "[email protected]" },
]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"typing-extensions >=3.10",
"mypy-extensions >=0.4.3",
"anyio >=3",
"jsonpatch >=1.32",
"fastjsonschema >=2.14.5",
"requests >=2",
"colorlog >=6",
"asgiref >=3",
"lxml >=4",
]
[project.optional-dependencies]
all = ["reactpy[starlette,sanic,fastapi,flask,tornado,testing]"]
starlette = [
"starlette >=0.13.6",
"uvicorn[standard] >=0.19.0",
"jinja2-simple-tags",
]
sanic = [
"sanic >=21",
"sanic-cors",
"uvicorn[standard] >=0.19.0",
"jinja2-simple-tags",
]
fastapi = [
"fastapi >=0.63.0",
"uvicorn[standard] >=0.19.0",
"jinja2-simple-tags",
]
flask = [
"flask",
"markupsafe>=1.1.1,<2.1",
"flask-cors",
"flask-sock",
"jinja2-simple-tags",
]
tornado = [ # TODO: Torando does not use Jinja. We will need to write something custom for this.
"tornado",
]
testing = [
"playwright",
]
[project.urls]
Source = "https://github.com/reactive-python/reactpy"
Documentation = "https://github.com/reactive-python/reactpy#readme"
Issues = "https://github.com/reactive-python/reactpy/discussions"
# --- Hatch ----------------------------------------------------------------------------
[tool.hatch.version]
path = "reactpy/__init__.py"
[tool.hatch.envs.default]
features = ["all"]
pre-install-command = "hatch build --hooks-only"
dependencies = [
"coverage[toml]>=6.5",
"pytest",
"pytest-asyncio>=0.17",
"pytest-mock",
"pytest-rerunfailures",
"pytest-timeout",
"responses",
"playwright",
# I'm not quite sure why this needs to be installed for tests with Sanic to pass
"sanic-testing",
# Used to generate model changes from layout update messages
"jsonpointer",
]
[tool.hatch.envs.default.scripts]
test = "playwright install && pytest {args:tests}"
test-cov = "playwright install && coverage run -m pytest {args:tests}"
cov-report = [
# "- coverage combine",
"coverage report",
]
cov = [
"test-cov {args}",
"cov-report",
]
[tool.hatch.envs.default.env-vars]
REACTPY_DEBUG_MODE="1"
[tool.hatch.envs.lint]
features = ["all"]
dependencies = [
"mypy>=1.0.0",
"types-click",
"types-tornado",
"types-pkg-resources",
"types-flask",
"types-requests",
]
[tool.hatch.envs.lint.scripts]
types = "mypy --strict reactpy"
all = ["types"]
[[tool.hatch.build.hooks.build-scripts.scripts]]
work_dir = "../../js"
out_dir = "reactpy/_static"
commands = [
"npm ci",
"npm run build"
]
artifacts = [
"app/dist/"
]
# --- Pytest ---------------------------------------------------------------------------
[tool.pytest.ini_options]
testpaths = "tests"
xfail_strict = true
python_files = "*asserts.py test_*.py"
asyncio_mode = "auto"
# --- MyPy -----------------------------------------------------------------------------
[tool.mypy]
incremental = false
ignore_missing_imports = true
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
# --- Coverage -------------------------------------------------------------------------
[tool.coverage.run]
source_pkgs = ["reactpy"]
branch = false
parallel = false
omit = [
"reactpy/__init__.py",
]
[tool.coverage.report]
fail_under = 100
show_missing = true
skip_covered = true
sort = "Name"
exclude_lines = [
"no ?cov",
'\.\.\.',
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
omit = [
"reactpy/__main__.py",
]