-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
460 lines (424 loc) · 12.3 KB
/
Copy pathpyproject.toml
File metadata and controls
460 lines (424 loc) · 12.3 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
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
# ============================================================================
# Business Data Analyzer - pyproject.toml
# Comprehensive Python project configuration following PEP 621
# ============================================================================
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
# ============================================================================
# Project Metadata (PEP 621)
# ============================================================================
[project]
name = "business-data-analyzer"
version = "2.1.0"
description = "Comprehensive business intelligence platform for hardware store operations with AI-powered natural language SQL queries"
readme = "README.md"
license = {text = "MIT"}
requires-python = ">=3.11"
authors = [
{name = "Business Data Analyzer Team"},
]
keywords = [
"business-intelligence",
"data-analysis",
"sql",
"natural-language",
"ai",
"grok",
"vanna",
"analytics",
"retail",
"hardware-store",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Topic :: Office/Business",
"Topic :: Scientific/Engineering :: Information Analysis",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Natural Language :: English",
"Natural Language :: Spanish",
]
# Core Dependencies
# ============================================================================
dependencies = [
# Database
"pymssql>=2.2.8",
"pyodbc>=4.0.0",
"sqlalchemy>=2.0.0",
# Environment & Configuration
"python-dotenv>=0.19.0",
"pydantic-settings>=2.2.0",
# Data Analysis & Processing
"pandas>=1.5.0",
"numpy>=1.21.0",
# Visualization
"matplotlib>=3.5.0",
"plotly>=5.0.0",
"seaborn>=0.12.0",
# Web Framework
"streamlit>=1.20.0",
"flask>=2.0.0",
"waitress>=2.1.0",
"fastapi>=0.100.0",
"uvicorn>=0.23.0",
"flasgger>=0.9.5",
"flask-sock>=0.5.3",
# AI/ML - Natural Language to SQL
"vanna>=0.3.0",
"chromadb>=0.4.0",
"openai>=1.0.0",
"anthropic>=0.7.0",
# Encryption/Decryption
"pycryptodome>=3.15.0",
# Database Tools
"metabase-api>=0.3.0",
# Utilities
"python-dateutil>=2.8.0",
"pyyaml>=6.0.0",
"requests>=2.28.0",
"rich>=13.0.0",
"click>=8.0.0",
"tqdm>=4.65.0",
# Export & Reporting
"openpyxl>=3.0.0",
"xlsxwriter>=3.0.0",
"reportlab>=3.6.0",
"jinja2>=3.1.0",
"xlrd>=2.0.2",
]
[project.optional-dependencies]
# Development dependencies
dev = [
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
"pytest-asyncio>=0.21.0",
"black==23.12.1",
"flake8>=4.0.0",
"mypy>=0.950",
"isort>=5.12.0",
"pre-commit>=2.20.0",
]
# Jupyter notebook support
jupyter = [
"jupyter>=1.0.0",
"ipython>=8.0.0",
"ipykernel>=6.0.0",
]
# MCP (Model Context Protocol) database server support
mcp = [
"mcp>=1.2",
]
# Distributed query cache (optional — set CACHE_BACKEND=redis)
cache = [
"redis>=5.0.0",
]
# All extras combined
all = [
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
"black==23.12.1",
"flake8>=4.0.0",
"mypy>=0.950",
"isort>=5.12.0",
"pre-commit>=2.20.0",
"jupyter>=1.0.0",
"ipython>=8.0.0",
"ipykernel>=6.0.0",
]
[project.scripts]
# CLI Entry Points
depotru-report = "business_analyzer.reports.monthly:main"
vanna-grok = "vanna_grok:main"
vanna-chat = "vanna_grok:main"
depotru-db-mcp = "business_analyzer.mcp.database_server:main"
depotru-enrich-celular = "business_analyzer.analysis.cotizaciones_celular_cli:main"
depotru-website-stock = "business_analyzer.core.website_stock_cli:main"
depotru-monday-cash = "business_analyzer.jobs.monday_cash_pack:main"
depotru-akzonobel-core-lines = "business_analyzer.jobs.akzonobel_core_lines:main"
depotru-mine-chat-guides = "business_analyzer.jobs.chat_log_guides:main"
[project.urls]
Homepage = "https://github.com/Trujillofa/depotru_database"
Documentation = "https://github.com/Trujillofa/depotru_database/blob/main/README.md"
Repository = "https://github.com/Trujillofa/depotru_database"
"Bug Tracker" = "https://github.com/Trujillofa/depotru_database/issues"
# ============================================================================
# Setuptools Configuration
# ============================================================================
[tool.setuptools]
py-modules = ["vanna_grok", "api", "config"]
[tool.setuptools.packages.find]
where = ["src"]
include = [
"business_analyzer*",
"depotru_kernel*",
"depotru_tools*",
"depotru_integrations*",
"modules*",
"apps*",
"analytics*",
"contracts*",
"data_access*",
"reporting*",
"vanna_integration*",
]
exclude = ["tests*"]
[tool.setuptools.package-data]
"*" = ["*.json", "*.md", "*.txt", "*.yaml", "*.yml"]
# ============================================================================
# Pytest Configuration
# ============================================================================
[tool.pytest.ini_options]
# Test discovery patterns
python_files = "test_*.py"
python_classes = "Test*"
python_functions = "test_*"
# Test paths
testpaths = ["tests"]
pythonpath = ["src"]
# Output options
addopts = [
"-v",
"--tb=short",
"--strict-markers",
"--disable-warnings",
]
# Markers
markers = [
"unit: Unit tests",
"integration: Integration tests requiring database",
"slow: Slow running tests",
"requires_db: Tests that require database connection",
"requires_api: Tests that require API keys",
"module_assistant: Assistant / storefront AI module",
"module_crm: CRM module",
"module_wms: WMS module",
"module_catalog: Catalog / affinity module",
]
# ============================================================================
# Coverage Configuration
# ============================================================================
[tool.coverage.run]
source = ["src"]
omit = [
"*/tests/*",
"*/venv/*",
"*/__pycache__/*",
"*/.venv/*",
"*/env/*",
]
[tool.coverage.report]
precision = 2
show_missing = true
skip_covered = false
# Overall fail_under is not set (repo-wide coverage is below 80%).
# Money-path floor (80%) is enforced in CI for monthly.py, cartera_pdf.py,
# manager_report/queries.py, and website_stock_magento_ssh.py — see docs/TESTING.md.
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
# ============================================================================
# Black Configuration
# ============================================================================
[tool.black]
line-length = 88
target-version = ['py311', 'py312']
include = '\.pyi?$'
extend-exclude = '''
/(
# directories
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| build
| dist
| venv
| env
)/
'''
# ============================================================================
# isort Configuration
# ============================================================================
[tool.isort]
profile = "black"
line_length = 88
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
skip = [
".eggs",
".git",
".hg",
".mypy_cache",
".tox",
".venv",
"build",
"dist",
"venv",
"env",
]
known_first_party = ["src"]
skip_glob = ["*.backup"]
# ============================================================================
# mypy Configuration
# ============================================================================
[tool.mypy]
python_version = "3.11"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = false
disallow_incomplete_defs = false
check_untyped_defs = true
disallow_untyped_decorators = false
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
strict_equality = true
show_error_codes = true
show_column_numbers = true
show_error_context = true
# Module-specific settings
[[tool.mypy.overrides]]
module = [
"pymssql.*",
"pyodbc.*",
"vanna.*",
"chromadb.*",
"matplotlib.*",
"plotly.*",
"seaborn.*",
"streamlit.*",
"flask.*",
"waitress.*",
"flasgger.*",
"reportlab.*",
"openpyxl.*",
"xlsxwriter.*",
]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = [
"api",
"vanna_grok",
"vanna_integration.*",
"business_analyzer.analysis.affinity",
"business_analyzer.analysis.affinity_mart",
"business_analyzer.analysis.blender",
"business_analyzer.analysis.cotizaciones_celular",
"business_analyzer.analysis.cotizaciones_celular_cli",
"business_analyzer.analysis.engines.*",
"business_analyzer.analysis.anomaly",
"business_analyzer.analysis.manager_report.*",
"business_analyzer.ai.flask_app",
"business_analyzer.core.api_auth",
"business_analyzer.core.db_factory",
"business_analyzer.core.query_cache",
"business_analyzer.mcp.*",
"business_analyzer.reports.*",
"business_analyzer.analysis.*",
"business_analyzer.ai.__init__",
"business_analyzer.ai.base",
"business_analyzer.ai.llm",
"business_analyzer.ai.sql_routing",
"business_analyzer.ai.sql_runtime",
"business_analyzer.ai.manager_report_routing",
"business_analyzer.ai.summaries",
"business_analyzer.ai.vanna",
"business_analyzer.ai.formatting",
"business_analyzer.ai.insights",
"business_analyzer.ai.providers.*",
"business_analyzer.core.database",
"src.api",
"src.vanna_grok",
"src.business_analyzer.analysis.*",
"src.business_analyzer.ai.__init__",
"src.business_analyzer.ai.base",
"src.business_analyzer.ai.llm",
"src.business_analyzer.ai.sql_routing",
"src.business_analyzer.ai.sql_runtime",
"src.business_analyzer.ai.manager_report_routing",
"src.business_analyzer.ai.summaries",
"src.business_analyzer.ai.vanna",
"src.business_analyzer.ai.formatting",
"src.business_analyzer.ai.insights",
"src.business_analyzer.ai.providers.*",
"src.business_analyzer.core.database",
]
ignore_errors = true
# ============================================================================
# Flake8 Configuration (via flake8-pyproject)
# ============================================================================
[tool.flake8]
max-line-length = 88
extend-ignore = [
"E203", # Whitespace before ':' (conflicts with black)
"W503", # Line break before binary operator (conflicts with black)
]
exclude = [
".git",
"__pycache__",
"build",
"dist",
".eggs",
".tox",
".venv",
"venv",
"env",
]
per-file-ignores = [
"__init__.py:F401", # Allow unused imports in __init__.py
]
# ============================================================================
# Pre-commit Configuration
# ============================================================================
[tool.pre-commit]
# Note: Full pre-commit config is in .pre-commit-config.yaml
# This section documents the hooks used
# - black: Code formatting
# - isort: Import sorting
# - flake8: Linting
# - mypy: Type checking
# - pytest: Test running
# ============================================================================
# Development Notes
# ============================================================================
#
# Installation:
# pip install -e ".[dev]" # Development install
# pip install -e ".[all]" # All extras
# pip install -e ".[jupyter]" # With Jupyter support
#
# Usage:
# business-analyzer --help # Run main analyzer
# vanna-grok # Run Grok AI interface
# vanna-chat # Run multi-provider AI interface
#
# Testing:
# pytest # Run all tests
# pytest --cov # Run with coverage
# pytest -m unit # Run unit tests only
#
# Code Quality:
# black src/ tests/ # Format code
# isort src/ tests/ # Sort imports
# flake8 src/ tests/ # Lint code
# mypy src/ # Type check
#
# ============================================================================