import subprocess
import os
import sys
from setuptools import setup, find_packages

def twine_upload(dist_path, token):
    command = [
        sys.executable, "-m", "twine", "upload",
        "--repository-url", "https://upload.pypi.org/legacy/",
        "--non-interactive",
        "--username", "__token__",
        "--password", token,
        os.path.join(dist_path, "*")
    ]
    subprocess.run(command, check=True)


setup(
    name="minimind",
    version="0.6.0",
    packages=find_packages(),
    include_package_data=True,
    package_data={"minimind": ["datasets/MLdata.csv"]},

    install_requires=[
        "numpy>=1.22.0",
        "scikit-learn>=1.0",
        "autograd",
        "pandas>=1.3.0",
    ],
    author="yuchan",
    author_email="shinnara.yuchan@gmail.com",
    description="MiniMind",
    long_description=open("C:\\Users\\yuchan\\Downloads\\Pro\\Pro\\MiniMind\\README.md", encoding="utf-8").read(),
    long_description_content_type="text/markdown",
    classifiers=[
        "Programming Language :: Python :: 3",
        "Operating System :: OS Independent",
    ],
    python_requires='>=3.8',
)




if __name__ == "__main__":
    # 경로는 \\ 대신 /로 해도 됩니다 (파이썬은 슬래시도 잘 읽음)
    dist_dir = "C:/Users/yuchan/Downloads/Pro/Pro/MiniMind/dist"

    # ⚠️ 보안주의! 이 토큰은 외부에 유출되면 안 됩니다
    api_token = "pypi-AgEIcHlwaS5vcmcCJGNhNTc2OTI2LWY5NTQtNDg5Yi1iYzk0LTJiMTk3ZWU4ZjExMQACKlszLCJiNGU5ZTllNS0xZmM0LTQzOTUtYmRhMy1iNWYxMGFjODZhNTAiXQAABiDhQ_nVKz0vwrazzfmBJWUTqEBlf3mqhgXBsCIA6lD4Tw"

    #twine_upload(dist_dir, api_token)
