# -*- coding: utf-8 -*-
import io
import re
from setuptools import setup, find_packages
import sys
import os

# UTF-8 encoding sorunlarını çöz
with open("README.md", "r", encoding="utf-8") as fh:
    long_description = fh.read()

sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')

def get_version():
    with open('kha256/__init__.py', 'r', encoding='utf-8') as f:
        content = f.read()
    match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", content, re.M)
    if match:
        return match.group(1)
    raise RuntimeError("Unable to find version string.")

def get_install_requires():
    """Kurulum bağımlılıklarını dinamik olarak belirle"""
    base_requires = [
        "numpy",
        "kececinumbers",
    ]

setup(
    name="kha256",
    version=get_version(),
    description="Keçeci Hash Algorithm (Keçeci Hash Algoritması), KHA-256",
    long_description=long_description,
    long_description_content_type="text/markdown",
    author="Mehmet Keçeci",
    maintainer="Mehmet Keçeci",
    author_email="mkececi@yaani.com",
    maintainer_email="mkececi@yaani.com",
    url="https://github.com/WhiteSymmetry/kha256",
    packages=find_packages(),
    package_data={
        "kha256": ["__init__.py", "_version.py", "*.pyi"]
    },
    install_requires=get_install_requires(),
    extras_require={
        'test': [
            "pytest",
            "pytest-cov",
        ],
        'dev': [
            "pytest",
            "pytest-cov",
            "twine",
            "wheel",
        ]
    },
    classifiers=[
        "Programming Language :: Python :: 3",
        "License :: OSI Approved :: AGPL-3.0 License",
        "Operating System :: OS Independent",
        "Intended Audience :: Science/Research",
        "Topic :: Scientific/Engineering :: Mathematics"
    ],
    python_requires='>=3.11',
    license="AGPL-3.0-or-later",
    keywords="mathematics numbers hash kha kha256 kha-256 kececi",
    project_urls={
        "Documentation": "https://github.com/WhiteSymmetry/kha256",
        "Source": "https://github.com/WhiteSymmetry/kha256",
        "Tracker": "https://github.com/WhiteSymmetry/kha256/issues",
    },
)
