2026-10-08 23:47:50 +08:00
|
|
|
[build-system]
|
|
|
|
|
build-backend = "hatchling.build"
|
|
|
|
|
requires = ["hatchling"]
|
|
|
|
|
|
|
|
|
|
[project]
|
2026-10-11 21:21:45 +08:00
|
|
|
classifiers = [
|
|
|
|
|
"Development Status :: 3 - Alpha",
|
|
|
|
|
"Programming Language :: Python :: 3",
|
|
|
|
|
"Programming Language :: Python :: 3.11",
|
|
|
|
|
"Programming Language :: Python :: 3.12",
|
|
|
|
|
"Programming Language :: Python :: 3.13",
|
|
|
|
|
"Programming Language :: Python :: 3.14",
|
|
|
|
|
]
|
2026-10-08 23:47:50 +08:00
|
|
|
dependencies = []
|
|
|
|
|
description = "精细化状态控制的 Python 管道任务控制工具"
|
|
|
|
|
name = "chongming-task"
|
|
|
|
|
readme = "README.md"
|
|
|
|
|
requires-python = ">=3.11"
|
2026-10-11 21:21:45 +08:00
|
|
|
version = "0.1.1"
|
2026-10-08 23:47:50 +08:00
|
|
|
|
|
|
|
|
[project.scripts]
|
|
|
|
|
chongming-task = "chongming_task.cli.main:main"
|
|
|
|
|
|
|
|
|
|
[project.optional-dependencies]
|
|
|
|
|
postgres = [
|
2026-10-11 21:21:45 +08:00
|
|
|
"psycopg-pool>=3.2",
|
|
|
|
|
"psycopg[binary]>=3.2",
|
2026-10-08 23:47:50 +08:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
# 核心包运行时零第三方依赖(CLI 也只用标准库 argparse)。
|
|
|
|
|
# 观测后端等适配器在各自阶段追加为 [project.optional-dependencies]。
|
|
|
|
|
|
|
|
|
|
[dependency-groups]
|
|
|
|
|
dev = [
|
2026-10-11 21:21:45 +08:00
|
|
|
"pytest>=8.0",
|
|
|
|
|
"hypothesis>=6.100",
|
|
|
|
|
"ruff>=0.6",
|
|
|
|
|
"mypy>=1.11",
|
|
|
|
|
"psycopg[binary]>=3.2",
|
|
|
|
|
"psycopg-pool>=3.2",
|
|
|
|
|
"twine>=7.0.0",
|
2026-10-08 23:47:50 +08:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
|
|
|
packages = ["src/chongming_task"]
|
|
|
|
|
|
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
# 工具链
|
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
[tool.ruff]
|
|
|
|
|
line-length = 100
|
|
|
|
|
src = ["src", "tests"]
|
2026-10-11 21:21:45 +08:00
|
|
|
target-version = "py311"
|
2026-10-08 23:47:50 +08:00
|
|
|
# pytest 的临时目录默认落在项目根下,测试往里写的临时 .py 文件不该被 lint 扫到
|
|
|
|
|
# (其中不乏**故意写坏**的样本,例如"导入一个不存在的依赖")。
|
|
|
|
|
extend-exclude = ["pytest-of-*"]
|
|
|
|
|
|
|
|
|
|
[tool.ruff.lint]
|
|
|
|
|
ignore = [
|
2026-10-11 21:21:45 +08:00
|
|
|
"RUF001", # 允许注释/字符串中的中文全角标点
|
|
|
|
|
"RUF002",
|
|
|
|
|
"RUF003",
|
2026-10-08 23:47:50 +08:00
|
|
|
]
|
2026-10-11 21:21:45 +08:00
|
|
|
select = ["E", "F", "I", "UP", "B", "SIM", "RUF", "C4", "PTH"]
|
2026-10-08 23:47:50 +08:00
|
|
|
|
|
|
|
|
[tool.ruff.lint.per-file-ignores]
|
|
|
|
|
"tests/**" = ["B011"]
|
|
|
|
|
|
|
|
|
|
[tool.ruff.lint.isort]
|
|
|
|
|
known-first-party = ["chongming_task"]
|
|
|
|
|
|
|
|
|
|
# 内核必须保持可被状态机属性测试穷举验证的纯粹性,故 src 全量 strict。
|
|
|
|
|
[tool.mypy]
|
2026-10-11 21:21:45 +08:00
|
|
|
files = ["src"]
|
2026-10-08 23:47:50 +08:00
|
|
|
python_version = "3.11"
|
2026-10-11 21:21:45 +08:00
|
|
|
show_error_codes = true
|
2026-10-08 23:47:50 +08:00
|
|
|
strict = true
|
|
|
|
|
warn_redundant_casts = true
|
2026-10-11 21:21:45 +08:00
|
|
|
warn_unreachable = true
|
2026-10-08 23:47:50 +08:00
|
|
|
|
|
|
|
|
[[tool.mypy.overrides]]
|
|
|
|
|
disallow_incomplete_defs = false
|
2026-10-11 21:21:45 +08:00
|
|
|
disallow_untyped_defs = false
|
|
|
|
|
module = "tests.*"
|
2026-10-08 23:47:50 +08:00
|
|
|
|
|
|
|
|
[tool.pytest.ini_options]
|
|
|
|
|
addopts = "-ra --strict-markers --strict-config"
|
2026-10-11 21:21:45 +08:00
|
|
|
filterwarnings = ["error"]
|
2026-10-08 23:47:50 +08:00
|
|
|
markers = [
|
2026-10-11 21:21:45 +08:00
|
|
|
"slow: 耗时较长的集成测试",
|
|
|
|
|
"windows_only: 仅在 Windows 上有意义的用例",
|
|
|
|
|
"posix_only: 仅在 POSIX 上有意义的用例",
|
2026-10-08 23:47:50 +08:00
|
|
|
]
|
2026-10-11 21:21:45 +08:00
|
|
|
testpaths = ["tests"]
|