-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
226 lines (199 loc) · 6.13 KB
/
pyproject.toml
File metadata and controls
226 lines (199 loc) · 6.13 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
[build-system]
# Ensure packaging uses setuptools at a known minimum version.
requires = ["setuptools>=82.0.0"]
# Use setuptools' PEP 517 backend for builds and installs.
build-backend = "setuptools.build_meta"
[project]
# Publish package metadata under this distribution name.
name = "nixcfg"
# Keep a local placeholder version for this tooling package.
version = "0.0.0"
# Describe the package purpose in distribution metadata.
description = "nixcfg"
# Align all tooling behavior to Python 3.14+ language features.
requires-python = ">=3.14"
# Install runtime libraries required by nixcfg commands.
dependencies = [
"aiohttp>=3.13.3",
"defusedxml>=0.7.1",
"deepdiff>=8.6.1",
"filelock>=3.24.3",
"httpx-retries>=0.4.6",
"httpx>=0.28.1",
"keyring>=25.7.0",
"lz4>=4.4.5",
"nix-manipulator",
"packaging>=26.0",
"pydantic-settings>=2.13.1",
"pydantic>=2.12.5",
"pyyaml>=6.0.3",
"rich>=14.3.3",
"tenacity>=9.1.4",
"tomlkit>=0.14.0",
"typer>=0.24.1",
]
[project.scripts]
# Expose `nixcfg` as a CLI command from the `nixcfg:main` entrypoint.
nixcfg = "nixcfg:main"
[project.optional-dependencies]
# Install these only for schema/code-generation workflows.
codegen = ["datamodel-code-generator[http]>=0.54.0", "referencing>=0.37.0"]
[tool.ruff]
# Turn on Ruff preview behavior to adopt newer checks earlier.
preview = true
# Treat these directories as namespace package roots during resolution.
namespace-packages = ["overlays", "packages"]
# Include extensionless project scripts in Ruff file discovery.
extend-include = ["home/george/bin/git-ignore", "home/george/bin/zen-folders"]
[tool.ruff.lint]
# Start from the full Ruff rule set.
select = ["ALL"]
# Keep only conflict-driven exemptions for formatter/docstyle compatibility.
ignore = ["COM812", "D203", "D213"]
# Enable preview lint rules in addition to stable rules.
preview = true
# Require explicit preview rule codes to avoid accidental prefix selection.
explicit-preview-rules = true
[tool.ruff.lint.per-file-ignores]
# Keep high-signal linting in tests while allowing pragmatic test patterns.
"lib/tests/**/*.py" = [
"ANN001",
"ANN202",
"ARG001",
"ARG005",
"ASYNC109",
"EM101",
"FLY002",
"PERF401",
"PLC0415",
"PLR2004",
"PLW0108",
"PT012",
"PT017",
"PYI034",
"RUF015",
"RUF043",
"S101",
"S108",
"SLF001",
"TC001",
"TC002",
"TC003",
"TRY003",
"TRY004",
]
[tool.ruff.lint.isort]
# Classify these imports as first-party for stable import ordering.
known-first-party = ["lib", "nixcfg"]
[tool.ruff.lint.pycodestyle]
# Allow lines up to 100 chars before E501-style diagnostics trigger.
max-line-length = 100
[tool.ruff.lint.mccabe]
# Permit moderate control-flow complexity in orchestration code.
max-complexity = 20
[tool.ruff.lint.pylint]
# Allow wider function signatures used by CLI and integration surfaces.
max-args = 25
# Allow moderate branching in command and pipeline handlers.
max-branches = 20
# Allow a few early-return paths in command orchestration.
max-returns = 7
[tool.uv]
# Mark this repository as an installable package project for uv.
package = true
[tool.uv.sources]
# Pin `nix-manipulator` to a specific git revision for deterministic resolution.
nix-manipulator = { git = "https://github.com/hoh/nix-manipulator.git", rev = "dbe47853d2f48b6314a9e07e5bad6ba78bdbf6bc" }
[tool.setuptools]
# Ship the top-level `nixcfg.py` module as a distributable module.
py-modules = ["nixcfg"]
[tool.setuptools.packages.find]
# Include package directories rooted under `lib`.
include = ["lib*"]
[tool.ty.src]
# Restrict Ty analysis to maintained source trees and extensionless scripts.
include = [
"nixcfg.py",
"lib/**/*.py",
"lib/**/*.pyi",
"overlays/**/*.py",
"overlays/**/*.pyi",
"packages/**/*.py",
"packages/**/*.pyi",
"modules/**/*.py",
"modules/**/*.pyi",
"home/george/bin/git-ignore",
"home/george/bin/zen-folders",
]
[tool.ty.rules]
# Treat all Ty diagnostics as errors.
all = "error"
[[tool.ty.overrides]]
# Apply this override only to generated model modules.
include = ["lib/**/_generated.py"]
[tool.ty.overrides.rules]
# Ignore a generated-code pattern that is valid at runtime but noisy for static typing.
invalid-type-form = "ignore"
[[tool.ty.overrides]]
# Ignore type-checking diagnostics in test modules.
include = ["lib/tests/**/*.py"]
[tool.ty.overrides.rules]
# Prefer runtime-focused tests over full static typing constraints.
all = "ignore"
[tool.ty.terminal]
# Return non-zero when Ty emits warnings.
error-on-warning = true
[tool.ty.analysis]
# Require explicit `ty: ignore` suppressions by not honoring `type: ignore`.
respect-type-ignore-comments = false
[tool.pytest.ini_options]
# Enforce strict validation of pytest config keys and marker declarations.
addopts = ["--strict-config", "--strict-markers"]
# Limit default test discovery to the `lib` tree.
testpaths = ["lib"]
# Fail when xfail-marked tests unexpectedly pass.
xfail_strict = true
[tool.coverage.run]
# Measure branch coverage in addition to line coverage.
branch = true
# Measure both core and update package trees for coverage.
source = ["lib/nix", "lib/update"]
[tool.coverage.report]
# Require at least this total coverage percentage.
fail_under = 100
# Exclude test modules from coverage totals.
omit = ["lib/tests/*"]
# Show exact missing lines in text coverage reports.
show_missing = true
[tool.mutmut]
# Mutate runtime modules while excluding tests and generated artifacts.
paths_to_mutate = ["lib/nix/commands", "lib/nix/models", "lib/nix/schemas"]
# Copy repository paths needed by pytest when running inside `mutants/`.
also_copy = [
"darwin",
"home",
"lib",
"modules",
"overlays",
"packages",
"flake.lock",
"nixcfg.py",
]
# Focus mutation work on lines hit by coverage.
mutate_only_covered_lines = true
# Point test discovery to the in-repo pytest tree.
tests_dir = ["lib/tests"]
# Skip generated model code from mutation testing.
do_not_mutate = ["lib/nix/models/_generated.py"]
[dependency-groups]
# Install these tools only for local development and quality checks.
dev = [
"cosmic-ray>=8.3.18",
"coverage>=7.13.4",
"datamodel-code-generator[http]>=0.54.0",
"mutmut>=3.5.0",
"pytest>=9.0.2",
"referencing>=0.37.0",
"ruff>=0.15.2",
"ty>=0.0.18",
]