[build-system] requires = ["setuptools>=68"] build-backend = "setuptools.build_meta" [project] name = "maze-env" version = "0.4.0" description = "Production-grade 2-D maze RL environment (Gymnasium)" requires-python = ">=3.10" dependencies = [ "gymnasium>=0.29", "numpy>=1.24", "pyyaml>=6.0", ] [project.optional-dependencies] dev = [ "pytest>=8.0", "pytest-html>=4.0", "pytest-cov>=5.0", ] [tool.setuptools.packages.find] where = ["."] include = ["maze_env*", "src*"] # ───────────────────────────────────────────── # pytest 全局配置 # ───────────────────────────────────────────── [tool.pytest.ini_options] testpaths = ["tests"] python_files = ["test_*.py"] python_classes = ["Test*"] python_functions= ["test_*"] # 每次运行自动生成带时间戳的 HTML 报告 + JUnit XML addopts = """ -v --tb=short --strict-markers --cov=maze_env --cov=src --cov-report=term-missing --cov-report=html:reports/coverage --cov-report=xml:coverage.xml --cov-fail-under=90 """ # 自定义 markers(防止 PytestUnknownMarkWarning) markers = [ "unit: pure unit tests with no I/O", "integration: tests that read files or call reset/step chains", "slow: tests that loop many episodes", ] # ───────────────────────────────────────────── # coverage 配置 # ───────────────────────────────────────────── [tool.coverage.run] source = ["maze_env", "src"] omit = ["src/report.py", "src/plot_curves.py"] branch = true # 分支覆盖(比行覆盖更严格) [tool.coverage.report] show_missing = true skip_covered = false exclude_lines = [ "pragma: no cover", "if TYPE_CHECKING:", "def __repr__", "raise NotImplementedError", ]