# ===== Build System =====
[build-system]
requires = ["setuptools>=61"]
build-backend = "setuptools.build_meta"

# ===== Project Metadata =====
[project]
name = "pygui"
version = "0.1.0"
requires-python = ">=3.11"
dependencies = [
    "PySide6>=6.6.0",
    "pyqtgraph>=0.13.0",
    "numpy>=1.24.0",
    "pyserial>=3.5",
    "pandas>=2.0.0",
    "matplotlib>=3.7.0",
    "scipy>=1.17.1",
    "pyyaml>=6.0.3",
    "dtw-python",
    "cryptography>=41.0",
]

[project.optional-dependencies]
dev = ["pytest"]

# ===== Console Entry Point =====
[project.scripts]
isc = "pygui.__main__:main"

# ===== Package Discovery (src layout) =====
[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools.package-data]
# Ship the QML module alongside the Python package.
pygui = ["ISC/**/*.qml", "ISC/**/qmldir"]

# ===== PySide Build Inputs =====
[tool.pyside6-project]
files = [
    "src/pygui/ISC/HomePage.qml",
    "src/pygui/ISC/Main.qml",
    "src/pygui/ISC/Theme.qml",
    "src/pygui/ISC/qmldir",
    "src/pygui/ISC/Tabs/DataTab.qml",
    "src/pygui/ISC/Tabs/SelectFileDialog.qml",
    "src/pygui/ISC/Tabs/SettingsTab.qml",
    "src/pygui/ISC/Tabs/StatusTab.qml",
    "src/pygui/ISC/Tabs/qmldir",
    "src/pygui/__main__.py",
    "src/pygui/backend/contour_models.py",
    "src/pygui/backend/crypto/crypto_helper.py",
    "src/pygui/backend/csv_file_metadata.py",
    "src/pygui/backend/data_model.py",
    "src/pygui/backend/data_segment.py",
    "src/pygui/backend/device_controller.py",
    "src/pygui/backend/file_browser.py",
    "src/pygui/backend/frame.py",
    "src/pygui/backend/graph_view.py",
    "src/pygui/backend/local_settings.py",
    "src/pygui/backend/local_settings_model.py",
    "src/pygui/backend/marching_squares.py",
    "src/pygui/backend/zwafer_models.py",
    "src/pygui/backend/zwafer_parser.py",
    "src/pygui/backend/frame_stats.py",
    "src/pygui/backend/threshold_classifier.py",
    "src/pygui/backend/stability_detector.py",
    "src/pygui/backend/csv_recorder.py",
    "src/pygui/backend/frame_player.py",
    "src/pygui/backend/stream_reader.py",
    "src/pygui/backend/session_model.py",
    "src/pygui/backend/session_controller.py",
    "src/pygui/backend/wafer_layouts.py",
    "src/pygui/backend/rbf_heatmap.py",
    "src/pygui/backend/wafer_map_item.py",
    "src/pygui/serialcomm/__init__.py",
    "src/pygui/serialcomm/data_parser.py",
    "src/pygui/serialcomm/device_service.py",
    "src/pygui/serialcomm/serial_port.py",
    "src/pygui/ISC/Tabs/WaferMapTab.qml",
    "src/pygui/ISC/Tabs/components/WaferMapView.qml",
    "src/pygui/ISC/Tabs/components/SourcePanel.qml",
    "src/pygui/ISC/Tabs/components/ReadoutPanel.qml",
    "src/pygui/ISC/Tabs/components/TransportBar.qml",
    "src/pygui/ISC/Tabs/components/ReplaceSensorDialog.qml",
    "src/pygui/ISC/Tabs/components/qmldir",
]

[dependency-groups]
dev = [
    "pytest>=9.0.3",
    "ruff",
    "mypy",
    "pyinstaller==6.21.0",
]

[tool.uv]
environments = [
    "sys_platform == 'darwin'",
    "sys_platform == 'win32'",
    "sys_platform == 'linux'",
]

# ===== Ruff Linter and Formatter =====
[tool.ruff]
target-version = "py311"
line-length = 125

[tool.ruff.lint]
select = [
    "E",   # pycodestyle errors
    "W",   # pycodestyle warnings
    "F",   # pyflakes
    "I",   # isort (import sorting)
    "N",   # pep8-naming
]
ignore = [
    "N802",  # Function name should be lowercase (standard for Qt Slots and Properties)
    "N815",  # Class attribute should not be mixedCase (standard for Qt Properties and Signals)
    "E702",  # Multiple statements on one line (semicolon, standard for inline Qt property setters with self.update())
]

# ===== Mypy Static Type Checker =====
[tool.mypy]
python_version = "3.11"
check_untyped_defs = true
warn_return_any = true
warn_unused_configs = true
ignore_missing_imports = true

