import re

from setuptools import find_packages, setup

with 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"]),
)
