-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
350 lines (302 loc) · 12.8 KB
/
pyproject.toml
File metadata and controls
350 lines (302 loc) · 12.8 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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
[project]
name = "prosemark"
description = "A command-line tool for planning, organizing, and writing stories using a hierarchical document structure"
readme = "README.md"
authors = [
{ name = "David Eyk", email = "david@worldsenoughstudios.com" }
]
dynamic = ["version"]
license = "MIT"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Topic :: Software Development :: Libraries",
"Topic :: Artistic Software",
"Topic :: Office/Business",
"Topic :: Text Editors",
"Topic :: Text Editors :: Integrated Development Environments (IDE)",
"Topic :: Text Editors :: Text Processing",
"Topic :: Text Processing",
"Topic :: Text Processing :: Markup :: Markdown",
]
requires-python = ">=3.13"
dependencies = [
"click>=8.1.8",
"click-extra[pygments]>=4.15.0",
"polyfactory>=2.21.0",
"prompt-toolkit>=3.0.51",
"pydantic>=2.11.4",
"pyyaml>=6.0.2",
"textual>=0.63.0",
"typer>=0.12.0",
"types-psutil>=7.0.0.20250822",
"uuid-extension>=0.2.0",
]
[project.scripts]
pmk = "prosemark.cli:main"
[build-system]
requires = ["hatchling", "uv-dynamic-versioning"]
build-backend = "hatchling.build"
[tool.hatch.version]
source = "uv-dynamic-versioning"
[tool.hatch.build.hooks.version]
path = "src/prosemark/_version.py"
template = """
version = '{version}'
"""
[tool]
[tool.uv-dynamic-versioning]
vcs = "git"
dirty = true
style = "pep440"
pattern = "default"
fallback-version = "0.0.0"
[dependency-groups]
dev = [
"ipython>=9.2.0",
"pdbpp>=0.11.6",
"pre-commit>=4.2.0",
"pytest>=8.3.5",
"pytest-cov>=6.1.1",
"pytest-random-order>=1.1.1",
"types-pyyaml>=6.0.12.20250402",
]
test = [
"click-extra[pytest]>=4.15.0",
"coverage>=7.8.0",
"hypothesis>=6.131.9",
"mypy>=1.15.0",
"pytest>=8.3.5",
"pytest-cov>=6.1.1",
"pytest-mock>=3.14.0",
"pytest-profiling>=1.8.1",
"pytest-random-order>=1.1.1",
"pytest-recording>=0.13.3",
"pytest-xdist>=3.6.1",
"ruff>=0.11.8",
"snakeviz>=2.2.2",
"syrupy>=4.9.1",
"types-psutil>=6.1.0.20241106",
]
[tool.uv]
package = true
[tool.uv.build-backend]
module-root = "src"
[tool.ruff]
# Python linter & formatter
# https://docs.astral.sh/ruff/
line-length = 120
src = ["src"]
target-version = "py312"
[tool.ruff.lint]
preview = true
# https://docs.astral.sh/ruff/rules/
select = [
"A", # https://docs.astral.sh/ruff/rules/#flake8-builtins-a
"ANN", # https://docs.astral.sh/ruff/rules/#flake8-annotations-ann
"ARG", # https://docs.astral.sh/ruff/rules/#flake8-unused-arguments-arg
"ASYNC", # https://docs.astral.sh/ruff/rules/#flake8-async-async
"B", # https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
"BLE", # https://docs.astral.sh/ruff/rules/#flake8-blind-except-ble
"C4", # https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
"C90", # https://docs.astral.sh/ruff/rules/#mccabe-c90
"COM", # https://docs.astral.sh/ruff/rules/#flake8-commas-com
"D", # https://docs.astral.sh/ruff/rules/#pydocstyle-d
"DJ", # https://docs.astral.sh/ruff/rules/#flake8-django-dj
"DTZ", # https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
"E", # https://docs.astral.sh/ruff/rules/#error-e
"EM", # https://docs.astral.sh/ruff/rules/#flake8-errmsg-em
"ERA", # https://docs.astral.sh/ruff/rules/#eradicate-era
"EXE", # https://docs.astral.sh/ruff/rules/#flake8-executable-exe
"F", # https://docs.astral.sh/ruff/rules/#pyflakes-f
"FA", # https://docs.astral.sh/ruff/rules/#flake8-future-annotations-fa
"FBT", # https://docs.astral.sh/ruff/rules/#flake8-boolean-trap-fbt
"FLY", # https://docs.astral.sh/ruff/rules/#flynt-fly
"FURB", # https://docs.astral.sh/ruff/rules/#refurb-furb
"G", # https://docs.astral.sh/ruff/rules/#flake8-logging-format-g
"I", # https://docs.astral.sh/ruff/rules/#isort-i
"ICN", # https://docs.astral.sh/ruff/rules/#flake8-import-conventions-icn
"INP", # https://docs.astral.sh/ruff/rules/#flake8-no-pep420-inp
"INT", # https://docs.astral.sh/ruff/rules/#flake8-gettext-int
"ISC", # https://docs.astral.sh/ruff/rules/#flake8-implicit-str-concat-isc
"LOG", # https://docs.astral.sh/ruff/rules/#flake8-logging-log
"N", # https://docs.astral.sh/ruff/rules/#pep8-naming-n
"PERF", # https://docs.astral.sh/ruff/rules/#perflint-perf
"PGH", # https://docs.astral.sh/ruff/rules/#pygrep-hooks-pgh
"PIE", # https://docs.astral.sh/ruff/rules/#flake8-pie-pie
"PL", # https://docs.astral.sh/ruff/rules/#pylint-pl
"PT", # https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt
"PTH", # https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth
"PYI", # https://docs.astral.sh/ruff/rules/#flake8-pyi-pyi
"Q", # https://docs.astral.sh/ruff/rules/#flake8-quotes-q
"RET", # https://docs.astral.sh/ruff/rules/#flake8-return-ret
"RSE", # https://docs.astral.sh/ruff/rules/#flake8-raise-rse
"RUF", # https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
"S", # https://docs.astral.sh/ruff/rules/#flake8-bandit-s
"SIM", # https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
"SLF", # https://docs.astral.sh/ruff/rules/#flake8-self-slf
"SLOT", # https://docs.astral.sh/ruff/rules/#flake8-slots-slot
"T10", # https://docs.astral.sh/ruff/rules/#flake8-debugger-t10
"T20", # https://docs.astral.sh/ruff/rules/#flake8-print-t20
"TCH", # https://docs.astral.sh/ruff/rules/#flake8-type-checking-tch
"TD", # https://docs.astral.sh/ruff/rules/#flake8-todos-td
"TID", # https://docs.astral.sh/ruff/rules/#flake8-tidy-imports-tid
"TRY", # https://docs.astral.sh/ruff/rules/#tryceratops-try
"UP", # https://docs.astral.sh/ruff/rules/#pyupgrade-up
"W", # https://docs.astral.sh/ruff/rules/#warning-w
"YTT", # https://docs.astral.sh/ruff/rules/#flake8-2020-ytt
]
ignore = [
"COM812", # https://docs.astral.sh/ruff/rules/missing-trailing-comma/
"D105", # https://docs.astral.sh/ruff/rules/undocumented-magic-method/
"D106", # https://docs.astral.sh/ruff/rules/undocumented-public-nested-class/
"D107", # https://docs.astral.sh/ruff/rules/undocumented-public-init/
"D203", # https://docs.astral.sh/ruff/rules/one-blank-line-before-class/
"D213", # https://docs.astral.sh/ruff/rules/multi-line-summary-second-line/
"D400", # https://docs.astral.sh/ruff/rules/ends-in-period/
"D401", # https://docs.astral.sh/ruff/rules/non-imperative-mood/
"D404", # https://docs.astral.sh/ruff/rules/docstring-starts-with-this/
"D415", # https://docs.astral.sh/ruff/rules/ends-in-punctuation/
"E501", # https://docs.astral.sh/ruff/rules/line-too-long/
"EM101", # https://docs.astral.sh/ruff/rules/raw-string-in-exception/
"FURB189", # https://docs.astral.sh/ruff/rules/subclass-builtin/
"ISC001", # https://docs.astral.sh/ruff/rules/single-line-implicit-string-concatenation/
"PLC0415", # https://docs.astral.sh/ruff/rules/import-outside-toplevel/ - acceptable for lazy imports
"PLC2801", # https://docs.astral.sh/ruff/rules/unnecessary-dunder-call/ - acceptable for dataclass patterns
"PLR0913", # https://docs.astral.sh/ruff/rules/too-many-arguments/ - acceptable for DI patterns
"PLR0917", # https://docs.astral.sh/ruff/rules/too-many-positional-arguments/ - acceptable for DI patterns
"PLR1702", # https://docs.astral.sh/ruff/rules/too-many-nested-blocks/ - acceptable for complex logic
"RUF045", # https://docs.astral.sh/ruff/rules/assignment-without-annotation/ - acceptable for dataclass constants
"TD002", # https://docs.astral.sh/ruff/rules/missing-todo-author/
"TD003", # https://docs.astral.sh/ruff/rules/missing-todo-link/
"TRY003", # https://docs.astral.sh/ruff/rules/raise-vanilla-args/
"PT012", # https://docs.astral.sh/ruff/rules/pytest-raises-multiple-statements/ - acceptable for TDD patterns
]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
[tool.ruff.lint.per-file-ignores]
"tests/**/test*.py" = [
"S101",
"D1",
"INP001",
"ARG001",
"ARG002",
"PLC1901", # Empty string comparisons - acceptable in test assertions
"PLC2701", # Private name imports - acceptable for testing private functions
"PLR0904", # Too many public methods - acceptable in test classes
"PLR0914", # Too many local variables - acceptable in test setup
"PLR2004", # Magic value literals - acceptable in test data
"PLR6301", # Static method suggestions - acceptable in test methods
"SLF001", # Private member access - acceptable for testing private methods
"PLC0415", # Import placement - acceptable in test functions
"S108", # Mock paths using /tmp - acceptable in tests
"ANN001", # Missing type annotations - acceptable in test helpers
"ANN202", # Missing return type annotations - acceptable in test helpers
"B903", # Dataclass suggestions - acceptable for simple test mocks
"FBT001", # Boolean positional args - acceptable in test helpers
"FBT002", # Boolean default args - acceptable in test helpers
"RUF043", # Regex patterns in pytest.raises - acceptable test pattern
"PT017", # Assertions on exception in except blocks - acceptable test pattern
"RET504", # Unnecessary assignment before return - acceptable for clarity in tests
]
"tests/**/conftest.py" = [
"S101",
"D1",
"INP001",
"ARG001",
]
"tests/helpers/*.py" = [
"PLR2004", # Magic value literals - acceptable in test helpers
]
"tests/integration/templates/test_complete_template_workflow.py" = [
"E402", # Module level import not at top of file - acceptable for TDD pattern
"C901", # Function too complex - acceptable for integration tests
]
"tests/integration/templates/test_directory_template.py" = [
"E402", # Module level import not at top of file - acceptable for TDD pattern
]
"tests/contract/templates/test_user_prompter_contract.py" = [
"PT012", # pytest.raises multiple statements - acceptable for TDD patterns
]
"tests/integration/templates/test_simple_template.py" = [
"PT012", # pytest.raises multiple statements - acceptable for TDD patterns
"ANN001", # Missing type annotations - acceptable for mock fixtures
"PLR6201", # Set literals - acceptable for error type checking
]
"tests/integration/templates/test_template_errors.py" = [
"SIM105", # contextlib.suppress - acceptable for optional operations
"S110", # try-except-pass - acceptable for optional file operations
"BLE001", # Blind except - acceptable for file permission operations
"F841", # Unused variable - acceptable for error-raising patterns
"PLR6201", # Set literals - acceptable for error type checking
]
# Interface methods that must remain instance methods for protocol compliance
"src/prosemark/adapters/clock_system.py" = ["PLR6301"]
"src/prosemark/adapters/fake_config.py" = ["PLR6301"]
"src/prosemark/adapters/editor_launcher_system.py" = ["PLR6301"]
"src/prosemark/adapters/id_generator.py" = ["PLR6301"]
"src/prosemark/adapters/id_generator_uuid7.py" = ["PLR6301"]
# Fake adapters implement complete interfaces, leading to many methods
"src/prosemark/adapters/fake_node_repo.py" = ["PLR0904"]
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
inline-quotes = "single"
[tool.ruff.format]
preview = true
quote-style = "single"
docstring-code-format = true
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false
[tool.pytest.ini_options]
# The best Python test runner
# https://docs.pytest.org/en/latest/contents.html
testpaths = ["tests/"]
addopts = [
"--cov",
"--cov-report=term:skip-covered",
"--no-cov-on-fail",
"--strict-markers",
"--strict-config",
"--random-order",
]
markers = [
# If you have slow tests that you want to exclude, mark them like so:
# @pytest.mark.slow
# def test_my_slow_test():
# # ...
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"asyncio: marks tests as async (requires pytest-asyncio)",
]
[tool.coverage.run]
# Python test coverage tool
# https://coverage.readthedocs.io/
plugins = [
]
branch = true
source = ['src']
omit = [
'tests/*.py',
'src/prosemark/_version.py',
]
[tool.coverage.report]
show_missing = true
[tool.mypy]
# Python type checking
# https://www.mypy-lang.org/
strict = true
plugins = [
"pydantic.mypy",
]
mypy_path = "src"
[tool.hatch.build.targets.wheel]
packages = ["src/prosemark"]
include = ["src/prosemark/py.typed"]
[tool.isort]
# Python import sorter
# https://pycqa.github.io/isort/
profile = "black"