-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
181 lines (166 loc) · 6.17 KB
/
Copy pathpyproject.toml
File metadata and controls
181 lines (166 loc) · 6.17 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
173
174
175
176
177
178
179
180
181
[project]
name = "glidepath"
version = "0.6.0"
description = "Desktop retirement and investment planner (UK-first, region-extensible)."
readme = "README.md"
# MIT code plus one CC BY-NC-SA 4.0 data file (returns_history.toml —
# scope and attribution in LICENSE-DATA).
license = "MIT AND CC-BY-NC-SA-4.0"
license-files = ["LICENSE", "LICENSE-DATA"]
authors = [{ name = "James Williams" }]
requires-python = ">=3.14"
keywords = [
"retirement",
"pension",
"financial-planning",
"investment",
"uk",
"sipp",
"isa",
"monte-carlo",
]
# No License :: classifier — PEP 639: the SPDX expression above is the
# license metadata, and mixing it with license classifiers is deprecated.
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Win32 (MS Windows)",
"Environment :: X11 Applications :: Qt",
"Intended Audience :: End Users/Desktop",
"Intended Audience :: Financial and Insurance Industry",
# The platforms the suite actually runs on (ci.yml); no macOS claim
# until it is tested there.
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.14",
"Topic :: Office/Business :: Financial :: Investment",
"Typing :: Typed",
]
# glidepath is an application, not a library: the runtime dependency is
# pinned exactly so `uv tool install glidepath` installs the same PySide6
# the release was tested against (uv.lock does not apply to end users).
# Bump the pin only via `make deps`.
dependencies = [
"pyside6==6.11.1",
]
[project.urls]
Homepage = "https://williajm.github.io/glidepath/"
Repository = "https://github.com/williajm/glidepath"
Changelog = "https://github.com/williajm/glidepath/blob/main/CHANGELOG.md"
Issues = "https://github.com/williajm/glidepath/issues"
[project.gui-scripts]
glidepath = "glidepath.gui.main:main"
[dependency-groups]
dev = [
"hypothesis",
"mypy",
"pip-audit",
"pre-commit",
"pytest",
"pytest-cov",
"pytest-qt",
"pytest-timeout",
"ruff",
]
[build-system]
requires = ["uv_build>=0.11,<0.13"]
build-backend = "uv_build"
# --- uv ---------------------------------------------------------------------
[tool.uv]
# Supply-chain cooldown: resolution ignores anything published to PyPI after
# this timestamp (now minus 7 days). Updated ONLY by `make deps`.
exclude-newer = "2026-08-06T18:44:36Z"
# PyPI is the ONLY permitted index (supply-chain policy; see CLAUDE.md).
[[tool.uv.index]]
name = "pypi"
url = "https://pypi.org/simple"
default = true
# --- ruff -------------------------------------------------------------------
[tool.ruff]
src = ["src", "tests", "scripts"]
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"COM812", # Redundant with (and conflicts with) the ruff formatter.
"ISC001", # Redundant with (and conflicts with) the ruff formatter.
"CPY001", # No per-file copyright headers; repository-level licensing applies.
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.mccabe]
max-complexity = 10
# BLE001 (app/ slow-run transitions) and PLR0913 (§5.2 runner signatures)
# are granted inline at the specific lines that earned them, not file-wide,
# so new violations elsewhere in those modules still fail lint.
[tool.ruff.lint.per-file-ignores]
"src/glidepath/core/randomness.py" = [
"S311", # Seeded Monte Carlo simulation draws, never security material (planning §4.6).
]
"scripts/build_returns_history.py" = [
"S314", # xml.etree parses the JST workbook the developer supplies locally, never untrusted input.
]
"tests/**" = [
"S101", # pytest tests use bare assert by design.
"PLR2004", # Literal expected values in assertions are idiomatic in tests.
"INP001", # tests/ is intentionally not a package (pytest src-layout).
"PLR0913", # Test-data factories take many optional keyword knobs by design.
]
"scripts/**" = [
"T201", # Standalone CLI scripts report via print.
"INP001", # scripts/ is intentionally not a package.
]
# --- mypy -------------------------------------------------------------------
[tool.mypy]
strict = true
# Not implied by strict: flags code mypy can prove unreachable — high-yield
# in Decimal/None-narrowing-heavy code.
warn_unreachable = true
python_version = "3.14"
files = ["src", "tests", "scripts"]
# Lets the tests' top-level script imports (e.g. `import check_dep_age`)
# and the shared test factories (`import factories`) resolve — mirrors
# pytest's pythonpath below.
mypy_path = ["scripts", "tests"]
# --- pytest / coverage ------------------------------------------------------
[tool.pytest.ini_options]
addopts = [
"-ra",
"--strict-markers",
"--strict-config",
"--cov=glidepath",
"--cov=scripts",
"--cov-report=term-missing",
"--cov-report=xml",
]
testpaths = ["tests"]
# Neither scripts/ nor tests/ is a package; tests import the operational
# scripts (the gates behind `make deps`/`make bump`/releases) and the
# shared test-data factories (tests/factories.py) as top-level modules.
pythonpath = ["scripts", "tests"]
# Fail a stuck test fast instead of hanging CI for the runner limit: the
# GUI suite waits on worker pools for up to 60s, so the ceiling sits
# safely above that while still cutting a wedged run short.
timeout = 120
# pytest-qt would autodetect PySide6 anyway; pinning the binding keeps the
# plugin from ever picking up a stray PyQt installed into the venv.
qt_api = "pyside6"
markers = [
"gui: exercises the PySide6 shell on the offscreen Qt platform",
"slow: long-running engine sweeps (Monte Carlo, backtest, solvers); deselect with -m 'not slow'",
]
[tool.coverage.run]
branch = true
# The Monte Carlo performance harness is a manual measurement tool
# (planning §4.6), run by hand and read by a human — the only scripts/
# entry outside the coverage gate.
omit = ["scripts/measure_mc_performance.py"]
[tool.coverage.report]
# The suite sits at ~98%; a floor close behind it means an entire module
# losing its tests fails CI instead of coasting on the old 90% margin.
fail_under = 96
show_missing = true
exclude_lines = [
"pragma: no cover",
# Script entry-point guards: the tests call main() directly.
'if __name__ == "__main__":',
]