-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
172 lines (150 loc) · 5.92 KB
/
Copy pathpyproject.toml
File metadata and controls
172 lines (150 loc) · 5.92 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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
[project]
name = "oaknational-python-repo-template"
version = "0.4.4"
description = "Reusable Oak Python template with agent infrastructure, strict quality gates, and a demo CLI."
readme = "README.md"
requires-python = ">=3.14"
dependencies = [
"pandas>=3.0.3",
"numpy>=2.4.6",
"pyarrow>=24.0.0",
"pyyaml>=6.0.3",
"matplotlib>=3.11.0",
"requests>=2.34.2",
]
license = "MIT"
license-files = ["LICENCE"]
authors = [{ name = "Oak National Academy" }]
keywords = ["oak", "template", "starter", "agentic-engineering", "quality-gates"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.14",
"Topic :: Software Development :: Libraries :: Application Frameworks",
"Typing :: Typed",
]
[project.scripts]
activity-report = "oaknational.python_repo_template.demo.activity_report:main"
[project.urls]
Homepage = "https://github.com/oaknational/oak-python-starter"
Repository = "https://github.com/oaknational/oak-python-starter"
Issues = "https://github.com/oaknational/oak-python-starter/issues"
[build-system]
requires = ["hatchling>=1.30.1"]
build-backend = "hatchling.build"
[tool.uv]
package = true
[tool.commitizen]
name = "cz_conventional_commits"
version_provider = "uv"
tag_format = "v$version"
update_changelog_on_bump = true
# Custom bump policy: feat/fix -> MINOR, everything else -> PATCH. Breaking
# markers are intentionally NOT mapped to MAJOR — major releases are cut manually
# (the release workflow stands down on a breaking marker). The catch-all "^.+"
# must stay last so feat/fix match first.
#
# NOTE: cz_conventional_commits hardcodes its own bump map and ignores this one,
# so tools/release_increment.py reads this map and computes the increment for the
# release workflow (`cz bump --increment ...`). This stays the single policy
# source. See docs/dev-tooling.md and
# .agent/plans/runtime-infrastructure/current/release-automation.md.
bump_map = { "^feat" = "MINOR", "^fix" = "MINOR", "^.+" = "PATCH" }
bump_map_major_version_zero = { "^feat" = "MINOR", "^fix" = "MINOR", "^.+" = "PATCH" }
[dependency-groups]
dev = [
"pytest>=9.1.0",
"pytest-cov>=7.1.0",
"hypothesis>=6.100.0",
"pyright>=1.1.410",
"ruff>=0.15.17",
"pre-commit>=4.6.0",
"commitizen>=4.16.3",
"deptry>=0.25.1",
"import-linter>=2.0.0",
"pandas-stubs>=3.0.3.260530",
"types-requests>=2.33.0.20260518",
"pymarkdownlnt>=0.9.38",
"pip-audit>=2.7.3",
"codespell>=2.3.0",
]
[tool.deptry]
known_first_party = ["oaknational"]
[tool.deptry.per_rule_ignores]
DEP002 = ["pyarrow"]
[tool.codespell]
# en-GB spell check. British spellings pass codespell's default dictionary, so
# no en-GB conversion fires and no ignore list is needed yet. Add repo jargon to
# `ignore-words-list` only when codespell genuinely flags a real non-word.
skip = "*.lock,./.git,./.venv,./dist,./build,./.ruff_cache,./.pytest_cache,./htmlcov,**/__pycache__,*.png,*.parquet"
[tool.hatch.build.targets.wheel]
only-include = ["src/oaknational/python_repo_template"]
sources = { "src" = "" }
[tool.hatch.build.targets.wheel.force-include]
"src/oaknational/python_repo_template/py.typed" = "oaknational/python_repo_template/py.typed"
[tool.ruff]
line-length = 100
target-version = "py314"
[tool.ruff.lint]
select = ["E", "F", "I", "B", "UP"]
[tool.ruff.format]
quote-style = "double"
[tool.pyright]
include = ["src", "tests", "tools"]
pythonVersion = "3.14"
typeCheckingMode = "strict"
[tool.pymarkdown]
# Recognise YAML front matter so the parser does not read a closing `---` as a
# setext heading. Disable line-length (MD013): this doc estate reflows prose and
# carries tables, links, and code that a hard column limit would fight. Disable
# first-line-heading (MD041): partials, rule files, and reviewer templates
# legitimately open with a sub-heading or prose. Allow repeated sibling headings
# (MD024) such as per-session "What Was Done" sections. Disable ordered-list
# prefix (MD029): some rule docs number their items continuously across section
# breaks as stable reference IDs. Every other rule, including MD040 (fenced code
# must declare a language) and MD025 (a single top-level heading), stays on.
extensions.front-matter.enabled = true
plugins.md013.enabled = false
plugins.md041.enabled = false
plugins.md024.siblings_only = true
plugins.md029.enabled = false
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-v --tb=short"
pythonpath = [".", "src"]
[tool.coverage.run]
source = ["oaknational.python_repo_template"]
omit = ["src/oaknational/python_repo_template/devtools.py"]
# Measure branch coverage, not just line coverage, so an untaken branch of a
# conditional counts as a gap. audit_coverage_contract pins this on so it cannot
# be silently disabled to inflate the number.
branch = true
# Emit repo-relative paths so the Cobertura report maps onto repository files in
# GitHub Code Quality and stays reproducible across machines and CI runners.
relative_files = true
[tool.coverage.report]
show_missing = true
skip_covered = true
# Honest floor: with branch coverage on the suite achieves ~87.6%, so the gate
# guards that level rather than rubber-stamping a far-lower number.
# audit_coverage_contract pins this at or above 86 and pins the omit-list, so
# neither can be quietly weakened to game the gate (the coverage gate itself
# cannot protect its own threshold).
fail_under = 86
[tool.importlinter]
root_package = "oaknational.python_repo_template"
[[tool.importlinter.contracts]]
name = "Data boundary code must not import demo surfaces"
type = "forbidden"
source_modules = ["oaknational.python_repo_template.data"]
forbidden_modules = ["oaknational.python_repo_template.demo"]
[[tool.importlinter.contracts]]
name = "Product code must not import devtools"
type = "forbidden"
source_modules = [
"oaknational.python_repo_template.data",
"oaknational.python_repo_template.demo",
]
forbidden_modules = ["oaknational.python_repo_template.devtools"]