-
-
Notifications
You must be signed in to change notification settings - Fork 541
/
Copy pathpyproject.toml
385 lines (346 loc) · 9.68 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
[tool.poetry]
name = "strawberry-graphql"
packages = [ { include = "strawberry" } ]
version = "0.258.0"
description = "A library for creating GraphQL APIs"
authors = ["Patrick Arminio <[email protected]>"]
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-core>=1.6"]
build-backend = "poetry.core.masonry.api"
[tool.poetry.dependencies]
python = "^3.9"
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}
channels = {version = ">=3.0.5", optional = true}
libcst = {version = ">=0.4.7", optional = true}
rich = {version = ">=12.0.0", optional = true}
pyinstrument = {version = ">=4.0.0", optional = true}
[tool.poetry.group.dev.dependencies]
asgiref = "^3.2"
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 = { version = ">=3.0.0", python = ">=3.9" }
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"
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"
types-deprecated = "^1.2.15.20241117"
types-six = "^1.17.0.20241205"
types-pyyaml = "^6.0.12.20240917"
mypy = "^1.13.0"
[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}
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",
"litestar",
"pydantic",
"quart",
"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 = "[email protected]"
project-name = "🍓"
append-github-contributor = true
[tool.pyright]
# include = ["strawberry"]
exclude = ["**/__pycache__",]
reportMissingImports = true
reportMissingTypeStubs = false
pythonVersion = "3.9"
stubPath = ""
[tool.ruff]
line-length = 88
target-version = "py39"
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. We might want to enable those
# after we drop support for Python 3.9
"UP006",
"UP007",
# we use asserts in tests and to hint mypy
"S101",
# Allow "Any" for annotations. We have too many Any annotations and some
# are legit. Maybe reconsider in the future, except for tests?
"ANN401",
# Allow our exceptions to have names that don't end in "Error". Maybe refactor
# in the future? But that would be a breaking change.
"N818",
# Allow "type: ignore" without rule code. Because we support both mypy and
# pyright, and they have different codes for the same error, we can't properly
# fix those issues.
"PGH003",
# Variable `T` in function should be lowercase
# this seems a potential bug or opportunity for improvement in ruff
"N806",
# shadowing builtins
"A001",
"A002",
"A003",
# Unused arguments
"ARG001",
"ARG002",
"ARG003",
"ARG004",
"ARG005",
# Boolean positional arguments
"FBT001",
"FBT002",
"FBT003",
# Too many arguments/branches/return statements
"PLR0913",
"PLR0912",
"PLR0911",
# Do not force adding _co to covariant typevars
"PLC0105",
# Allow private access to attributes
"SLF001",
# code complexity
"C901",
# Allow todo/fixme/etc comments
"TD002",
"TD003",
"FIX001",
"FIX002",
# We don't want to add "from __future__ mport annotations" everywhere
"FA100",
# Docstrings, maybe to enable later
"D100",
"D101",
"D102",
"D103",
"D104",
"D105",
"D106",
"D107",
"D412",
# Allow to define exceptions text in the exception body
"TRY003",
"EM101",
"EM102",
"EM103",
# Allow comparisons with magic numbers
"PLR2004",
# Allow methods to use lru_cache
"B019",
# Don't force if branches to be converted to "or"
"SIM114",
# ruff formatter recommends to disable those, as they conflict with it
# we don't need to ever enable those.
"COM812",
"COM819",
"D206",
"E111",
"E114",
"E117",
"E501",
"ISC001",
"Q000",
"Q001",
"Q002",
"Q003",
"W191",
]
[tool.ruff.lint.per-file-ignores]
".github/*" = ["INP001"]
"federation-compatibility/*" = ["INP001"]
"strawberry/cli/*" = ["B008"]
"strawberry/extensions/tracing/__init__.py" = ["TCH004"]
"strawberry/fastapi/*" = ["B008"]
"strawberry/annotation.py" = ["RET505"]
"tests/*" = [
"ANN001",
"ANN201",
"ANN202",
"ANN204",
"B008",
"B018",
"D",
"DTZ001",
"DTZ005",
"FA102",
"N805",
"PLC1901",
"PLR2004",
"PLW0603",
"PT011",
"RUF012",
"S105",
"S106",
"S603",
"S607",
"TCH001",
"TCH002",
"TCH003",
"TRY002",
]
[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"