"""
Setup file.
"""

import re
from pathlib import Path

from setuptools import find_packages, setup

with Path.open("src/sparkpolars/_version.py", encoding="utf-8") as version_file:
    version_groups = re.search(
        r'__version__ = "(\d+\.\d+\.\d+)"',
        version_file.read(),
        re.MULTILINE,
    )
    if version_groups:
        version = version_groups.group(1)
    else:
        msg = "Version not found in src/sparkpolars/_version.py"
        raise ValueError(msg)

setup(
    name="sparkpolars",
    version=version,
    packages=find_packages(exclude=["tests", "docs", "dist"]),
    install_requires=[
        "pyspark>=3.3.0",
        "polars>=1.00.0",
    ],
)
