[build-system]
requires = ["setuptools>=68"]
build-backend = "setuptools.build_meta"

[project]
name = "shijing"
version = "0.5.1"
description = "诗经与四书文本分析工具:语料清洗、字频/词频/韵脚统计、词云与候选名出处核验"
requires-python = ">=3.10"
license = {text = "MIT"}
classifiers = [
    "Development Status :: 4 - Beta",
    "License :: OSI Approved :: MIT License",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Topic :: Text Processing :: Linguistic",
    "Natural Language :: Chinese (Simplified)",
    "Natural Language :: Chinese (Traditional)",
]
# 核心依赖只保留 11 条命令里 10 条真正需要的两个包。
# wordcloud / matplotlib 只服务 `cloud`(字云词云出图)这一条命令,
# 却让所有人为了它扛几十 MB 的依赖树 —— 已下沉到可选组 [cloud]。
dependencies = [
    "jieba>=0.42",
    "pypinyin>=0.50",
]

[project.urls]
Homepage = "https://gitcode.com/LLLAAAAA/shijing"
Repository = "https://gitcode.com/LLLAAAAA/shijing"
Issues = "https://gitcode.com/LLLAAAAA/shijing/issues"
Changelog = "https://gitcode.com/LLLAAAAA/shijing/blob/main/CHANGELOG.md"

[project.optional-dependencies]
# pip install shijing[cloud]  即可获得字云 / 词云出图能力
cloud = [
    "wordcloud>=1.9",
    "matplotlib>=3.7",
]
# dev 组带上 cloud:tests/test_cli.py::test_出图落盘 会真的调用 cloud 命令,
# 而 make_cloud 在缺包时 raise SystemExit —— 若 dev 不含 cloud,照 README 装完
# `pip install -e ".[dev]"` 再跑 pytest,这一条不是 skip 而是 ERROR,
# 等于 README 自己写的开发路径必红一条。
dev = [
    "pytest>=8",
    "ruff>=0.5",
    "zhconv>=1.4",
    "matplotlib>=3.7",
    "wordcloud>=1.9",
]

[project.scripts]
shijing = "shijing.cli:main"

[tool.setuptools.packages.find]
where = ["src"]

[tool.ruff]
line-length = 100
target-version = "py310"
src = ["src"]

[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B"]
ignore = ["E501"]

[tool.pytest.ini_options]
testpaths = ["tests"]