-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
391 lines (356 loc) · 10.5 KB
/
pyproject.toml
File metadata and controls
391 lines (356 loc) · 10.5 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
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
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "metainformant"
version = "0.3.0"
description = "Comprehensive bioinformatics toolkit for multi-domain analysis"
readme = "README.md"
requires-python = ">=3.11"
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering :: Bio-Informatics",
]
dependencies = [
"setuptools",
"numpy>=1.24.0",
"pandas>=2.0.0",
"pyarrow>=14.0.0", # Parquet file format support
"matplotlib>=3.8.0",
"biopython>=1.81",
"requests>=2.31.0",
"pyyaml>=6.0",
"pytest-timeout>=2.4.0",
"beautifulsoup4>=4.12.0",
"scipy>=1.11.0",
"networkx>=3.2", # Network analysis - required for Networks module
"scikit-learn>=1.3.0", # ML - required for multiomics integration
"psutil>=7.2.1",
"rich>=14.2.0",
"statsmodels>=0.14.0",
"seaborn>=0.13.0",
]
[project.optional-dependencies]
# Core scientific dependencies
scientific = [
"scipy>=1.11.0",
"scikit-learn>=1.3.0",
"seaborn>=0.13.0",
"networkx>=3.2",
"numba>=0.59.0", # JIT compilation, must be >=0.59 for Python 3.12
"llvmlite>=0.43.0", # Required by numba, must be >=0.43 for Python 3.12
"umap-learn>=0.5.4",
"scanpy>=1.9.6", # Single-cell analysis
"anndata>=0.10.0", # Annotated data structures
]
# Machine learning and advanced analytics
ml = [
"scipy>=1.11.0",
"scikit-learn>=1.3.0",
"numba>=0.59.0", # Required by umap-learn, must be >=0.59 for Python 3.12
"umap-learn>=0.5.4",
"optuna>=3.4.0", # Hyperparameter optimization
"joblib>=1.3.0", # Parallel processing
"xgboost>=2.0.0", # Gradient boosting
"lightgbm>=4.1.0", # Light gradient boosting
]
# Network analysis
networks = [
"networkx>=3.2",
"python-louvain>=0.16", # Community detection
"cdlib>=0.3.0", # Community discovery library
# "graph-tool", # High-performance graph analysis (system dependent - install manually if needed)
]
# Terminal User Interface
tui = [
"psutil>=5.9.0",
"rich>=13.0.0",
]
# Single-cell analysis
singlecell = [
"scanpy>=1.9.6",
"anndata>=0.10.0",
"scipy>=1.11.0",
"scikit-learn>=1.3.0",
"numba>=0.59.0", # Required by umap-learn, must be >=0.59 for Python 3.12
"umap-learn>=0.5.4",
"seaborn>=0.13.0",
"leidenalg>=0.10.0", # Leiden clustering
"louvain>=0.8.0", # Louvain clustering
]
# Visualization enhancements
visualization = [
"seaborn>=0.13.0",
"plotly>=5.18.0",
"bokeh>=3.3.0",
"altair>=5.2.0",
"graphviz>=0.20.1", # Network visualization
]
# Development and testing
dev = [
"pytest>=8.0.0",
"pytest-cov>=4.1.0",
"pytest-xdist>=3.5.0", # For parallel test execution
"pytest-benchmark>=4.0.0", # Performance benchmarking
"pytest-asyncio>=0.23.0", # Async test support
"pytest-mock>=3.12.0", # Mock detection for NO_MOCKING_POLICY enforcement
"pytest-repeat>=0.9.3", # For flaky test detection
"pytest-rerunfailures>=13.0", # For retrying failed tests
"pytest-clarity>=1.0.1", # Better assertion output
"black>=24.1.0",
"isort>=5.13.0",
"flake8>=7.0.0",
"mypy>=1.8.0",
"bandit>=1.7.0", # Security linting
"safety>=3.0.0", # Dependency vulnerability scanning
"pre-commit>=3.6.0",
"sphinx>=7.2.0", # Documentation
"sphinx-rtd-theme>=2.0.0", # Read the Docs theme
"sphinx-autodoc-typehints>=1.25.0",
"myst-parser>=2.0.0", # Markdown support in docs
"jupyter>=1.0.0", # For example notebooks
"nbsphinx>=0.9.0", # Jupyter notebook integration
"twine>=5.0.0", # Package publishing
"build>=1.0.0", # Package building
]
# Database and external data
database = [
"psycopg2-binary>=2.9.0",
"sqlalchemy>=2.0.0",
"pymongo>=4.0.0", # MongoDB support
"redis>=4.3.0", # Redis caching
]
# External bioinformatics tools integration
external-tools = [
# "ncbi-datasets-pylib>=16.0.0", # Temporarily disabled
# "pyvcf>=0.6.8", # VCF file handling - temporarily disabled due to build issues
"pysam>=0.21.0", # SAM/BAM file handling
"dendropy>=4.5.0", # Phylogenetic analysis
]
# Web scraping and data collection
scraping = [
"cloudscraper>=1.2.71", # Cloudflare bypass for web scraping
]
# Performance and parallel computing
performance = [
"numba>=0.59.0", # JIT compilation, must be >=0.59 for Python 3.12
"dask>=2022.8.0", # Parallel computing
"ray>=2.0.0", # Distributed computing
"joblib>=1.2.0", # Parallel processing
]
# All optional dependencies combined
all = [
"scipy>=1.11.0",
"scikit-learn>=1.3.0",
"seaborn>=0.13.0",
"networkx>=3.2",
"umap-learn>=0.5.4",
"scanpy>=1.9.6",
"anndata>=0.10.0",
"python-louvain>=0.16",
"cdlib>=0.3.0",
"plotly>=5.18.0",
"bokeh>=3.3.0",
"altair>=5.2.0",
"psycopg2-binary>=2.9.9",
"sqlalchemy>=2.0.25",
# "ncbi-datasets-pylib>=16.0.0",
"numba>=0.59.0",
"dask>=2024.1.0",
"joblib>=1.3.0",
"cloudscraper>=1.2.71", # Web scraping with Cloudflare bypass
]
[project.scripts]
metainformant = "metainformant.__main__:main"
# Test configuration - STRICTLY NO MOCKING POLICY
[tool.pytest.ini_options]
minversion = "7.0"
testpaths = ["tests"]
addopts = [
"-ra", # Show short test summary for all except passes
"--strict-markers",
"--strict-config",
# Coverage disabled for faster test runs - enable with: --cov=src/metainformant
# "--cov=src/metainformant", # Coverage for source code
# "--cov-report=term-missing", # Show missing lines in terminal
# "--cov-report=html", # Generate HTML coverage report
# "--cov-report=xml", # Generate XML coverage report for CI
# "--cov-fail-under=85", # Fail if coverage below 85%
# Note: timeout can be set via command line: --timeout=300
# Default timeout of 10 seconds for fast tests (can be overridden for slow tests)
# For faster runs, exclude slow tests: -m "not slow"
]
# timeout = 10 # Commented out - requires pytest-timeout plugin
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"network: marks tests requiring network access - REAL API CALLS ONLY",
"external_tool: marks tests requiring external tools (muscle, amalgkit, etc.)",
"integration: marks tests as integration tests with real implementations",
"no_mock: enforces that NO mocking/faking is allowed in any test",
]
filterwarnings = [
"error",
"ignore::DeprecationWarning",
"ignore::PendingDeprecationWarning",
"ignore::UserWarning",
"ignore::RuntimeWarning",
"ignore::ImportWarning:umap.*", # Ignore umap tensorflow import warning
# Warn about any mock usage as it violates our policy
"error::pytest.PytestUnraisableExceptionWarning:.*mock.*",
]
# Coverage configuration
[tool.coverage.run]
source = ["src/metainformant"]
branch = true # Enable branch coverage
omit = [
"*/tests/*",
"*/test_*.py",
"*/__pycache__/*",
"*/venv/*",
"*/.venv/*",
"*/site-packages/*",
"*/conftest.py",
"*/__main__.py", # CLI entry points often hard to test comprehensively
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"def __str__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"@abstractmethod",
]
show_missing = true
skip_covered = false
precision = 2
[tool.coverage.html]
directory = "output/coverage_html"
[tool.coverage.xml]
output = "output/coverage.xml"
# Black code formatting
[tool.black]
line-length = 120
target-version = ['py311', 'py312']
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
'''
# Flake8 code quality
[tool.flake8]
max-line-length = 120
extend-ignore = ["E203", "W503"]
exclude = [
".git",
"__pycache__",
"build",
"dist",
"*.egg-info",
".venv",
"venv",
"env",
"ENV",
".tox",
".mypy_cache",
".pytest_cache",
]
# Allow imports not at top of file in __init__.py files
per-file-ignores = [
"__init__.py:E402",
]
# isort import sorting
[tool.isort]
profile = "black"
line_length = 120
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
# MyPy type checking
[tool.mypy]
python_version = "3.11"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
strict_equality = true
# Per-module type checking options
[[tool.mypy.overrides]]
module = [
"Bio.*",
"matplotlib.*",
"pandas.*",
"numpy.*",
"sklearn.*",
"requests.*",
]
ignore_missing_imports = true
# Setuptools configuration
[tool.setuptools.packages.find]
where = ["src"]
[tool.setuptools.package-dir]
"" = "src"
# UV configuration for fast, reliable dependency management
[tool.uv]
# Use the system's Python interpreter if needed
python-preference = "managed"
# Enable dependency caching for faster installs
# Note: On FAT filesystems (exFAT, FAT32) without symlink support, setup scripts
# automatically override this to use /tmp/uv-cache via UV_CACHE_DIR environment variable.
# The filesystem detection utilities in metainformant.core.filesystem handle this automatically.
cache-dir = ".uv-cache"
[tool.uv.workspace]
members = []
[dependency-groups]
dev = [
"pre-commit>=4.3.0",
]
# Test dependency groups for different test scenarios
test-fast = [
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
]
test-network = [
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
"requests>=2.25.0",
]
test-external = [
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
]
test-all = [
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
"pytest-xdist>=3.0.0", # For parallel test execution
"pytest-benchmark>=4.0.0", # Performance benchmarking
"pytest-asyncio>=0.21.0", # Async test support
"pytest-mock>=3.11.0", # Mock detection for NO_MOCKING_POLICY enforcement
"pytest-repeat>=0.9.1", # For flaky test detection
"pytest-rerunfailures>=11.1.0", # For retrying failed tests
"pytest-clarity>=1.0.1", # Better assertion output
]
# Note: UV task runner scripts would go here when supported in future versions