-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtox.ini
More file actions
81 lines (70 loc) · 1.58 KB
/
tox.ini
File metadata and controls
81 lines (70 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# =============================================================================
# Tox Configuration
# 用途: 本地和 CI 中统一的多版本测试环境
# =============================================================================
[tox]
# 所有支持的 Python 版本
envlist = py38,py39,py310,py311,py312
# 跳过缺失的 Python 解释器
skip_missing_interpreters = true
# 最小版本
minversion = 4.0
[testenv]
# 安装当前包(可编辑模式)
usedevelop = true
# 依赖
deps =
pytest>=7.0.0
pytest-cov>=4.0.0
# 测试命令
commands =
pytest {posargs:--cov=deep_solutions --cov-report=term-missing --cov-report=xml}
# 环境变量
passenv =
CI
GITHUB_*
# 描述
description = Run tests with pytest
[testenv:lint]
# 代码质量检查环境
skip_install = true
deps =
ruff>=0.4.0
commands =
ruff format --check src/ tests/
ruff check src/ tests/
description = Check code formatting and linting
[testenv:type]
# 类型检查环境
deps =
mypy>=1.0.0
{[testenv]deps}
commands =
mypy src/
description = Run type checking with mypy
[testenv:build]
# 构建检查环境
skip_install = true
deps =
build>=0.10.0
twine>=4.0.0
commands =
python -m build
twine check dist/*
description = Build package and check distribution
[testenv:docs]
# 文档构建环境
deps =
sphinx>=6.0.0
sphinx-rtd-theme>=1.2.0
commands =
sphinx-build -W -b html docs/source docs/build/html
description = Build documentation
# GitHub Actions 集成
[gh]
python =
3.8 = py38
3.9 = py39
3.10 = py310
3.11 = py311
3.12 = py312