[project]
name = "pipolars"
dynamic = ["version"]
description = "High-performance PI System data extraction library with Polars DataFrames"
readme = "README.md"
license = { text = "MIT" }
requires-python = ">=3.10"
authors = [
    { name = "PIPolars Contributors" }
]
keywords = ["pi-system", "osisoft", "polars", "dataframe", "time-series", "industrial-data"]
classifiers = [
    "Development Status :: 3 - Alpha",
    "Intended Audience :: Developers",
    "Intended Audience :: Science/Research",
    "License :: OSI Approved :: MIT License",
    "Operating System :: Microsoft :: Windows",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Topic :: Scientific/Engineering",
    "Topic :: Database",
    "Typing :: Typed",
]

dependencies = [
    "polars>=1.17.0",
    "pythonnet>=3.0.3",
    "pydantic>=2.10.0",
    "pydantic-settings>=2.6.0",
    "pyarrow>=18.0.0",
    "tzdata>=2024.1",
    "tomli>=2.0.0; python_version < '3.11'",
]

[project.optional-dependencies]
dev = [
    "pytest>=8.3.0",
    "pytest-cov>=6.0.0",
    "pytest-asyncio>=0.24.0",
    "ruff>=0.8.0",
    "mypy>=1.13.0",
    "pre-commit>=4.0.0",
]
docs = [
    "sphinx>=7.2.0",
    "furo>=2024.1.0",
    "sphinx-copybutton>=0.5.2",
    "sphinx-autobuild>=2024.2.0",
]

[project.urls]
Homepage = "https://github.com/pipolars/pipolars"
Documentation = "https://pipolars.github.io/pipolars"
Repository = "https://github.com/pipolars/pipolars"
Issues = "https://github.com/pipolars/pipolars/issues"

[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.hatch.version]
source = "vcs"

[tool.hatch.build.hooks.vcs]
version-file = "src/pipolars/_version.py"

[tool.hatch.build.targets.wheel]
packages = ["src/pipolars"]

[tool.uv]
link-mode = "copy"

[dependency-groups]
dev = [
    "pytest>=8.3.0",
    "pytest-cov>=6.0.0",
    "pytest-asyncio>=0.24.0",
    "ruff>=0.8.0",
    "mypy>=1.13.0",
]

[tool.ruff]
target-version = "py310"
line-length = 100
src = ["src"]
exclude = ["_version.py"]

[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
    "PTH",    # flake8-use-pathlib
    "RUF",    # Ruff-specific rules
]
ignore = [
    "E501",   # line too long (handled by formatter)
    "SIM102", # nested if statements (sometimes clearer)
    "SIM108", # ternary operator (sometimes clearer with if/else)
    "RUF022", # unsorted __all__ (keep logical grouping)
]

[tool.ruff.lint.isort]
known-first-party = ["pipolars"]

[tool.mypy]
python_version = "3.10"
strict = true
warn_return_any = true
warn_unused_ignores = true
disallow_untyped_defs = true
plugins = ["pydantic.mypy"]

[[tool.mypy.overrides]]
module = [
    "clr",
    "System.*",
    "OSIsoft.*",
    "pyarrow",
    "pyarrow.*",
    "pythonnet",
    "tomli",
]
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "pipolars.core.config"
warn_unused_ignores = false

[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
addopts = [
    "-ra",
    "-q",
    "--strict-markers",
]
markers = [
    "integration: marks tests as integration tests (require PI System)",
    "slow: marks tests as slow",
]

[tool.coverage.run]
source = ["src/pipolars"]
branch = true

[tool.coverage.report]
exclude_lines = [
    "pragma: no cover",
    "def __repr__",
    "raise NotImplementedError",
    "if TYPE_CHECKING:",
]
