#!/usr/bin/env python3
"""
SVG 转换器 FastMCP 服务包安装配置
这是一个基于 FastMCP 的 SVG 文件转换服务包,提供完整的 SVG 转换功能。
支持将 SVG 转换为 PNG、ICO、JPG 等格式,优先使用 Cairo C库 进行高质量渲染。
作者: Rusian Huu
版本: 1.0.0
"""
from setuptools import setup, find_packages
from pathlib import Path
# 读取 README 文件
readme_file = Path(__file__).parent / "README.md"
long_description = ""
if readme_file.exists():
with open(readme_file, "r", encoding="utf-8") as f:
long_description = f.read()
# 包的基本信息
setup(
name="svg-converter-mcp",
version="1.0.0",
author="Rusian Huu",
author_email="hu_bo_cheng@qq.com",
description="基于 FastMCP 的专业 SVG 文件转换服务",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/RusianHu/svg-converter-tools-mcp",
# 包配置
packages=find_packages(),
include_package_data=True,
# Python 版本要求
python_requires=">=3.8",
# 依赖项配置
install_requires=[
"fastmcp>=2.8.0",
"Pillow>=8.0.0",
"pydantic>=2.0.0",
"typing-extensions>=4.0.0",
],
# 可选依赖项(推荐安装以获得最佳性能)
extras_require={
"cairo": [
"cairosvg>=2.5.0",
],
"svglib": [
"svglib>=1.4.0",
"reportlab>=3.6.0",
],
"full": [
"cairosvg>=2.5.0",
"svglib>=1.4.0",
"reportlab>=3.6.0",
],
"dev": [
"pytest>=6.0.0",
"pytest-asyncio>=0.18.0",
"black>=22.0.0",
"flake8>=4.0.0",
],
},
# 包分类
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Multimedia :: Graphics :: Graphics Conversion",
"Topic :: Internet :: WWW/HTTP :: HTTP Servers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: OS Independent",
"Environment :: Console",
"Framework :: FastAPI",
],
# 关键词
keywords=[
"svg", "converter", "mcp", "fastmcp", "png", "ico", "jpg",
"graphics", "image", "conversion", "cairo", "chinese", "font"
],
# 项目链接
project_urls={
"Bug Reports": "https://github.com/RusianHu/svg-converter-tools-mcp/issues",
"Source": "https://github.com/RusianHu/svg-converter-tools-mcp",
"Documentation": "https://github.com/RusianHu/svg-converter-tools-mcp/blob/main/README.md",
},
# 入口点配置
entry_points={
"console_scripts": [
"svg-converter-mcp=svg_converter_mcp.__main__:main",
],
},
# 包数据
package_data={
"svg_converter_mcp": [
"*.txt",
"*.md",
],
},
# 排除的文件
exclude_package_data={
"": ["*.pyc", "__pycache__", "*.pyo"],
},
# 压缩安全
zip_safe=False,
# 许可证
license="MIT",
# 平台支持
platforms=["any"],
)