Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
147 lines (132 loc) · 2.55 KB
/
Copy pathpyproject.toml
File metadata and controls
147 lines (132 loc) · 2.55 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
[project]
name = "ai-prepare-commit"
version = "0.0.1"
requires-python = ">=3.12,<3.15"
description = "AI assistant that generates git commit messages"
dependencies = [
"click",
"litellm",
"headroom-ai",
"GitPython>=3.1.49",
"typesafe-sdk>=0.7.1",
"onnxruntime>=1.24.0",
"filelock>=4.2.1",
"opentelemetry-sdk>=1.30,<2",
"opentelemetry-exporter-otlp-proto-http>=1.30,<2",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/ai_prepare_commit_msg"]
[project.scripts]
prepare-commit = "ai_prepare_commit_msg:cli"
[tool.setuptools.packages.find]
where = ["src"]
[dependency-groups]
test = [
"behave",
"pytest",
]
quality = [
"mutmut",
"pytest-cov",
]
fmt = [
"black",
"isort",
"ruff",
]
[tool.tox]
env_list = ["py"]
[tool.tox.env_run_base]
base_python = ["python"]
[tool.isort]
profile = "black"
[tool.tox.env.test]
description = "Run unit tests"
dependency_groups = [
"test",
]
commands = [
[
"pytest",
"{posargs:tests}"
],
]
[tool.tox.env.coverage]
description = "Run unit tests with coverage"
dependency_groups = [
"test",
"quality",
]
commands = [
[
"pytest",
"--cov=ai_prepare_commit_msg",
"--cov-report=term-missing",
"--cov-fail-under=80",
"{posargs:tests}",
],
]
[tool.tox.env.mutation]
description = "Run mutation tests"
dependency_groups = [
"test",
"quality",
]
allowlist_externals = [
"python",
]
commands = [
[
"mutmut",
"run",
],
[
"mutmut",
"export-cicd-stats",
],
[
"python",
"-c",
"import json, sys; stats = json.load(open('mutants/mutmut-cicd-stats.json')); total = stats['total'] - stats['skipped']; score = stats['killed'] * 100 / total if total else 0; print('Mutation score:', round(score, 1), '% (minimum 80%)'); sys.exit(score < 80)",
],
]
[tool.tox.env.bdd]
description = "Run Behave BDD scenarios"
dependency_groups = [
"test",
]
commands = [
[
"behave",
"{posargs:features}",
],
]
[tool.pytest.ini_options]
testpaths = [ "tests" ]
[tool.mutmut]
source_paths = [ "src/ai_prepare_commit_msg" ]
pytest_add_cli_args_test_selection = [ "tests" ]
on_dependency_change = "rerun"
[tool.tox.env.fmt]
description = "Format the codebase"
package = "skip"
dependency_groups = [
"fmt",
]
commands = [
[
"black",
".",
],
[
"isort",
".",
],
[
"ruff",
"format",
],
]