-
Notifications
You must be signed in to change notification settings - Fork 187
/
pyproject.toml
298 lines (267 loc) · 7.49 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
# Copyright (c) "Neo4j"
# Neo4j Sweden AB [https://neo4j.com]
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
[project]
name = "neo4j"
description = "Neo4j Bolt driver for Python"
license = {text = "Apache License, Version 2.0"}
#TODO: 6.0 - static readme
#readme = "README.rst"
authors = [
{name = "Neo4j, Inc.", email = "[email protected]"},
]
dependencies = ["pytz"]
requires-python = ">=3.7"
keywords = ["neo4j", "graph", "database"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Framework :: AsyncIO",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"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",
"Programming Language :: Python :: 3.13",
"Topic :: Database",
"Topic :: Software Development",
"Typing :: Typed",
]
dynamic = ["version", "readme"]
[project.urls]
Homepage = "https://neo4j.com/"
Repository = "https://github.com/neo4j/neo4j-python-driver"
"Docs (Manual)" = "https://neo4j.com/docs/python-manual/current/"
"Docs (API Reference)" = "https://neo4j.com/docs/api/python-driver/current/"
"Issue Tracker" = "https://github.com/neo4j/neo4j-python-driver/issues"
Changelog = "https://github.com/neo4j/neo4j-python-driver/wiki"
Forum = "https://community.neo4j.com/c/drivers-stacks/python/"
Discord = "https://discord.com/invite/neo4j"
[project.optional-dependencies]
numpy = ["numpy >= 1.7.0, < 3.0.0"]
pandas = [
"pandas >= 1.1.0, < 3.0.0",
"numpy >= 1.7.0, < 3.0.0",
]
pyarrow = ["pyarrow >= 1.0.0"]
[build-system]
requires = [
"setuptools == 68.0.0; python_version <= '3.7'", # dropped support for Python 3.7 in 68.1.0
"setuptools == 75.3.0; python_version == '3.8'", # dropped support for Python 3.8 in 75.4.0
"setuptools == 75.6.0; python_version >= '3.9'",
# TODO: 6.0 - can be removed once `setup.py` is simplified
"tomlkit == 0.12.5", # dropped support (at least CI testing) for Python 3.7 in 0.13.0
]
build-backend = "setuptools.build_meta"
[tool.setuptools.dynamic]
version = {attr = "neo4j._meta.version"}
[tool.coverage]
show_missing = true
[tool.coverage.run]
branch = true
omit = [
".*/*",
"tests/*",
"src/neo4j/meta.py",
"*virtualenv*",
"*venv*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"except ImportError",
]
[tool.isort]
combine_as_imports = true
ensure_newline_before_comments = true
force_grid_wrap = 2
# breaks order of relative imports
# https://github.com/PyCQA/isort/issues/1944
#force_sort_within_sections = true
include_trailing_comma = true
# currently broken
# https://github.com/PyCQA/isort/issues/1855
#lines_before_imports = 2
lines_after_imports = 2
lines_between_sections = 1
multi_line_output = 3
order_by_type = false
remove_redundant_aliases = true
use_parentheses = true
[tool.pytest.ini_options]
mock_use_standalone_module = true
asyncio_mode = "auto"
[tool.mypy]
[[tool.mypy.overrides]]
module = [
"pandas.*",
"neo4j._codec.packstream._rust",
"neo4j._codec.packstream._rust.*",
]
ignore_missing_imports = true
[tool.ruff]
line-length = 79
extend-exclude = [
"src/neo4j/_sync",
"tests/unit/sync",
"tests/integration/sync",
"testkitbackend/_sync",
]
[tool.ruff.lint]
preview = true # to get CPY lints
extend-ignore = [
"RUF002", # allow ’ (RIGHT SINGLE QUOTATION MARK) to be used as an apostrophe (e.g. "it’s")
"SIM117", # TODO: when Python 3.10+ is the minimum,
# we can start to use multi-item `with` statements
# pydocstyle
"D1", # disable check for undocumented items (way too noisy)
"D203", # `one-blank-line-before-class`
"D212", # `multi-line-summary-first-line`
# comprehensions
"C417", # map is ok, no need to rewrite to list comprehension
# too noisy and opinionated pytest lints
"PT007",
"PT011",
"PT012",
"PT018",
# too noisy and opinionated pylint lints
"PLC0415",
"PLC1901",
"PLC2401",
"PLC2701",
"PLR09",
"PLR1702",
"PLR1704",
"PLR2004",
"PLR6301",
"PLW2901",
"PLW1641",
# too noisy and opinionated tryceratops lints
"TRY003",
"TRY300",
"TRY301",
"TRY400",
# too noisy and opinionated return statement lints
"RET505",
"RET506",
"RET507",
"RET508",
"PERF203", # try-except within loop is fine. Especially in a retry scenario
# too noisy and opinionated FURB lints
"FURB113",
"FURB118",
"FURB140",
"FURB154",
# needs fixing in ruff to work with typing.Protocol
# https://github.com/astral-sh/ruff/issues/13307
"FURB180",
]
select = [
# ruff
"RUF",
# pycodestyle
"E",
"W",
# Pyflakes
"F",
# pyupgrade
"UP",
# flake8-bugbear
"B",
# flake8-simplify
"SIM",
# pep8-naming
"N",
# pydocstyle
"D",
# pydocstyle: explicit rules not selected by the chosen convention
"D404",
# Does not yet fully support sphinx style docstrings
# https://github.com/astral-sh/ruff/pull/13286
# # pydoclint
# "DOC",
# pylint
"PL",
# tryceratops
"TRY",
# flynt
"FLY",
# Perflint
"PERF",
# refurb
"FURB",
# async checks
"ASYNC",
# check comprehensions
"C4",
# check for left-over debugger calls
"T100",
# check for left-over print calls
"T20",
# qoute styles
"Q",
# check for unnecessary parantheses in raise statements
"RSE",
# check return statements
"RET",
# TODO: 6.0 - enable and add __slots__ to applicable classes
# # check __slots__ usage
# "SLOT",
# check type-checking usage
"TCH",
# copyright notice
"CPY",
# check shebangs
"EXE",
# logging calls + formats
"LOG",
"G",
# flake8-pie
"PIE",
# pytest lints
"PT",
]
[tool.ruff.lint.per-file-ignores]
"{testkit,testkitbackend,benchkit}/**" = [
"T20", # print statements are ok in the testing infrastructure
]
"tests/integration/examples/**" = [
"T20", # print statements are part of the examples
]
"tests/unit/**" = [
"PLW1641", # no need for production grade test code
"FURB152", # don't tell us to use math.pi, when all we need is just some random float
]
"{tests/unit,testkitbackend}/**" = [
# allow async functions without await to enable type checking, pretending to be async, matching type signatures
"RUF029",
]
"bin/**" = [
"T20", # print statements are ok in our helper scripts
]
[tool.ruff.lint.pycodestyle]
max-doc-length = 83 # 79 (max line length) + 4 indentation of code blocks
[tool.ruff.lint.pep8-naming]
extend-ignore-names = ["mcs"]
[tool.ruff.lint.flake8-copyright]
notice-rgx = "# Copyright \\(c\\) \"Neo4j\""
[tool.ruff.lint.pydocstyle]
convention = "pep257"