forked from python-graphblas/python-graphblas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
446 lines (419 loc) · 16.1 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
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools >=64",
"setuptools-git-versioning",
]
[project]
name = "python-graphblas"
dynamic = ["version"]
description = "Python library for GraphBLAS: high-performance sparse linear algebra for scalable graph analytics"
readme = "README.md"
requires-python = ">=3.8"
license = {file = "LICENSE"}
authors = [
{name = "Erik Welch", email = "[email protected]"},
{name = "Jim Kitchen"},
{name = "Python-graphblas contributors"},
]
maintainers = [
{name = "Erik Welch", email = "[email protected]"},
{name = "Jim Kitchen", email = "[email protected]"},
{name = "Sultan Orazbayev", email = "[email protected]"},
]
keywords = [
"graphblas",
"graph",
"sparse",
"matrix",
"lagraph",
"suitesparse",
"Networks",
"Graph Theory",
"Mathematics",
"network",
"discrete mathematics",
"math",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: Apache Software License",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3 :: Only",
"Intended Audience :: Developers",
"Intended Audience :: Other Audience",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"numpy >=1.21",
"donfig >=0.6",
"pyyaml >=5.4",
# These won't be installed by default after 2024.3.0
# Use e.g. "python-graphblas[suitesparse]" or "python-graphblas[default]" instead
"suitesparse-graphblas >=7.4.0.0, <7.5",
"numba >=0.55; python_version<'3.11'", # make optional where numba is not supported
]
[project.urls]
homepage = "https://github.com/python-graphblas/python-graphblas"
documentation = "https://python-graphblas.readthedocs.io"
repository = "https://github.com/python-graphblas/python-graphblas"
changelog = "https://github.com/python-graphblas/python-graphblas/releases"
[project.optional-dependencies]
suitesparse = [
"suitesparse-graphblas >=7.4.0.0, <7.5",
]
networkx = [
"networkx >=2.8",
]
numba = [
"numba >=0.55",
]
pandas = [
"pandas >=1.2",
]
scipy = [
"scipy >=1.8",
]
suitesparse-udf = [ # udf requires numba
"python-graphblas[suitesparse,numba]",
]
repr = [
"python-graphblas[pandas]",
]
io = [
"python-graphblas[networkx,scipy]",
"python-graphblas[numba]; python_version<'3.11'",
"awkward >=1.9",
"sparse >=0.13; python_version<'3.11'", # make optional, b/c sparse needs numba
"fast-matrix-market >=1.4.5",
]
viz = [
"python-graphblas[networkx,scipy]",
"matplotlib >=3.5",
]
datashade = [ # datashade requires numba
"python-graphblas[numba,pandas,scipy]",
"datashader >=0.12",
"hvplot >=0.7",
]
test = [
"python-graphblas[suitesparse,pandas,scipy]",
"packaging >=21",
"pytest >=6.2",
"tomli >=1",
]
default = [
"python-graphblas[suitesparse,pandas,scipy]",
"python-graphblas[numba]; python_version<'3.11'", # make optional where numba is not supported
]
complete = [
"python-graphblas[default,io,viz,test]",
"python-graphblas[datashade]; python_version<'3.11'", # make optional, b/c datashade needs numba
]
[tool.setuptools]
# Let's be explicit
# $ python -c 'from setuptools import find_packages ; [print(x) for x in sorted(find_packages())]'
# $ find graphblas/ -name __init__.py -print | sort | sed -e 's/\/__init__.py//g' -e 's/\//./g'
# $ python -c 'import tomli ; [print(x) for x in sorted(tomli.load(open("pyproject.toml", "rb"))["tool"]["setuptools"]["packages"])]'
packages = [
"graphblas",
"graphblas.agg",
"graphblas.binary",
"graphblas.core",
"graphblas.core.operator",
"graphblas.core.ss",
"graphblas.indexunary",
"graphblas.monoid",
"graphblas.op",
"graphblas.semiring",
"graphblas.select",
"graphblas.ss",
"graphblas.tests",
"graphblas.unary",
]
[tool.setuptools-git-versioning]
enabled = true
dev_template = "{tag}+{ccount}.g{sha}"
dirty_template = "{tag}+{ccount}.g{sha}.dirty"
[tool.black]
line-length = 100
target-version = ["py38", "py39", "py310", "py311"]
[tool.isort]
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
profile = "black"
skip_gitignore = true
float_to_top = true
default_section = "THIRDPARTY"
known_first_party = "graphblas"
line_length = 100
[tool.pytest.ini_options]
testpaths = "graphblas/tests"
xfail_strict = true
markers = [
"slow: Skipped unless --runslow passed",
]
filterwarnings = [
# See: https://docs.python.org/3/library/warnings.html#describing-warning-filters
# and: https://docs.pytest.org/en/7.2.x/how-to/capture-warnings.html#controlling-warnings
"error",
# sparse 0.14.0 (2022-02-24) began raising this warning; it has been reported and fixed upstream.
"ignore:coords should be an ndarray. This will raise a ValueError:DeprecationWarning:sparse._coo.core",
# setuptools v67.3.0 deprecated `pkg_resources.declare_namespace` on 13 Feb 2023. See:
# https://setuptools.pypa.io/en/latest/history.html#v67-3-0
# MAINT: check if this is still necessary in 2025
"ignore:Deprecated call to `pkg_resources.declare_namespace:DeprecationWarning:pkg_resources",
# And this deprecation warning was added in setuptools v67.5.0 (8 Mar 2023). See:
# https://setuptools.pypa.io/en/latest/history.html#v67-5-0
"ignore:pkg_resources is deprecated as an API:DeprecationWarning:pkg_resources",
# sre_parse deprecated in 3.11; this is triggered by awkward 0.10
"ignore:module 'sre_parse' is deprecated:DeprecationWarning:",
"ignore:module 'sre_constants' is deprecated:DeprecationWarning:",
# pypy gives this warning
"ignore:can't resolve package from __spec__ or __package__:ImportWarning:",
]
[tool.coverage.run]
branch = true
source = ["graphblas"]
omit = [
"graphblas/viz.py", # TODO: test and get coverage for viz.py
]
[tool.coverage.report]
ignore_errors = false
precision = 1
fail_under = 0
skip_covered = true
skip_empty = true
exclude_lines = [
"pragma: no cover",
"raise AssertionError",
"raise NotImplementedError",
]
[tool.codespell]
ignore-words-list = "coo,ba"
[tool.ruff]
# https://github.com/charliermarsh/ruff/
line-length = 100
target-version = "py38"
select = [
# Have we enabled too many checks that they'll become a nuisance? We'll see...
"F", # pyflakes
"E", # pycodestyle Error
"W", # pycodestyle Warning
# "C90", # mccabe (Too strict, but maybe we should make things less complex)
# "I", # isort (Should we replace `isort` with this?)
"N", # pep8-naming
"D", # pydocstyle
"UP", # pyupgrade
"YTT", # flake8-2020
# "ANN", # flake8-annotations (We don't use annotations yet)
"S", # bandit
# "BLE", # flake8-blind-except (Maybe consider)
# "FBT", # flake8-boolean-trap (Why?)
"B", # flake8-bugbear
"A", # flake8-builtins
"COM", # flake8-commas
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"T10", # flake8-debugger
# "DJ", # flake8-django (We don't use django)
# "EM", # flake8-errmsg (Perhaps nicer, but too much work)
"EXE", # flake8-executable
"ISC", # flake8-implicit-str-concat
# "ICN", # flake8-import-conventions (Doesn't allow "_" prefix such as `_np`)
"G", # flake8-logging-format
"INP", # flake8-no-pep420
"PIE", # flake8-pie
"T20", # flake8-print
# "PYI", # flake8-pyi (We don't have stub files yet)
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RSE", # flake8-raise
"RET", # flake8-return
# "SLF", # flake8-self (We can use our own private variables--sheesh!)
"SIM", # flake8-simplify
# "TID", # flake8-tidy-imports (Rely on isort and our own judgement)
# "TCH", # flake8-type-checking (Note: figure out type checking later)
# "ARG", # flake8-unused-arguments (Sometimes helpful, but too strict)
"PTH", # flake8-use-pathlib (Often better, but not always)
# "ERA", # eradicate (We like code in comments!)
# "PD", # pandas-vet (Intended for scripts that use pandas, not libraries)
"PGH", # pygrep-hooks
"PL", # pylint
"PLC", # pylint Convention
"PLE", # pylint Error
"PLR", # pylint Refactor
"PLW", # pylint Warning
"TRY", # tryceratops
"NPY", # NumPy-specific rules
"RUF", # ruff-specific rules
"ALL", # Try new categories by default (making the above list unnecessary)
]
external = [
# noqa codes that ruff doesn't know about: https://github.com/charliermarsh/ruff#external
]
ignore = [
# Would be nice to fix these
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
# "D107", # Missing docstring in `__init__`
"D205", # 1 blank line required between summary line and description
"D401", # First line of docstring should be in imperative mood:
# "D417", # Missing argument description in the docstring:
"PLE0605", # Invalid format for `__all__`, must be `tuple` or `list` (Note: broken in v0.0.237)
# Maybe consider
# "SIM300", # Yoda conditions are discouraged, use ... instead (Note: we're not this picky)
# "SIM401", # Use dict.get ... instead of if-else-block (Note: if-else better for coverage and sometimes clearer)
"TRY004", # Prefer `TypeError` exception for invalid type (Note: good advice, but not worth the nuisance)
"TRY200", # Use `raise from` to specify exception cause (Note: sometimes okay to raise original exception)
# Intentionally ignored
"COM812", # Trailing comma missing
"D203", # 1 blank line required before class docstring (Note: conflicts with D211, which is preferred)
"D400", # First line should end with a period (Note: prefer D415, which also allows "?" and "!")
"N801", # Class name ... should use CapWords convention (Note:we have a few exceptions to this)
"N802", # Function name ... should be lowercase
"N803", # Argument name ... should be lowercase (Maybe okay--except in tests)
"N806", # Variable ... in function should be lowercase
"N807", # Function name should not start and end with `__`
"N818", # Exception name ... should be named with an Error suffix (Note: good advice)
"PLR0911", # Too many return statements
"PLR0912", # Too many branches
"PLR0913", # Too many arguments to function call
"PLR0915", # Too many statements
"PLR2004", # Magic number used in comparison, consider replacing magic with a constant variable
"PLW0603", # Using the global statement to update ... is discouraged (Note: yeah, discouraged, but too strict)
"PLW2901", # Outer for loop variable ... overwritten by inner assignment target (Note: good advice, but too strict)
"RET502", # Do not implicitly `return None` in function able to return non-`None` value
"RET503", # Missing explicit `return` at the end of function able to return non-`None` value
"RET504", # Unnecessary variable assignment before `return` statement
"S110", # `try`-`except`-`pass` detected, consider logging the exception (Note: good advice, but we don't log)
"S112", # `try`-`except`-`continue` detected, consider logging the exception (Note: good advice, but we don't log)
"SIM102", # Use a single `if` statement instead of nested `if` statements (Note: often necessary)
"SIM105", # Use contextlib.suppress(...) instead of try-except-pass (Note: try-except-pass is much faster)
"SIM108", # Use ternary operator ... instead of if-else-block (Note: if-else better for coverage and sometimes clearer)
"TRY003", # Avoid specifying long messages outside the exception class (Note: why?)
# Ignored categories
"C90", # mccabe (Too strict, but maybe we should make things less complex)
"I", # isort (Should we replace `isort` with this?)
"ANN", # flake8-annotations (We don't use annotations yet)
"BLE", # flake8-blind-except (Maybe consider)
"FBT", # flake8-boolean-trap (Why?)
"DJ", # flake8-django (We don't use django)
"EM", # flake8-errmsg (Perhaps nicer, but too much work)
"ICN", # flake8-import-conventions (Doesn't allow "_" prefix such as `_np`)
"PYI", # flake8-pyi (We don't have stub files yet)
"SLF", # flake8-self (We can use our own private variables--sheesh!)
"TID", # flake8-tidy-imports (Rely on isort and our own judgement)
"TCH", # flake8-type-checking (Note: figure out type checking later)
"ARG", # flake8-unused-arguments (Sometimes helpful, but too strict)
"ERA", # eradicate (We like code in comments!)
"PD", # pandas-vet (Intended for scripts that use pandas, not libraries)
]
[tool.ruff.per-file-ignores]
"graphblas/core/agg.py" = ["F401", "F403"] # Deprecated
"graphblas/core/operator/base.py" = ["S102"] # exec is used for UDF
"graphblas/core/ss/matrix.py" = ["NPY002"] # numba doesn't support rng generator yet
"graphblas/core/ss/vector.py" = ["NPY002"] # numba doesn't support rng generator yet
"graphblas/ss/_core.py" = ["N999"] # We want _core.py to be underscopre
# Allow useless expressions, assert, pickle, RNG, print, no docstring, and yoda in tests
"graphblas/tests/*py" = ["B018", "S101", "S301", "S311", "T201", "D103", "D100", "SIM300"]
"graphblas/tests/test_formatting.py" = ["E501"] # Allow long lines
"graphblas/**/__init__.py" = ["F401"] # Allow unused imports (w/o defining `__all__`)
"scripts/*.py" = ["INP001"] # Not a package
"scripts/create_pickle.py" = ["F403", "F405"] # Allow `from foo import *`
"docs/*.py" = ["INP001"] # Not a package
[tool.ruff.flake8-builtins]
builtins-ignorelist = ["copyright", "format", "min", "max"]
[tool.ruff.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false
[tool.ruff.pydocstyle]
convention = "numpy"
[tool.pylint.messages_control]
# To run a single check, do: pylint graphblas --disable E,W,R,C,I --enable assignment-from-no-return
max-line-length = 100
py-version = "3.8"
enable = ["I"]
disable = [
# Error
"assignment-from-no-return",
# Warning
"arguments-differ",
"arguments-out-of-order",
"expression-not-assigned",
"fixme",
"global-statement",
"non-parent-init-called",
"redefined-builtin",
"redefined-outer-name",
"super-init-not-called",
"unbalanced-tuple-unpacking",
"unnecessary-lambda",
"unspecified-encoding",
"unused-argument",
"unused-variable",
# Refactor
"cyclic-import",
"duplicate-code",
"inconsistent-return-statements",
"too-few-public-methods",
# Convention
"missing-class-docstring",
"missing-function-docstring",
"missing-module-docstring",
"too-many-lines",
# Intentionally turned off
# error
"class-variable-slots-conflict",
"invalid-unary-operand-type",
"no-member",
"no-name-in-module",
"not-an-iterable",
"too-many-function-args",
"unexpected-keyword-arg",
# warning
"broad-except",
"pointless-statement",
"protected-access",
"undefined-loop-variable",
"unused-import",
# refactor
"comparison-with-itself",
"too-many-arguments",
"too-many-boolean-expressions",
"too-many-branches",
"too-many-instance-attributes",
"too-many-locals",
"too-many-nested-blocks",
"too-many-public-methods",
"too-many-return-statements",
"too-many-statements",
# convention
"import-outside-toplevel",
"invalid-name",
"line-too-long",
"singleton-comparison",
"single-string-used-for-slots",
"unidiomatic-typecheck",
"unnecessary-dunder-call",
"wrong-import-order",
"wrong-import-position",
# informative
"locally-disabled",
"suppressed-message",
]