-
Notifications
You must be signed in to change notification settings - Fork 4
/
pyproject.toml
272 lines (243 loc) · 10.3 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
# Copyright (c) 2023-2024, NVIDIA CORPORATION.
[build-system]
requires = [
"rapids-build-backend>=0.3.1,<0.4.0.dev0",
"setuptools>=61.0.0",
"wheel",
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit dependencies.yaml and run `rapids-dependency-file-generator`.
build-backend = "rapids_build_backend.build"
[project]
name = "nx-cugraph"
dynamic = ["version"]
description = "cugraph backend for NetworkX"
readme = { file = "README.md", content-type = "text/markdown" }
authors = [
{ name = "NVIDIA Corporation" },
]
license = { text = "Apache 2.0" }
requires-python = ">=3.10"
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: Apache Software License",
"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",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"cupy-cuda11x>=12.0.0",
"networkx>=3.0",
"numpy>=1.23,<3.0a0",
"pylibcugraph==24.12.*,>=0.0.0a0",
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit dependencies.yaml and run `rapids-dependency-file-generator`.
[project.optional-dependencies]
test = [
"cudf==24.12.*,>=0.0.0a0",
"pandas",
"pytest",
"pytest-benchmark",
"pytest-cov",
"pytest-mpl",
"pytest-xdist",
"scipy",
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit dependencies.yaml and run `rapids-dependency-file-generator`.
[project.urls]
Homepage = "https://github.com/rapidsai/nx-cugraph"
Documentation = "https://docs.rapids.ai/api/cugraph/stable/"
# "plugin" used in nx version < 3.2
[project.entry-points."networkx.plugins"]
cugraph = "nx_cugraph.interface:BackendInterface"
[project.entry-points."networkx.plugin_info"]
cugraph = "_nx_cugraph:get_info"
# "backend" used in nx version >= 3.2
[project.entry-points."networkx.backends"]
cugraph = "nx_cugraph.interface:BackendInterface"
[project.entry-points."networkx.backend_info"]
cugraph = "_nx_cugraph:get_info"
[tool.setuptools]
license-files = ["LICENSE"]
[tool.setuptools.dynamic]
version = {file = "_nx_cugraph/VERSION"}
[tool.setuptools.packages.find]
include = [
"nx_cugraph*",
"nx_cugraph.*",
"_nx_cugraph*",
"_nx_cugraph.*",
]
[tool.rapids-build-backend]
build-backend = "setuptools.build_meta"
commit-files = ["_nx_cugraph/GIT_COMMIT"]
dependencies-file = "dependencies.yaml"
matrix-entry = "cuda_suffixed=true"
[tool.black]
line-length = 88
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 = "nx_cugraph"
line_length = 88
extend_skip_glob = [
"nx_cugraph/__init__.py",
"nx_cugraph/classes/__init__.py",
]
[tool.pytest.ini_options]
minversion = "6.0"
testpaths = "nx_cugraph/tests"
xfail_strict = true
markers = [
"slow: Skipped unless --runslow passed",
]
log_cli_level = "info"
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",
]
python_files = [
"bench_*.py",
"test_*.py",
]
python_functions = [
"bench_*",
"test_*",
]
addopts = [
"--strict-config", # Force error if config is mispelled
"--strict-markers", # Force error if marker is mispelled (must be defined in config)
# "-ra", # Print summary of all fails/errors
"--benchmark-warmup=off",
"--benchmark-max-time=0",
"--benchmark-min-rounds=1",
"--benchmark-columns=min,median,max",
]
[tool.coverage.run]
branch = true
source = ["nx_cugraph"]
omit = []
[tool.coverage.report]
ignore_errors = false
precision = 1
fail_under = 0
skip_covered = false # Nice to see fully covered files when running `run_nx_tests.sh`
skip_empty = true
exclude_lines = [
"pragma: no cover",
"raise AssertionError",
"raise NotImplementedError",
]
[tool.pydistcheck]
select = [
"distro-too-large-compressed",
]
# PyPI limit is 100 MiB, fail CI before we get too close to that
max_allowed_size_compressed = '75M'
[tool.ruff]
# https://github.com/charliermarsh/ruff/
line-length = 88
target-version = "py310"
[tool.ruff.lint]
unfixable = [
"F841", # unused-variable (Note: can leave useless expression)
"B905", # zip-without-explicit-strict (Note: prefer `zip(x, y, strict=True)`)
]
select = [
"ALL",
]
external = [
# noqa codes that ruff doesn't know about: https://github.com/charliermarsh/ruff#external
]
ignore = [
# Would be nice to fix these
"B905", # `zip()` without an explicit `strict=` parameter (Note: possible since py39 was dropped; we should do this!)
"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
# 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)
"B020", # Found for loop that reassigns the iterable it is iterating with each iterable value (too strict)
"B904", # Bare `raise` inside exception clause (like TRY200; sometimes okay)
"S310", # Audit URL open for permitted schemes (Note: we don't download URLs in normal usage)
# Intentionally ignored
"A003", # Class attribute ... is shadowing a python builtin
"ANN101", # Missing type annotation for `self` in method
"ARG004", # Unused static method argument: `...`
"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)
"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
"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
"RUF018", # Avoid assignment expressions in `assert` statements
"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?)
"UP038", # Use `X | Y` in `isinstance` call instead of `(X, Y)` (Note: tuple is faster for now)
# 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
"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
"ARG", # flake8-unused-arguments (Sometimes helpful, but too strict)
"TD", # flake8-todos (Maybe okay to add some of these)
"FIX", # flake8-fixme (like flake8-todos)
"ERA", # eradicate (We like code in comments!)
"PD", # pandas-vet (Intended for scripts that use pandas, not libraries)
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # Allow unused imports (w/o defining `__all__`)
# Allow assert, print, RNG, and no docstring
"nx_cugraph/**/tests/*py" = ["S101", "S311", "T201", "D103", "D100"]
"_nx_cugraph/__init__.py" = ["E501"]
"nx_cugraph/__init__.py" = ["E402"] # Allow module level import not at top of file
"nx_cugraph/algorithms/**/*py" = ["D205", "D401"] # Allow flexible docstrings for algorithms
"nx_cugraph/generators/**/*py" = ["D205", "D401"] # Allow flexible docstrings for generators
"nx_cugraph/interface.py" = ["D401"] # Flexible docstrings
"nx_cugraph/convert.py" = ["E721"] # Allow `dtype == object`
"scripts/update_readme.py" = ["INP001"] # Not part of a package
[tool.ruff.lint.flake8-annotations]
mypy-init-return = true
[tool.ruff.lint.flake8-builtins]
builtins-ignorelist = ["copyright"]
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false
[tool.ruff.lint.pydocstyle]
convention = "numpy"