forked from curdriceaurora/Local-File-Organizer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
413 lines (374 loc) · 12.2 KB
/
pyproject.toml
File metadata and controls
413 lines (374 loc) · 12.2 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
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
[build-system]
requires = ["setuptools>=68.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "local-file-organizer"
version = "2.0.0-alpha.2"
description = "AI-powered local file management with state-of-the-art models"
authors = [
{name = "Local File Organizer Team", email = "noreply@example.com"}
]
readme = "README.md"
license = {text = "MIT OR Apache-2.0"}
requires-python = ">=3.11"
keywords = ["file-management", "ai", "organization", "local-llm", "privacy"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: MIT License",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Desktop Environment :: File Managers",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]
dependencies = [
# Core AI inference
"ollama>=0.1.0",
# File processing (core image only)
"Pillow>=10.0.0",
# NLP and data science
"nltk>=3.8.0",
"numpy>=1.24.0", # Numerical computing (used in dedup, video, optimization)
"tqdm>=4.66.0", # Progress bars (used in CLI dedup)
# CLI and UI
"typer[all]>=0.12.0",
"rich>=13.0.0",
"textual>=0.50.0",
# API and async
"fastapi>=0.109.0",
"starlette>=0.35.0", # Direct imports: BaseHTTPMiddleware, Response, WebSocketState
"aiofiles>=23.0.0", # Required by Starlette StaticFiles for async file serving
"jinja2>=3.1.0",
"uvicorn[standard]>=0.27.0",
"websockets>=12.0",
"httpx>=0.26.0",
"python-multipart>=0.0.9",
"python-jose>=3.3.0",
"passlib[bcrypt]>=1.7.4",
"bcrypt>=4.0.0,<5.0.0",
# Database
"sqlalchemy>=2.0.0",
"alembic>=1.13.0",
# Task queue
"redis>=5.0.0",
# Configuration
"pyyaml>=6.0.0", # YAML config parsing
"platformdirs>=3.0.0", # Cross-platform config/data directory resolution
# Utilities
"pydantic>=2.5.0",
"pydantic-settings>=2.1.0",
"email-validator>=2.1.0",
"python-dotenv>=1.0.0",
"click>=8.1.0",
"aiofiles>=23.0.0",
"watchdog>=3.0.0", # File system event handler
# System utilities
"psutil>=5.9.0", # System resource monitoring
# Logging
"loguru>=0.7.0",
]
[project.optional-dependencies]
parsers = [
"PyMuPDF>=1.23.0",
"python-docx>=1.0.0",
"openpyxl>=3.1.0",
"python-pptx>=0.6.0",
"ebooklib>=0.18",
"beautifulsoup4>=4.12.0",
"lxml>=4.9.0",
]
web = [
"fastapi>=0.109.0",
"jinja2>=3.1.0",
"uvicorn[standard]>=0.27.0",
"websockets>=12.0",
"httpx>=0.26.0",
"python-multipart>=0.0.9",
"python-jose>=3.3.0",
"passlib[bcrypt]>=1.7.4",
"bcrypt>=4.0.0,<5.0.0",
"redis>=5.0.0",
]
dev = [
"pytest>=7.4.0",
"pytest-asyncio>=0.23.0",
"pytest-cov>=4.1.0",
"pytest-mock>=3.12.0",
"pytest-timeout>=2.2.0",
"pytest-xdist>=3.5.0",
"pytest-randomly>=3.15.0",
"mypy>=1.8.0",
"types-PyYAML>=6.0.0",
"ruff>=0.1.0",
"black>=23.12.0",
"isort>=5.13.0",
"pre-commit>=3.6.0",
"codespell>=2.2.0",
"faker>=26.0",
"pytest-benchmark>=4.0",
"interrogate>=1.5.0", # Docstring coverage measurement
"pymarkdownlnt>=0.9.25", # Markdown linting
"deptry>=0.16.0", # Unused dependency detection
]
cloud = [
"openai>=1.0.0", # OpenAI-compatible API provider (OpenAI, Groq, LM Studio, vLLM)
]
gui = [
"PyQt6>=6.6.0",
]
audio = [
"faster-whisper>=1.0.0",
"torch>=2.1.0", # GPU acceleration for audio transcription
"mutagen>=1.47.0", # Audio metadata extraction
"tinytag>=1.10.0", # Lightweight audio metadata fallback
"pydub>=0.25.0", # Audio manipulation
]
video = [
"opencv-python>=4.8.0", # Video frame processing
"scenedetect[opencv]>=0.6.0", # Scene detection algorithms
]
dedup = [
"imagededup>=0.3.0", # Image similarity and duplicate detection
"scikit-learn>=1.4.0", # ML-based text similarity for deduplication
"PyPDF2>=3.0.0", # PDF text extraction fallback in dedup extractor
"striprtf>=0.0.26", # RTF file text extraction in dedup extractor
]
archive = [
"py7zr>=0.20.0", # 7Z archive support
"rarfile>=4.1", # RAR archive support (requires unrar tool)
]
scientific = [
"h5py>=3.10.0", # HDF5 file format support
"netCDF4>=1.6.5", # NetCDF file format support
"scipy>=1.11.0", # MATLAB .mat file support
]
cad = [
"ezdxf>=1.1.0", # DXF/DWG CAD file format support
]
build = [
"pyinstaller>=6.0.0", # Cross-platform executable packaging
]
docs = [
"mkdocs>=1.5.0",
"mkdocs-material>=9.5.0",
"pymdown-extensions>=10.7.0",
"mkdocs-minify-plugin>=0.8.0",
"mkdocstrings[python]>=0.24.0",
]
all = [
"local-file-organizer[dev,gui,cloud,audio,video,dedup,archive,scientific,cad,build,parsers,web]",
]
[project.scripts]
file-organizer = "file_organizer.cli:main"
fo = "file_organizer.cli:main" # Short alias
[project.urls]
Homepage = "https://github.com/curdriceaurora/Local-File-Organizer"
Documentation = "https://github.com/curdriceaurora/Local-File-Organizer#readme"
Repository = "https://github.com/curdriceaurora/Local-File-Organizer"
Issues = "https://github.com/curdriceaurora/Local-File-Organizer/issues"
Changelog = "https://github.com/curdriceaurora/Local-File-Organizer/releases"
[tool.setuptools.packages.find]
where = ["src"]
[tool.setuptools.package-data]
file_organizer = [
"py.typed",
"config/*.yaml",
"web/templates/**/*.html",
"web/static/**/*",
]
# Ruff configuration (linting and formatting)
[tool.ruff]
line-length = 100
target-version = "py311"
exclude = [
".claude/",
"technical-debt/",
"fix_coderabbit_issues.py",
"test_preference_tracker.py",
]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"C901", # mccabe complexity
"UP", # pyupgrade
"D", # pydocstyle (google convention)
"RUF100", # stale noqa comments
"DTZ", # datetime timezone rules (DTZ001-DTZ007, DTZ011-DTZ012)
]
ignore = [
"E501", # line too long (handled by formatter)
"B008", # do not perform function calls in argument defaults
"UP045", # type hint upgrades handled project-wide
"ANN401", # **kwargs: Any is acceptable in abstract/polymorphic interfaces
]
[tool.ruff.lint.mccabe]
max-complexity = 15
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
"tests/**/*.py" = ["D"]
"scripts/**/*.py" = ["D"]
"scripts/docker_utils.py" = ["D", "C901"]
# C901 ratchet baseline — functions exceeding complexity 15 (2026-02-28)
# Each entry allows existing complex functions; new ones must stay under 15.
"src/file_organizer/api/config.py" = ["C901"]
"src/file_organizer/cli/dedupe.py" = ["C901"]
"src/file_organizer/cli/undo_redo.py" = ["C901"]
"src/file_organizer/cli/utilities.py" = ["C901"]
"src/file_organizer/core/organizer.py" = ["C901"]
"src/file_organizer/methodologies/para/ai/suggestion_engine.py" = ["C901"]
"src/file_organizer/parallel/processor.py" = ["C901"]
"src/file_organizer/services/copilot/intent_parser.py" = ["C901"]
"src/file_organizer/services/intelligence/profile_importer.py" = ["C901"]
"src/file_organizer/services/intelligence/profile_merger.py" = ["C901"]
"src/file_organizer/services/intelligence/profile_migrator.py" = ["C901"]
"src/file_organizer/updater/installer.py" = ["C901"]
"src/file_organizer/web/files_routes.py" = ["C901"]
# MyPy configuration (type checking)
[tool.mypy]
python_version = "3.11"
strict = true
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_any_generics = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = false
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
follow_imports = "normal"
ignore_missing_imports = true
# Pytest configuration
[tool.pytest.ini_options]
pythonpath = ["src"]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"--strict-markers",
"--cov=file_organizer",
"--cov-report=term-missing",
"--cov-report=html",
"--cov-report=xml",
"--cov-fail-under=95",
"--timeout=30",
]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
"unit: marks tests as unit tests",
"ci: marks tests intended for PR CI validation",
"smoke: marks tests for fast pre-commit validation (<30s total)",
"no_ollama: marks tests that verify fallback behavior when Ollama is unavailable",
"regression: marks tests intended for full regression runs",
"e2e: end-to-end tests against real file trees (no Ollama required)",
"benchmark: performance benchmark tests (use --benchmark-only to run)",
"asyncio: marks tests as async (requires pytest-asyncio)",
]
filterwarnings = [
"error::DeprecationWarning:file_organizer",
"error::PendingDeprecationWarning:file_organizer",
"ignore::DeprecationWarning:pkg_resources",
"ignore::DeprecationWarning:google",
"ignore::DeprecationWarning:importlib",
]
# pytest-benchmark settings (pass via CLI: --benchmark-min-rounds=3 --benchmark-max-time=30.0)
# benchmark_ prefix keys are NOT supported as ini_options in pytest-benchmark 5.x
# Coverage configuration
[tool.coverage.run]
source = ["src"]
omit = [
"*/tests/*",
"*/test_*.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
# Interrogate configuration (docstring coverage)
[tool.interrogate]
ignore-init-method = true
ignore-init-module = true
ignore-semiprivate = false
ignore-private = false
ignore-property-decorators = false
fail-under = 90
exclude = ["tests", "setup.py", "docs"]
verbose = 1
quiet = false
whitelist-regex = []
# deptry: unused dependency detection
# Run as: deptry src/ (scans source only)
[tool.deptry]
# First-party package — suppress DEP001 false positives from src-layout
known_first_party = ["file_organizer"]
# Only tool-only groups where packages are never imported in application code
pep621_dev_dependency_groups = ["dev", "docs", "build"]
# Map distribution names → import names for packages that differ
[tool.deptry.package_module_name_map]
"Pillow" = "PIL"
"PyMuPDF" = "fitz"
"python-docx" = "docx"
"python-pptx" = "pptx"
"beautifulsoup4" = "bs4"
"pyyaml" = "yaml"
"python-jose" = "jose"
"scikit-learn" = "sklearn"
"opencv-python" = "cv2"
"pydantic-settings" = "pydantic_settings"
"PyPDF2" = "PyPDF2"
"striprtf" = "striprtf"
[tool.deptry.per_rule_ignores]
# netCDF4: in scientific optional group; deptry has mixed-case matching issues
DEP001 = ["netCDF4"]
# aiofiles: Starlette StaticFiles uses it for async file serving (no direct import)
# python-multipart: FastAPI uses it for file uploads (no direct import)
# lxml: used as bs4 parser string "lxml" (not imported directly)
# email-validator: pydantic uses it for EmailStr (not imported directly)
# websockets: starlette WebSocket support (must be installed, not imported)
# python-dotenv: pydantic-settings reads .env files via this package
# bcrypt: passlib[bcrypt] uses it as backend (not imported directly)
# jinja2: fastapi.templating wraps it (not imported directly)
# alembic: used as CLI migration tool (not imported in application code)
# openpyxl: pandas uses it for Excel I/O (not imported directly)
# local-file-organizer: self-reference in the [all] optional group
DEP002 = [
"aiofiles",
"python-multipart",
"lxml",
"email-validator",
"websockets",
"python-dotenv",
"bcrypt",
"jinja2",
"alembic",
"openpyxl",
"local-file-organizer",
# pydantic-settings: pydantic's BaseSettings uses it internally; no direct import needed
"pydantic-settings",
# PyQt6: GUI-only dep; GUI application lives outside src/file_organizer/
"PyQt6",
# netCDF4: mixed-case name causes deptry matching issues; used in scientific.py
"netCDF4",
]