-
Notifications
You must be signed in to change notification settings - Fork 151
Expand file tree
/
Copy pathtox.ini
More file actions
157 lines (144 loc) · 4.06 KB
/
Copy pathtox.ini
File metadata and controls
157 lines (144 loc) · 4.06 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
[tox]
requires =
tox>=4.32
tox-uv>=1.29
env_list =
fix
type
py310-parallel
py311-parallel
py312-parallel
py313-parallel
py314-parallel
readme
cli-docs
llms-txt
schema-docs
config-types
perf
coverage
docs
pkg_meta
dev
skip_missing_interpreters = true
[testenv]
runner = uv-venv-lock-runner
description = run tests under {base_python}
package = wheel
dependency_groups = test
set_env =
COVERAGE_FILE = {work_dir}/.coverage.{env_name}
UV_CACHE_DIR = {work_dir}{/}uv-cache
commands =
pytest {posargs:-n auto --color=yes --cov fastapi_code_generator --cov tests --cov-branch --cov-config=pyproject.toml --cov-report term-missing:skip-covered --cov-report xml:{work_dir}{/}coverage.{env_name}.xml tests}
[testenv:fix]
description = format the code base
commands =
pre-commit run --all-files --show-diff-on-failure
dependency_groups = lint
no_default_groups = true
[testenv:type]
description = run type checks
commands =
mypy fastapi_code_generator
dependency_groups =
test
type
no_default_groups = true
[testenv:cli-docs]
description = build CLI documentation (use --check to validate only)
base_python = python3.14
commands =
pytest --collect-cli-docs -p no:xdist -q --cov fastapi_code_generator --cov tests --cov-branch --cov-config=pyproject.toml --cov-report=
python scripts/build_cli_docs.py {posargs}
python scripts/build_prompt_data.py --output fastapi_code_generator/prompt_data.py {posargs}
dependency_groups = test
no_default_groups = true
[testenv:readme]
description = validate README command examples and help snapshots
base_python = python3.14
commands =
pytest -p no:xdist -q tests/test_readme.py
python scripts/update_command_help_on_markdown.py {posargs:--check}
dependency_groups = test
no_default_groups = true
[testenv:llms-txt]
description = generate llms.txt files (use --check to validate only)
base_python = python3.14
commands =
python scripts/build_llms_txt.py {posargs}
dependency_groups = docs
no_default_groups = true
[testenv:schema-docs]
description = build supported format documentation (use --check to validate only)
base_python = python3.14
commands =
python scripts/build_schema_docs.py {posargs}
dependency_groups = test
no_default_groups = true
[testenv:config-types]
description = generate config TypedDicts (use --check to validate only)
base_python = python3.14
commands =
python -m fastapi_code_generator.config {posargs:--check}
dependency_groups = test
no_default_groups = true
[testenv:coverage]
description = combine coverage files and generate reports
base_python = python3.14
skip_install = true
pass_env =
DIFF_AGAINST
set_env =
COVERAGE_FILE = {work_dir}/.coverage
commands =
coverage combine
coverage xml -o {work_dir}{/}coverage.xml
coverage html -d {work_dir}{/}htmlcov
diff-cover --compare-branch {env:DIFF_AGAINST:origin/main} {work_dir}{/}coverage.xml
coverage report --fail-under=100 --skip-covered --show-missing
depends =
py310-parallel
py311-parallel
py312-parallel
py313-parallel
py314-parallel
readme
cli-docs
schema-docs
config-types
dependency_groups = coverage
no_default_groups = true
[testenv:docs]
description = build documentation site
base_python = python3.14
commands =
zensical build --clean
dependency_groups =
docs
no_default_groups = true
[testenv:perf]
description = run performance benchmarks with codspeed markers
base_python = python3.14
commands =
pytest {posargs:--color=yes --codspeed tests/main/test_performance.py}
dependency_groups =
test
benchmark
no_default_groups = true
[testenv:pkg_meta]
description = build and validate package artifacts
skip_install = true
commands =
uv build --sdist --wheel --out-dir {env_tmp_dir} .
twine check {env_tmp_dir}{/}*
check-wheel-contents --no-config {env_tmp_dir}
dependency_groups = pkg-meta
no_default_groups = true
[testenv:dev]
description = create a development environment
package = editable
commands =
uv pip tree
python -c "import sys; print(sys.executable)"
dependency_groups = dev