forked from jowilf/starlette-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
245 lines (226 loc) · 6.42 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
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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "starlette-admin"
description = "Fast, beautiful and extensible administrative interface framework for Starlette/FastApi applications"
readme = "README.md"
license = "MIT"
requires-python = ">=3.8"
keywords = ["sqlalchemy", "sqlmodel", "mongoengine", "odmantic", "starlette", "fastapi", "admin", "dashboard", "datatables"]
authors = [
{ name = "Jocelin Hounon", email = "[email protected]" },
]
classifiers = [
'Development Status :: 4 - Beta',
"Framework :: AsyncIO",
'Environment :: Web Environment',
'Intended Audience :: Developers',
"License :: OSI Approved :: MIT License",
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
]
dependencies = [
"starlette",
"jinja2 >=3, <4",
"python-multipart",
]
dynamic = ["version"]
[project.urls]
Homepage = "https://github.com/jowilf/starlette-admin"
Documentation = "https://jowilf.github.io/starlette-admin"
Repository = "https://github.com/jowilf/starlette-admin"
Changelog = "https://jowilf.github.io/starlette-admin/changelog/"
[project.optional-dependencies]
i18n = [
"babel >=2.12.1"
]
test = [
"pytest >=7.2.0, <7.5.0",
"pytest-asyncio >=0.20.2, <0.22.0",
"mypy ==1.5.1",
"ruff ==0.0.292",
"black ==23.9.1",
"httpx >=0.23.3, <0.26.0",
"SQLAlchemy-Utils >=0.40.0, <0.42.0",
"arrow >=1.2.3, <1.4.0",
"colour >=0.1.5, <0.2.0",
"phonenumbers >=8.13.3, <8.14.0",
"passlib >=1.7.4, <1.8.0",
"backports.zoneinfo; python_version<'3.9'",
"sqlalchemy-file >=0.5.0, <0.7.0",
"fasteners ==0.19",
"PyMySQL[rsa] >=1.0.2, <1.2.0",
"psycopg2-binary >=2.9.5, <3.0.0",
"aiosqlite >=0.17.0, <0.20.0",
"asyncpg >=0.27.0, <0.29.0",
"aiomysql >=0.1.1, <0.3.0",
"mongoengine >=0.25.0, <0.28.0",
"odmantic >=0.9.0,<0.10.0",
"tinydb >=4.7.0, <4.9.0",
"Pillow >=9.4.0, <9.6.0",
"itsdangerous >=2.1.2, <2.2.0",
"pydantic[email] >=1.10.2, <2.0.0",
]
cov = [
"coverage[toml] >=7.0.0, <7.4.0"
]
doc = [
"mkdocs >=1.4.2, <2.0.0",
"mkdocs-material >=9.0.0, <10.0.0",
"mkdocstrings[python] >=0.19.0, <0.24.0",
"mkdocs-static-i18n >=0.53.0, <0.57.0"
]
dev = [
"pre-commit >=2.20.0, <4.0.0",
"uvicorn >=0.20.0, <0.24.0",
]
[tool.hatch.envs.default]
features = [
"i18n",
"test",
"cov",
"doc",
"dev"
]
[tool.hatch.envs.default.scripts]
format = [
"ruff starlette_admin tests --fix",
"black ."
]
[tool.hatch.envs.test]
features = [
"i18n",
"test",
"cov",
]
[tool.hatch.envs.test.scripts]
lint = [
"mypy starlette_admin",
"ruff starlette_admin tests",
"black . --check"
]
all = "coverage run -m pytest tests"
sqla = "coverage run -m pytest tests/sqla"
[[tool.hatch.envs.test.matrix]]
sqla_version = ["sqla14", "sqla2"]
[tool.hatch.envs.test.overrides]
matrix.sqla_version.dependencies = [
{ value = "SQLAlchemy[asyncio] >=2.0, <2.1", if = ["sqla2"] },
{ value = "SQLAlchemy[asyncio] >=1.4, <1.5", if = ["sqla14"] },
{ value = "sqlmodel ==0.0.8", if = ["sqla14"] },
]
matrix.sqla_version.scripts = [
{ key = "all", value = 'coverage run -m pytest tests --ignore=tests/sqla/test_sqlmodel.py', if = ["sqla2"] },
{ key = "sqla", value = 'coverage run -m pytest tests/sqla --ignore=tests/sqla/test_sqlmodel.py', if = ["sqla2"] },
{ key = "cov", value = '', if = ["sqla14"] }, # run after sqla2 test
]
[tool.hatch.envs.cov]
features = [
"cov",
]
[tool.hatch.envs.cov.scripts]
report = [
"coverage combine",
"coverage report --show-missing",
"coverage xml"
]
[tool.hatch.envs.i18n]
features = [
"i18n",
]
dependencies = [
"babel ==2.13.0",
"click",
"requests"
]
[tool.hatch.envs.i18n.scripts]
init = "python i18n/main.py {args:.}"
extract = "pybabel extract -F i18n/babel.ini -k _n -o i18n/admin.pot --project starlette-admin starlette_admin {args:.}"
update = "pybabel update -i i18n/admin.pot -d starlette_admin/translations -D admin {args:.}"
compile = "pybabel compile -f -D admin -d starlette_admin/translations {args:.}"
[tool.hatch.envs.docs]
features = [
"doc",
]
[tool.hatch.envs.docs.scripts]
serve = "mkdocs serve -a localhost:8080"
build = "mkdocs build"
deploy = "mkdocs gh-deploy --force"
[tool.hatch.version]
path = "starlette_admin/__init__.py"
[tool.coverage.report]
fail_under = 99
show_missing = true
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"raise NotImplementedError",
"except NotImplementedError",
"except ImportError"
]
[tool.coverage.run]
parallel = true
concurrency = ["thread", "greenlet"]
source = ["starlette_admin", "tests"]
[tool.ruff]
select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"C90", # mccabe
"E", # pycodestyle errors
"ERA", # eradicate
"F", # pyflakes
"I", # isort
"INT", # flake8-gettext
"N", # pep8-naming
"PIE", # flake8-pie,
"PLC", # pylint - convention
"PLE", # pylint - error
"PLW", # pylint - warning
"Q", # flake8-quotes
"RET", # flake8-return,
"RUF", # Ruff-specific rules
"SIM", # flake8-simplify
"UP", # pyupgrade
"W", # pycodestyle warnings
]
ignore = [
"B008", # Do not perform function call `_` in argument defaults, neccessary for lazy_gettext
"B905", # `zip()` without an explicit `strict=` parameter
"E501", # line too long, handled by black
"N818", # Exception {name} should be named with an Error suffix
]
target-version = "py38"
[tool.ruff.isort]
known-third-party = ["starlette_admin"]
[tool.ruff.per-file-ignores]
"__init__.py" = ["F401"]
"examples/**" = ["N805", "N999", "RUF012"]
"tests/**" = ["RUF012"]
[tool.mypy]
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
implicit_reexport = false
strict_equality = true
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = [
"starlette_admin.contrib.sqla.helpers",
"starlette_admin.contrib.sqla.view",
]
warn_unused_ignores = false
[tool.hatch.build.targets.wheel]
[tool.hatch.build.targets.sdist]
include = ["starlette_admin"]