forked from strawberry-graphql/strawberry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
400 lines (357 loc) Β· 9.11 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
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
[tool.poetry]
name = "strawberry-graphql"
packages = [ { include = "strawberry" } ]
version = "0.239.2"
description = "A library for creating GraphQL APIs"
authors = ["Patrick Arminio <patrick.arminio@gmail.com>"]
license = "MIT"
readme = "README.md"
keywords = ["graphql", "api", "rest", "starlette", "async"]
homepage = "https://strawberry.rocks/"
repository = "https://github.com/strawberry-graphql/strawberry"
documentation = "https://strawberry.rocks/"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"License :: OSI Approved :: MIT License",
]
include = ["strawberry/py.typed"]
[tool.poetry.urls]
"Changelog" = "https://strawberry.rocks/changelog"
"Discord" = "https://discord.com/invite/3uQ2PaY"
"Twitter" = "https://twitter.com/strawberry_gql"
"Mastodon" = "https://farbun.social/@strawberry"
"Sponsor on GitHub" = "https://github.com/sponsors/strawberry-graphql"
"Sponsor on Open Collective" = "https://opencollective.com/strawberry-graphql"
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
[tool.poetry.dependencies]
python = "^3.8"
graphql-core = ">=3.2.0,<3.4.0"
typing-extensions = ">=4.5.0"
python-dateutil = "^2.7.0"
starlette = {version = ">=0.18.0", optional = true}
typer = {version = ">=0.7.0", optional = true}
pygments = {version = "^2.3", optional = true}
uvicorn = {version = ">=0.11.6", optional = true}
Django = {version = ">=3.2", optional = true}
asgiref = {version = "^3.2", optional = true}
flask = {version = ">=1.1", optional = true}
quart = {version = ">=0.19.3", optional = true}
opentelemetry-api = {version = "<2", optional = true}
opentelemetry-sdk = {version = "<2", optional = true}
chalice = {version = "^1.22", optional = true}
pydantic = {version = ">1.6.1", optional = true}
python-multipart = {version = ">=0.0.7", optional = true}
sanic = {version = ">=20.12.2", optional = true}
aiohttp = {version = "^3.7.4.post0", optional = true}
fastapi = {version = ">=0.65.2", optional = true}
litestar = {version = ">=2", optional = true, python = ">=3.8"}
channels = {version = ">=3.0.5", optional = true}
astunparse = {version = "^1.6.3", python = "<3.9"}
libcst = {version = ">=0.4.7", optional = true}
rich = {version = ">=12.0.0", optional = true}
pyinstrument = {version = ">=4.0.0", optional = true}
graphlib_backport = {version = "*", python = "<3.9", optional = true}
[tool.poetry.group.dev.dependencies]
asgiref = "^3.2"
ddtrace = ">=1.6.4"
email-validator = {version = ">=1.1.3,<3.0.0", optional = false}
freezegun = "^1.2.1"
libcst = {version = ">=1.0.0", optional = false}
MarkupSafe = "2.1.3"
nox = "^2024.4.15"
nox-poetry = "^1.0.3"
opentelemetry-api = "<2"
opentelemetry-sdk = "<2"
pygments = "^2.3"
pyinstrument = {version = ">=4.0.0", optional = false}
pytest = "^7.2"
pytest-asyncio = ">=0.20.3"
pytest-codspeed = "^2.0.1"
pytest-cov = "^4.0.0"
pytest-emoji = "^0.2.0"
pytest-mock = "^3.10"
pytest-snapshot = "^0.9.0"
pytest-xdist = {extras = ["psutil"], version = "^3.1.0"}
python-multipart = ">=0.0.7"
rich = {version = ">=12.5.1", optional = false}
sanic-testing = ">=22.9,<24.0"
sentry-sdk = "^1.39.2"
typer = {version = ">=0.7.0", optional = false}
types-aiofiles = ">=22.1"
types-certifi = "^2021.10.8"
types-chardet = "^5.0.4"
types-freezegun = "^1.1.9"
types-python-dateutil = "^2.8.19"
types-toml = "^0.10.8"
types-typed-ast = "^1.5.8"
types-ujson = "^5.6.0"
types-protobuf = "^4.23.0.1"
poetry-plugin-export = "^1.6.0"
# another bug in poetry
urllib3 = "<2"
graphlib_backport = {version = "*", python = "<3.9", optional = false}
inline-snapshot = "^0.10.1"
[tool.poetry.group.integrations]
optional = true
[tool.poetry.group.integrations.dependencies]
aiohttp = "^3.7.4.post0"
chalice = {version = "^1.22"}
channels = ">=3.0.5,<5.0.0"
Django = ">=3.2"
fastapi = {version = ">=0.65.0", optional = false}
flask = ">=1.1"
quart = ">=0.19.3"
pydantic = {version = ">=2.0", optional = false}
pytest-aiohttp = "^1.0.3"
pytest-django = {version = "^4.5"}
sanic = ">=20.12.2"
starlette = ">=0.13.6"
litestar = {version = ">=2", optional = false, python = ">=3.8"}
uvicorn = ">=0.11.6"
daphne = "^4.0.0"
[tool.poetry.extras]
aiohttp = ["aiohttp"]
asgi = ["starlette", "python-multipart"]
debug = ["rich", "libcst"]
debug-server = ["starlette", "uvicorn", "python-multipart", "typer", "pygments", "rich", "libcst"]
django = ["Django", "pytest-django", "asgiref"]
channels = ["channels", "asgiref"]
flask = ["flask"]
quart=["quart"]
opentelemetry = ["opentelemetry-api", "opentelemetry-sdk"]
pydantic = ["pydantic"]
sanic = ["sanic"]
fastapi = ["fastapi", "python-multipart"]
chalice = ["chalice"]
cli = ["typer", "pygments", "rich", "libcst", "graphlib_backport"]
litestar = ["litestar"]
pyinstrument = ["pyinstrument"]
[tool.poetry.scripts]
strawberry = "strawberry.cli:run"
[tool.pytest.ini_options]
addopts = "--emoji"
DJANGO_SETTINGS_MODULE = "tests.django.django_settings"
testpaths = ["tests/"]
markers = [
"aiohttp",
"asgi",
"chalice",
"channels",
"django_db",
"django",
"fastapi",
"flaky",
"flask",
"quart",
"pydantic",
"relay",
"sanic",
"starlette",
]
asyncio_mode = "auto"
filterwarnings = [
"ignore::DeprecationWarning:strawberry.*.resolver",
"ignore:LazyType is deprecated:DeprecationWarning",
"ignore::DeprecationWarning:ddtrace.internal",
"ignore::DeprecationWarning:django.utils.encoding",
# ignoring the text instead of the whole warning because we'd
# get an error when django is not installed
"ignore:The default value of USE_TZ",
"ignore::DeprecationWarning:pydantic_openapi_schema.*",
"ignore::DeprecationWarning:graphql.*",
"ignore::DeprecationWarning:websockets.*",
"ignore::DeprecationWarning:pydantic.*",
"ignore::UserWarning:pydantic.*",
"ignore::DeprecationWarning:pkg_resources.*",
]
[tool.autopub]
git-username = "Botberry"
git-email = "bot@strawberry.rocks"
project-name = "π"
append-github-contributor = true
[tool.pyright]
# include = ["strawberry"]
exclude = ["**/__pycache__",]
reportMissingImports = true
reportMissingTypeStubs = false
pythonVersion = "3.8"
stubPath = ""
[tool.ruff]
line-length = 88
target-version = "py38"
fix = true
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
"tests/*/snapshots"
]
src = ["strawberry", "tests"]
[tool.ruff.lint]
select = ["ALL"]
ignore = [
# https://github.com/astral-sh/ruff/pull/4427
# equivalent to keep-runtime-typing
"UP006",
"UP007",
"TID252",
# we use asserts in tests and to hint mypy
"S101",
"S102",
"S104",
"S324",
"ANN101", # missing annotation for self?
# definitely enable these, maybe not in tests
"ANN102",
"ANN401",
"PGH003",
"PGH004",
"RET504",
"RET505",
"RET506",
"RET507",
"RET503",
"BLE001",
"B008",
"N811",
"N804",
"N818",
# Variable `T` in function should be lowercase
# this seems a potential bug or opportunity for improvement in ruff
"N806",
# first argument should named self (found in tests)
"N805",
"N815",
# shadowing builtins
"A001",
"A002",
"A003",
"ARG001",
"ARG002",
"ARG003",
"ARG004",
"ARG005",
"FBT001",
"FBT002",
"FBT003",
"PT001",
"PT023",
# this is pretty much handled by black
"E501",
# enable these, we have some in tests
"B006",
"PT004",
"PT007",
"PT011",
"PT012",
"PT015",
"PT017",
"C414",
"N802",
"SIM117",
"SIM102",
"F841",
"B027",
"B905",
"ISC001",
# same?
"S105",
"S106",
"DTZ003",
"DTZ005",
"RSE102",
"SLF001",
# in tests
"DTZ001",
"EM101",
"EM102",
"EM103",
"B904",
"B019",
"N801",
"N807",
# pandas
"PD",
"RUF012",
"PLC0105",
"FA102",
# code complexity
"C",
"C901",
# trailing commas
"COM812",
"PLR",
"INP",
"TRY",
"SIM300",
"SIM114",
"DJ008",
"TD002",
"TD003",
"FIX001",
"FIX002",
"FA100",
# Docstrings, maybe to enable later
"D100",
"D101",
"D102",
"D103",
"D104",
"D105",
"D106",
"D107",
"D412",
]
[tool.ruff.lint.per-file-ignores]
"strawberry/schema/types/concrete_type.py" = ["TCH002"]
"tests/*" = [
"RSE102",
"SLF001",
"TCH001",
"TCH002",
"TCH003",
"ANN001",
"ANN201",
"ANN202",
"ANN204",
"PLW0603",
"PLC1901",
"S603",
"S607",
"B018",
"D",
]
"strawberry/extensions/tracing/__init__.py" = ["TCH004"]
"tests/http/clients/__init__.py" = ["F401"]
[tool.ruff.lint.isort]
known-first-party = ["strawberry"]
known-third-party = ["django", "graphql"]
extra-standard-library = ["typing_extensions"]
[tool.ruff.format]
exclude =[
'tests/codegen/snapshots/',
'tests/cli/snapshots/'
]
[tool.ruff.lint.pydocstyle]
convention = "google"