-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathpyproject.toml
More file actions
321 lines (303 loc) · 8.76 KB
/
Copy pathpyproject.toml
File metadata and controls
321 lines (303 loc) · 8.76 KB
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
[build-system]
requires = ["setuptools>=61.0", "wheel", "cython>=0.20"]
build-backend = "setuptools.build_meta"
[project]
name = "py3plex"
version = "2.0.1"
description = "A Multilayer network analysis python3 library"
readme = "README.md"
requires-python = ">=3.8"
license = {text = "MIT"}
authors = [
{name = "Blaž Škrlj", email = "blaz.skrlj@ijs.si"}
]
keywords = [
"network analysis",
"multilayer networks",
"heterogeneous networks",
"graph visualization",
"network science"
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"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.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Scientific/Engineering :: Visualization",
]
dependencies = [
"numpy>=1.19.0", # Minimum for Python 3.8+
"scipy>=1.5.0", # Minimum for Python 3.8+
"networkx>=2.5", # Already reasonable
"tqdm>=4.40.0", # Modern version with better features
"matplotlib>=3.3.0", # Minimum for Python 3.8+
"scikit-learn>=0.24.0", # Minimum for Python 3.8+
"bitarray>=2.0.0", # Already modern
"seaborn>=0.11.0", # Modern version
]
[project.optional-dependencies]
dev = [
"pytest>=7.0",
"pytest-timeout>=2.1",
"pytest-cov>=4.0",
"pytest-benchmark>=4.0,<5.0", # 5.0+ requires Python >=3.9, but we support 3.8
"pytest-rerunfailures>=12.0", # Flaky test handling
"black>=23.0",
"ruff>=0.1.0",
"mypy>=1.0",
"types-six>=1.16.0", # Type stubs for six library (mypy)
"pre-commit>=3.0",
"crosshair-tool>=0.0.60", # Formal verification
"icontract>=2.6.0", # Design by contract
"z3-solver>=4.12.0", # SMT solver for CrossHair
"hypothesis>=6.0", # Property-based testing
]
# Testing dependencies (for property-based and integration tests)
tests = [
"pytest>=7.0",
"pytest-timeout>=2.1",
"pytest-cov>=4.0",
"pytest-rerunfailures>=12.0", # Flaky test handling
"hypothesis>=6.0",
"hypothesis-networkx>=0.2.0", # Hypothesis strategies for NetworkX graphs
"networkx>=2.5",
"numpy>=1.19.0",
"scipy>=1.5.0",
"python-louvain>=0.16", # For community detection tests (optional, guarded)
]
# Optional: Infomap for advanced community detection
infomap = [
"infomap>=2.0.0",
]
# Optional: Additional algorithms (Louvain, label propagation)
algos = [
"python-louvain>=0.16",
"cdlib>=0.3.0",
"gensim>=4.0.0",
"rdflib>=6.0.0",
]
# Optional: Advanced visualization
viz = [
"plotly>=5.0.0",
"python-igraph>=0.10.0",
]
# Optional: Config-driven workflows with YAML support
workflows = [
"pyyaml>=5.1",
]
# Optional: Apache Arrow for high-performance serialization
arrow = [
"pyarrow>=10.0.0",
]
# Optional: Cross-compatibility conversion layer
compat = [
"networkx>=2.5",
"scipy>=1.5.0",
"pandas>=1.2.0",
"pyarrow>=10.0.0", # For parquet sidecar format
]
# Optional: igraph support for compat layer
igraph = [
"python-igraph>=0.10.0",
]
# Optional: PyTorch Geometric support for compat layer
pyg = [
"torch>=1.10.0",
"torch-geometric>=2.0.0",
]
# Optional: DGL support for compat layer
dgl_compat = [
"dgl>=0.9.0",
]
# Optional: MCP server for AI agent integration (requires Python >=3.10)
mcp = [
"mcp>=0.9.0; python_version>='3.10'",
]
# Optional: Dependencies for running advanced examples
examples = [
"sympy>=1.9",
]
# Convenience meta-extra for common optional features (without heavy ML backends)
optional = [
"infomap>=2.0.0",
"python-louvain>=0.16",
"cdlib>=0.3.0",
"gensim>=4.0.0",
"rdflib>=6.0.0",
"plotly>=5.0.0",
"python-igraph>=0.10.0",
"pyyaml>=5.1",
"pyarrow>=10.0.0",
"mcp>=0.9.0; python_version>='3.10'",
"sympy>=1.9",
]
[project.urls]
Homepage = "https://github.com/SkBlaz/py3plex"
Documentation = "https://skblaz.github.io/py3plex/"
Repository = "https://github.com/SkBlaz/py3plex"
"Bug Tracker" = "https://github.com/SkBlaz/py3plex/issues"
[project.scripts]
py3plex = "py3plex.cli:main"
py3plex-mcp = "py3plex_mcp.server:main"
[tool.setuptools]
zip-safe = false
include-package-data = true
[tool.setuptools.packages.find]
where = ["."]
include = ["py3plex*", "py3plex_mcp*"]
exclude = ["tests*", "docs*", "examples*"]
[tool.setuptools.exclude-package-data]
"*" = ["*.pyc", "*.pyo", "__pycache__/*"]
[tool.isort]
profile = "black"
line_length = 88
skip_gitignore = true
extend_skip = ["py3plex/algorithms/statistics/powerlaw.py"]
[tool.black]
line-length = 88
target-version = ['py38', 'py39', 'py310', 'py311', 'py312']
include = '\.pyi?$'
extend-exclude = '''
/(
# directories
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| build
| dist
| examples
# files
| py3plex/algorithms/statistics/powerlaw\.py
)/
'''
[tool.ruff]
line-length = 88
target-version = "py38"
extend-exclude = [
"examples",
"build",
"dist",
".eggs",
"py3plex/algorithms/statistics/powerlaw.py",
]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
# "I", # isort (disabled - using standalone isort instead)
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
]
ignore = [
"E501", # line too long (handled by black)
"B008", # do not perform function calls in argument defaults
"C901", # too complex (we have legacy code)
"W191", # indentation contains tabs (legacy code)
"F821", # undefined name (pre-existing bugs in unused code paths)
"F811", # redefined-while-unused (generated code in infomap bindings)
"E741", # ambiguous-variable-name (subjective, legacy code)
"B904", # raise-without-from-inside-except (Python 2 compatibility)
"E721", # type-comparison (legacy pattern, works correctly)
"B007", # unused-loop-control-variable (false positives in some cases)
"E402", # module-import-not-at-top-of-file (required for some conditional imports)
"UP031", # printf-string-formatting (legacy code, %formatting still valid Python)
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # Allow unused imports in __init__.py
[tool.mypy]
python_version = "3.10" # Keep aligned with type-coverage workflow runtime
warn_return_any = true
warn_unused_configs = true
ignore_missing_imports = true
disallow_untyped_defs = false # Set to true when type hints are complete
strict_optional = false
warn_redundant_casts = true
warn_unused_ignores = true
check_untyped_defs = false # Set to true when type hints are complete
exclude = [
'build/',
'dist/',
'.eggs/',
# Auto-generated SWIG bindings (many type errors, not maintainable)
'py3plex/algorithms/infomap/infomap\.py$',
'py3plex/algorithms/community_detection/infomap/infomap\.py$',
# Pre-existing syntax errors in powerlaw.py
'py3plex/algorithms/statistics/powerlaw\.py$',
]
[tool.pytest.ini_options]
testpaths = ["tests", "py3plex"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"-q",
"--tb=short",
"--strict-markers",
"--doctest-modules",
"--doctest-continue-on-failure",
]
markers = [
"property: property-based tests using Hypothesis",
"slow: potentially slow tests",
"integration: integration tests that require multiple components",
"unit: fast unit tests",
"metamorphic: metamorphic tests that verify invariants under transformations",
"fast: fast unit tests that run quickly",
"fuzz: fuzzing tests for discovering edge cases",
"cli: CLI command tests",
"verification: verification and correctness tests",
"flaky: tests that may fail intermittently (handled by pytest-rerunfailures)",
]
timeout = 300
doctest_optionflags = [
"NORMALIZE_WHITESPACE",
"ELLIPSIS",
"IGNORE_EXCEPTION_DETAIL",
]
norecursedirs = [
".git",
".hg",
".tox",
".venv",
"dist",
"build",
".hypothesis",
"py3plex/algorithms/community_detection/infomap",
]
[tool.coverage.run]
source = ["py3plex"]
omit = [
"*/tests/*",
"*/examples/*",
"*/build/*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"if verbose:",
"@abstractmethod",
]
[tool.hypothesis]
max_examples = 100
deadline = 500
[tool.mutmut]
paths_to_mutate = "py3plex/utils.py"
tests_dir = "tests/"
runner = "PYTHONPATH=/home/runner/work/py3plex/py3plex python -m pytest -x tests/test_utils.py tests/property/test_utils_properties.py"