forked from graphql-python/graphql-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
296 lines (274 loc) · 8.62 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
[tool.poetry]
name = "graphql-core"
version = "3.3.0a4"
description = """\
GraphQL-core is a Python port of GraphQL.js,\
the JavaScript reference implementation for GraphQL."""
license = "MIT"
authors = ["Christoph Zwerschke <cito@online.de>"]
readme = "README.md"
homepage = "https://github.com/graphql-python/graphql-core"
repository = "https://github.com/graphql-python/graphql-core"
documentation = "https://graphql-core-3.readthedocs.io/"
keywords = ["graphql"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"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",
"Programming Language :: Python :: 3.12",
]
packages = [
{ include = "graphql", from = "src" },
{ include = "tests", format = "sdist" },
{ include = "docs", format = "sdist" },
{ include = ".bumpversion.cfg", format = "sdist" },
{ include = ".editorconfig", format = "sdist" },
{ include = ".readthedocs.yaml", format = "sdist" },
{ include = "poetry.lock", format = "sdist" },
{ include = "tox.ini", format = "sdist" },
{ include = "CODEOWNERS", format = "sdist" },
{ include = "SECURITY.md", format = "sdist" }
]
[tool.poetry.urls]
Changelog = "https://github.com/graphql-python/graphql-core/releases"
[tool.poetry.dependencies]
python = "^3.7"
typing-extensions = [
{ version = "^4.9", python = ">=3.8,<3.10" },
{ version = "^4.7.1", python = "<3.8" },
]
[tool.poetry.group.test]
optional = true
[tool.poetry.group.test.dependencies]
pytest = [
{ version = "^8.0", python = ">=3.8" },
{ version = "^7.4", python = "<3.8"}
]
pytest-asyncio = [
{ version = "^0.23.5", python = ">=3.8" },
{ version = "~0.21.1", python = "<3.8"}
]
pytest-benchmark = "^4.0"
pytest-cov = "^4.1"
pytest-describe = "^2.2"
pytest-timeout = "^2.2"
tox = [
{ version = "^4.13", python = ">=3.8" },
{ version = "^3.28", python = "<3.8" }
]
[tool.poetry.group.lint]
optional = true
[tool.poetry.group.lint.dependencies]
ruff = ">=0.2.1,<0.3"
mypy = [
{ version = "^1.8", python = ">=3.8" },
{ version = "~1.4", python = "<3.8" }
]
bump2version = ">=1.0,<2"
[tool.poetry.group.doc]
optional = true
[tool.poetry.group.doc.dependencies]
sphinx = [
{ version = ">=7,<8", python = ">=3.8" },
{ version = ">=4,<6", python = "<3.8" }
]
sphinx_rtd_theme = "^2.0"
[tool.ruff]
line-length = 88
target-version = "py37"
[tool.ruff.lint]
select = [
"A", # flake8-builtins
"ANN", # flake8-annotations
"ARG", # flake8-unused-arguments
"B", # flake8-bugbear
"BLE", # flake8-blind-except
"C4", # flake8-comprehensions
"C90", # McCabe cyclomatic complexity
"COM", # flake8-commas
"D", # pydocstyle
"DTZ", # flake8-datetimez
"E", # pycodestyle
"EM", # flake8-errmsg
"ERA", # eradicate
"EXE", # flake8-executable
"F", # Pyflakes
"FBT", # flake8-boolean-trap
"G", # flake8-logging-format
"I", # isort
"ICN", # flake8-import-conventions
"INP", # flake8-no-pep420
"INT", # flake8-gettext
"ISC", # flake8-implicit-str-concat
"N", # pep8-naming
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # Pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"PYI", # flake8-pyi
"Q", # flake8-quotes
"RET", # flake8-return
"RSE", # flake8-raise
"RUF", # Ruff-specific rules
"S", # flake8-bandit
"SLF", # flake8-self
"SIM", # flake8-simplify
"T10", # flake8-debugger
"T20", # flake8-print
"TCH", # flake8-type-checking
"TID", # flake8-tidy-imports
"TRY", # tryceratops
"UP", # pyupgrade
"W", # pycodestyle
"YTT", # flake8-2020
]
ignore = [
"ANN101", "ANN102", # no type annotation for self and cls needed
"ANN401", # allow explicit Any
"COM812", # allow trailing commas for auto-formatting
"D105", "D107", # no docstring needed for magic methods
"D203", # no blank line before class docstring
"D213", # multi-line docstrings should not start at second line
"D400", "D415", # first line in docstring does not need to be a sentence
"D401", # do not always require imperative mood in first line
"FBT001", "FBT002", "FBT003", # allow boolean parameters
"ISC001", # allow string literal concatenation for auto-formatting
"PGH003", # type ignores do not need to be specific
"PLR2004", # allow some "magic" values
"PYI034", # do not check return value of new method
"TID252", # allow relative imports
"UP006", "UP007", # use old type annotations (for now)
"TRY003", # allow specific messages outside the exception class
]
[tool.ruff.lint.per-file-ignores]
"*/__init__.py" = [
"I001", # imports do not need to be sorted
]
"src/graphql/execution/*" = [
"BLE001", # allow catching blind exception
]
"src/graphql/language/ast.py" = [
"D101", # do not require docstrings
]
"src/graphql/language/parser.py" = [
"RSE102", # raised exception may need to be called
]
"src/graphql/type/introspection.py" = [
"ANN001", "ANN003", "ANN204", "ANN205", # allow missing type annotations
"N803", # allow JavaScript style arguments
]
"src/graphql/utilities/get_introspection_query.py" = [
"D101", # allow missing class docstrings
"N815", # allow JavaScript style class attributes
]
"src/graphql/utilities/type_info.py" = [
"D102", # allow missing method docstrings
]
"src/graphql/validation/rules/*" = [
"D102", # allow missing method docstrings
]
"src/graphql/validation/validation_context.py" = [
"D102", # allow missing method docstrings
]
"tests/*" = [
"ANN001", "ANN002", "ANN003", # allow missing type annotations
"ANN201", "ANN202", "ANN204", "ANN205", # allow missing type annotations
"B011", # allow always failing assertions
"B904", # allow raising exceptions without context
"C901", # allow complex functions
"D100", "D101", "D102", "D103", # allow missing docstrings
"EM101", "EM102", # allow passing literal strings to exceptions
"N802", "N803", "N806", "N815", "N816", # allow JavaScript style names
"PLR0915", # allow many statements
"PT015", # allow always failing assertions
"RUF012", # allow mutable class attributes
"S101", # allow assertions
"S301", # allow pickling
"TRY002", "TRY301", # less strict handling of exceptions
]
"tests/star_wars_schema.py" = [
"A002", # allow shadowin builtins
"ERA001", # allow commented-out code
]
"tests/test_docs.py" = [
"S102", # allow use of exec
]
[tool.ruff.lint.flake8-quotes]
inline-quotes = "double"
[tool.ruff.lint.mccabe]
max-complexity = 50
[tool.ruff.lint.pylint]
max-args = 15
max-branches = 50
max-returns = 25
max-statements = 125
[tool.ruff.format]
indent-style = "space"
quote-style = "double"
skip-magic-trailing-comma = false
[tool.coverage.run]
branch = true
source = ["src", "tests"]
omit = [
"*/conftest.py",
"*/test_*_fuzz.py",
"*/assert_valid_name.py",
"*/cached_property.py",
"*/character_classes.py",
"*/is_iterable.py",
"*/subscription/__init__.py"
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"except ImportError:",
"# Python <",
"raise NotImplementedError",
"assert False,",
'\s+next\($',
"if MYPY:",
"if TYPE_CHECKING:",
'^\s+\.\.\.$',
'^\s+pass$'
]
ignore_errors = true
[tool.mypy]
python_version = "3.11"
check_untyped_defs = true
no_implicit_optional = true
strict_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
disallow_untyped_defs = true
[[tool.mypy.overrides]]
module = [
"graphql.pyutils.frozen_dict",
"graphql.pyutils.frozen_list",
"graphql.type.introspection",
"tests.*"
]
disallow_untyped_defs = false
[tool.pytest.ini_options]
minversion = "7.4"
# Only run benchmarks as tests.
# To actually run the benchmarks, use --benchmark-enable on the command line.
# To run the slow tests (fuzzing), add --run-slow on the command line.
addopts = "--benchmark-disable"
# Deactivate default name pattern for test classes (we use pytest_describe).
python_classes = "PyTest*"
# Handle all async fixtures and tests automatically by asyncio
asyncio_mode = "auto"
# Set a timeout in seconds for aborting tests that run too long.
timeout = "100"
# Ignore config options not (yet) available in older Python versions.
filterwarnings = "ignore::pytest.PytestConfigWarning"
[build-system]
requires = ["poetry_core>=1.6.1,<2"]
build-backend = "poetry.core.masonry.api"