-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
334 lines (298 loc) · 8.78 KB
/
pyproject.toml
File metadata and controls
334 lines (298 loc) · 8.78 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
[build-system]
requires = ["hatchling>=1.21.0"]
build-backend = "hatchling.build"
[project]
name = "filantropia-solar"
version = "1.2.3"
description = "Advanced Solar Energy Analysis Application for Portuguese PV Installations"
readme = "README.md"
license = {text = "MIT"}
requires-python = ">=3.11"
authors = [
]
maintainers = [
]
keywords = [
"solar energy",
"photovoltaic",
"machine learning",
"energy prediction",
"portugal",
"renewable energy",
"weather simulation"
]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Environment :: Web Environment",
"Environment :: MacOS X",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Atmospheric Science",
"Topic :: Utilities",
"Typing :: Typed",
]
# Core dependencies
dependencies = [
# Core Data Science (Latest stable versions)
"pandas>=2.2.0,<3.0.0",
"numpy>=1.26.0,<2.0.0",
"scipy>=1.13.0,<2.0.0",
# Machine Learning
"scikit-learn>=1.4.0,<2.0.0",
"joblib>=1.3.0,<2.0.0",
# Visualization
"matplotlib>=3.8.0,<4.0.0",
"seaborn>=0.13.0,<1.0.0",
# Data Processing
"openpyxl>=3.1.0,<4.0.0",
"python-dateutil>=2.9.0",
"pytz>=2024.1",
# HTTP and API
"requests>=2.31.0,<3.0.0",
"aiohttp>=3.9.0,<4.0.0", # For async HTTP operations
# GUI (keeping tkinter support)
# Pillow compatibility varies by Python version; provide markers for 3.14+
"Pillow>=10.3.0,<12.0.0; python_version < '3.14'",
"Pillow>=12.0.0,<13.0.0; python_version >= '3.14'",
"tkcalendar>=1.6.0,<2.0.0",
# Configuration and utilities
"pydantic>=2.5.0,<3.0.0", # For data validation
"pydantic-settings>=2.1.0,<3.0.0", # For settings management
"typer>=0.9.0,<1.0.0", # For CLI
"rich>=13.7.0,<14.0.0", # For beautiful terminal output
"loguru>=0.7.0,<1.0.0", # Better logging
# Performance improvements
"polars>=0.20.0,<1.0.0", # Faster DataFrame operations
"orjson>=3.9.0,<4.0.0", # Faster JSON serialization
"pyyaml>=6.0.0,<7.0.0",
]
[project.optional-dependencies]
# Web API dependencies
api = [
"fastapi>=0.109.0,<1.0.0",
"uvicorn[standard]>=0.27.0,<1.0.0",
"python-multipart>=0.0.6", # For file uploads
"websockets>=12.0,<13.0", # WebSocket support
]
# Advanced ML features
ml-extra = [
"xgboost>=2.0.0,<3.0.0",
"lightgbm>=4.3.0,<5.0.0",
"optuna>=3.5.0,<4.0.0", # Hyperparameter optimization
"shap>=0.44.0,<1.0.0", # Model explainability
]
# Database support
database = [
"sqlalchemy>=2.0.0,<3.0.0",
"asyncpg>=0.29.0,<1.0.0", # PostgreSQL async driver
"redis>=5.0.0,<6.0.0",
]
# Development dependencies
dev = [
# Testing
"pytest>=8.0.0,<9.0.0",
"pytest-cov>=4.0.0,<5.0.0",
"pytest-asyncio>=0.23.0,<1.0.0",
"pytest-mock>=3.12.0,<4.0.0",
"pytest-xdist>=3.5.0,<4.0.0", # Parallel testing
"hypothesis>=6.96.0,<7.0.0", # Property-based testing
"factory-boy>=3.3.0,<4.0.0", # Test data generation
"freezegun>=1.4.0,<2.0.0", # Time mocking
# Installer and build
"pyinstaller>=6.3.0,<7.0.0", # For freezing
"pynsist>=2.10,<3.0.0", # For NSIS installer build
# Code quality
"ruff>=0.2.0,<1.0.0", # Fast linter & formatter
"mypy>=1.8.0,<2.0.0", # Type checking
"pre-commit>=3.6.0,<4.0.0", # Pre-commit hooks
"bandit[toml]>=1.7.0,<2.0.0", # Security linting
# Documentation
"mkdocs>=1.5.0,<2.0.0",
"mkdocs-material>=9.5.0,<10.0.0",
"mkdocstrings[python]>=0.24.0,<1.0.0",
# Jupyter support
"jupyter>=1.0.0,<2.0.0",
"ipykernel>=6.29.0,<7.0.0",
"jupyterlab>=4.1.0,<5.0.0",
# Performance profiling
"py-spy>=0.3.14",
"memory-profiler>=0.61.0",
"line-profiler>=4.1.0",
]
windows = [
"pywin32>=306,<307"
]
# All optional dependencies
all = [
"filantropia-solar[api,ml-extra,database]"
]
[project.urls]
Homepage = "https://github.com/WeRaDev/FilantropiaSolar"
Documentation = "https://filantropia-solar.readthedocs.io"
Repository = "https://github.com/WeRaDev/FilantropiaSolar.git"
"Bug Tracker" = "https://github.com/WeRaDev/FilantropiaSolar/issues"
Changelog = "https://github.com/WeRaDev/FilantropiaSolar/blob/main/CHANGELOG.md"
[project.scripts]
filantropia-solar = "main:main"
fs-gui = "main:main"
fs-app = "main:main"
[project.gui-scripts]
filantropia-solar-gui = "main:main"
# Hatch build configuration
[tool.hatch.version]
path = "src/filantropia_solar/__init__.py"
[tool.hatch.build.targets.wheel]
packages = ["src/filantropia_solar"]
[tool.hatch.build.targets.sdist]
include = [
"src/",
"tests/",
"docs/",
"README.md",
"LICENSE",
"CHANGELOG.md",
]
# Ruff configuration (replaces Black, isort, flake8, etc.)
[tool.ruff]
target-version = "py311"
line-length = 88
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"ARG", # flake8-unused-arguments
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"PTH", # flake8-use-pathlib
"ERA", # flake8-eradicate
"PL", # pylint
"RUF", # Ruff-specific rules
]
ignore = [
"E501", # line too long, handled by formatter
"E402", # module level import not at top of file
"B008", # do not perform function calls in argument defaults
"PLR0913", # too many arguments to function call
"PLR0911", # too many return statements
"PLR0912", # too many branches
"PLR0915", # too many statements
"PLC0415", # import should be placed at top of module
"B025", # duplicate exception handlers (handled manually)
]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = ["S101", "PLR2004", "ARG001", "PLC0415"]
"src/**/__init__.py" = ["F401"]
"benchmark_v103.py" = ["E402"] # Imports must be after sys.path manipulation
[tool.ruff.lint.isort]
known-first-party = ["filantropia_solar"]
force-sort-within-sections = true
# MyPy configuration
[tool.mypy]
python_version = "3.11"
files = ["src"]
explicit_package_bases = true
namespace_packages = true
warn_return_any = false
warn_unused_configs = true
disallow_untyped_defs = false
disallow_incomplete_defs = false
check_untyped_defs = false
disallow_untyped_decorators = false
no_implicit_optional = false
warn_redundant_casts = false
warn_unused_ignores = false
warn_no_return = false
warn_unreachable = false
strict_equality = false
show_error_codes = true
ignore_errors = false
[[tool.mypy.overrides]]
module = [
"matplotlib.*",
"seaborn.*",
"sklearn.*",
"joblib.*",
"pandas.*",
"numpy.*",
"scipy.*",
"tkcalendar.*",
"polars.*",
]
ignore_missing_imports = true
# Pytest configuration
[tool.pytest.ini_options]
minversion = "8.0"
addopts = [
"--strict-markers",
"--strict-config",
"--cov=src/filantropia_solar",
"--cov-branch",
"--cov-report=term-missing",
"--cov-report=html",
"--cov-report=xml",
"--cov-fail-under=80",
]
testpaths = ["tests"]
filterwarnings = [
"error",
"ignore::UserWarning",
"ignore::DeprecationWarning",
"ignore::PendingDeprecationWarning",
]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
"unit: marks tests as unit tests",
"ml: marks tests that involve machine learning models",
"gui: marks tests for GUI components",
]
# Coverage configuration
[tool.coverage.run]
source = ["src"]
branch = true
omit = [
"*/tests/*",
"*/venv/*",
"*/__pycache__/*",
"*/migrations/*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"@abstract",
]
# Bandit security linting
[tool.bandit]
exclude_dirs = ["tests", "venv"]
skips = ["B101"] # Skip assert_used test
[tool.bandit.assert_used]
skips = ["*_test.py", "test_*.py"]