-
Notifications
You must be signed in to change notification settings - Fork 4
/
pyproject.toml
271 lines (250 loc) · 10.7 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
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools >=64",
"setuptools-git-versioning",
]
[project]
name = "graphblas-algorithms"
dynamic = ["version"]
description = "Graph algorithms written in GraphBLAS and backend for NetworkX"
readme = "README.md"
requires-python = ">=3.10"
license = {file = "LICENSE"}
authors = [
{name = "Erik Welch", email = "erik.n.welch@gmail.com"},
{name = "Jim Kitchen"},
{name = "Graphblas-algorithms contributors"},
]
maintainers = [
{name = "Erik Welch", email = "erik.n.welch@gmail.com"},
{name = "Jim Kitchen", email = "jim22k@gmail.com"},
]
keywords = [
"graphblas",
"graph",
"sparse",
"matrix",
"lagraph",
"suitesparse",
"Networks",
"Graph Theory",
"Mathematics",
"network",
"discrete mathematics",
"math",
]
classifiers = [
"Development Status :: 4 - Beta",
"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.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3 :: Only",
"Intended Audience :: Developers",
"Intended Audience :: Other Audience",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"python-graphblas >=2023.1.0",
]
[project.entry-points."networkx.plugins"]
graphblas = "graphblas_algorithms.interface:Dispatcher"
[project.entry-points."networkx.backends"]
graphblas = "graphblas_algorithms.interface:Dispatcher"
[project.entry-points."networkx.backend_info"]
graphblas = "_nx_graphblas:get_info"
[project.urls]
homepage = "https://github.com/python-graphblas/graphblas-algorithms"
# documentation = "https://graphblas-algorithms.readthedocs.io"
repository = "https://github.com/python-graphblas/graphblas-algorithms"
changelog = "https://github.com/python-graphblas/graphblas-algorithms/releases"
[project.optional-dependencies]
test = [
"pytest",
"networkx >=3.0",
"scipy >=1.9",
"setuptools",
"tomli",
]
all = [
"graphblas-algorithms[test]",
]
[tool.setuptools]
# Let's be explicit (we test this too)
# TODO: it would be nice if setuptools (or our build backend) could handle this automatically and reliably.
# $ python -c 'from setuptools import find_packages ; [print(x) for x in sorted(find_packages())]'
# $ find graphblas_algorithms/ -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 = [
"_nx_graphblas",
"graphblas_algorithms",
"graphblas_algorithms.algorithms",
"graphblas_algorithms.algorithms.centrality",
"graphblas_algorithms.algorithms.community",
"graphblas_algorithms.algorithms.components",
"graphblas_algorithms.algorithms.isomorphism",
"graphblas_algorithms.algorithms.link_analysis",
"graphblas_algorithms.algorithms.operators",
"graphblas_algorithms.algorithms.shortest_paths",
"graphblas_algorithms.algorithms.tests",
"graphblas_algorithms.algorithms.traversal",
"graphblas_algorithms.classes",
"graphblas_algorithms.generators",
"graphblas_algorithms.linalg",
"graphblas_algorithms.nxapi",
"graphblas_algorithms.nxapi.centrality",
"graphblas_algorithms.nxapi.community",
"graphblas_algorithms.nxapi.components",
"graphblas_algorithms.nxapi.generators",
"graphblas_algorithms.nxapi.isomorphism",
"graphblas_algorithms.nxapi.linalg",
"graphblas_algorithms.nxapi.link_analysis",
"graphblas_algorithms.nxapi.operators",
"graphblas_algorithms.nxapi.shortest_paths",
"graphblas_algorithms.nxapi.tests",
"graphblas_algorithms.nxapi.traversal",
"graphblas_algorithms.tests",
"graphblas_algorithms.utils",
]
[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 = ["py310", "py311", "py312"]
[tool.isort]
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
profile = "black"
skip_gitignore = true
float_to_top = true
default_section = "THIRDPARTY"
known_first_party = "graphblas_algorithms"
line_length = 100
skip = [
"graphblas_algorithms/nxapi/__init__.py",
"scripts/bench.py",
]
[tool.pytest.ini_options]
minversion = "6.0"
testpaths = "graphblas_algorithms"
xfail_strict = false
markers = [
"checkstructure: Skipped unless --check-structure passed",
]
[tool.coverage.run]
branch = true
source = ["graphblas_algorithms"]
omit = []
[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.ruff]
# https://github.com/charliermarsh/ruff/
line-length = 100
target-version = "py310"
unfixable = [
"F841" # unused-variable (Note: can leave useless expression)
]
select = [
"ALL",
]
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__`
"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)
"UP038", # Use `X | Y` in `isinstance` call instead of `(X, Y)` (Note: using `|` seems to be slower)
# 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 "!")
"F403", # `from .classes import *` used; unable to detect undefined names (Note: used to match networkx)
"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
"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
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar` (Note: no annotations yet)
"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?)
"FIX001", "FIX002", "FIX003", "FIX004", # flake8-fixme (like flake8-todos)
# 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)
"TD", # flake8-todos (Maybe okay to add some of these)
"ERA", # eradicate (We like code in comments!)
"PD", # pandas-vet (Intended for scripts that use pandas, not libraries)
]
[tool.ruff.per-file-ignores]
"__init__.py" = ["F401"] # Allow unused imports (w/o defining `__all__`)
"graphblas_algorithms/**/tests/*py" = ["S101", "T201", "D103", "D100"] # Allow assert, print, and no docstring
"graphblas_algorithms/interface.py" = ["PIE794"] # Allow us to use `mod = nxapi.<module>` repeatedly
"graphblas_algorithms/nxapi/exception.py" = ["F401"] # Allow unused imports (w/o defining `__all__`)
"scripts/*.py" = ["INP001", "S101", "T201"] # Not a package, allow assert, allow print
[tool.ruff.flake8-builtins]
builtins-ignorelist = ["copyright"]
[tool.ruff.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false
[tool.ruff.pydocstyle]
convention = "numpy"