#!/usr/bin/env python3
"""
MCP Hand Detection 安装脚本
"""
from setuptools import setup, find_packages
import os

# 读取 README 文件
def read_readme():
    readme_path = os.path.join(os.path.dirname(__file__), "README_PYPI.md")
    if os.path.exists(readme_path):
        with open(readme_path, "r", encoding="utf-8") as f:
            return f.read()
    return "MCP Hand Detection - 手掌检测 MCP 服务"

# 读取 requirements.txt
def read_requirements():
    req_path = os.path.join(os.path.dirname(__file__), "requirements.txt")
    if os.path.exists(req_path):
        with open(req_path, "r", encoding="utf-8") as f:
            return [line.strip() for line in f if line.strip() and not line.startswith("#")]
    return [
        "opencv-python>=4.8.0",
        "mediapipe>=0.10.0",
        "numpy>=1.24.0",
    ]

setup(
    name="mcp-hand-detection",
    version="1.0.1",
    author="QianShun",
    author_email="18944770792@163.com",
    description="MCP Hand Detection - 基于 MediaPipe 的手掌检测 MCP 服务",
    long_description=read_readme(),
    long_description_content_type="text/markdown",
    url="",
    packages=find_packages(),
    package_data={
        "mcp_hand_detection": [
            "data/hand_landmarker.task",
        ],
    },
    include_package_data=True,
    install_requires=read_requirements(),
    extras_require={
        "http": [
            "flask>=2.3.0",
            "flask-cors>=4.0.0",
        ],
    },
    entry_points={
        "console_scripts": [
            "mcp-hand-detection=mcp_hand_detection.server:main",
        ],
    },
    classifiers=[
        "Development Status :: 4 - Beta",
        "Intended Audience :: Developers",
        "License :: OSI Approved :: MIT License",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3.10",
        "Programming Language :: Python :: 3.11",
        "Programming Language :: Python :: 3.12",
        "Topic :: Software Development :: Libraries :: Python Modules",
        "Topic :: Scientific/Engineering :: Image Recognition",
    ],
    python_requires=">=3.9",
    keywords="mcp, mediapipe, hand detection, computer vision, ai",
)

