Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
205 lines (191 loc) · 8.5 KB
/
Copy pathpyproject.toml
File metadata and controls
205 lines (191 loc) · 8.5 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "draftwright"
version = "0.5.0.dev0"
description = "Automated technical-drawing generation for build123d"
readme = "README.md"
license = { file = "LICENSE" }
authors = [{ name = "Paul Fremantle", email = "paul@fremantle.org" }]
requires-python = ">=3.10,<3.15"
dependencies = [
# build123d ≤0.10 pulls cadquery-ocp (VTK), whose VTK caps at Python 3.12; 0.11 switched to
# cadquery-ocp-novtk, which ships 3.13/3.14 wheels and drops VTK entirely (draftwright is
# headless — it never imports VTK). Split by Python: keep the proven ≤3.12 stack, use 0.11 on
# 3.13+. Mirrors pzfreo/build123d-mcp's dependency handling.
"build123d>=0.9.0,<0.11 ; python_full_version < '3.13'",
"build123d>=0.11,<0.12 ; python_full_version >= '3.13'",
# Supported build123d releases use OCP 7.x; ocp_gordon 0.3 requires OCP 8.x.
"ocp_gordon<0.3",
# This novtk release lacks OCP.GccEnt on macOS. The exclusion must reach
# published wheels, not only uv's development resolver constraints.
"cadquery-ocp-novtk!=7.9.3.1.1 ; python_full_version >= '3.13'",
"build123d-drafting-helpers>=0.15.5",
"quiddity==0.3.10",
"numpy>=1.24",
# PNG raster export (SVG→PDF→PNG). Both permissively licensed (Pillow HPND; pypdfium2
# Apache-2.0 wrapping Google PDFium BSD-3) and ship pre-built wheels with NO native system
# deps — so PNG works cross-platform without cairo (ADR 0006) and stays dual-license-clean.
"pillow>=10",
"pypdfium2>=4",
"reportlab>=4.0",
# Structured ISO 10303-21 access for AP242 facts that OCCT's XCAF transfer drops (#62).
# STEPutils 0.1 is the only release; isolate it behind _pmi_part21 and pin its README's
# ANTLR compatibility constraint explicitly because the package metadata omits the cap.
"steputils==0.1",
"antlr4-python3-runtime<4.10",
"svglib>=1.5",
"typer>=0.12",
"rich>=10.11",
# PEP 702 @deprecated: stdlib `warnings.deprecated` lands in 3.13; backport for 3.10–3.12.
"typing_extensions>=4.5 ; python_full_version < '3.13'",
]
keywords = ["build123d", "cad", "drafting", "engineering-drawing", "technical-drawing", "automation"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Manufacturing",
"Topic :: Scientific/Engineering",
"License :: OSI Approved :: GNU Affero General Public License v3",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
[project.scripts]
draftwright = "draftwright.cli:app"
[project.urls]
Homepage = "https://github.com/pzfreo/draftwright"
Repository = "https://github.com/pzfreo/draftwright"
Issues = "https://github.com/pzfreo/draftwright/issues"
Changelog = "https://github.com/pzfreo/draftwright/blob/main/CHANGELOG.md"
Documentation = "https://pzfreo.github.io/draftwright/"
[tool.hatch.build.targets.wheel]
packages = ["src/draftwright"]
[tool.hatch.build.targets.sdist]
include = [
"src/draftwright",
"tests",
"skills",
"docs/reference/recogniser-capabilities.md",
"docs/reference/sheet.md",
"docs/research/1062-repeating-radial-profile-evidence.md",
"README.md",
"LICENSE",
"CHANGELOG.md",
"pyproject.toml",
]
[tool.pytest.ini_options]
testpaths = ["tests"]
timeout = 300
# `slow` covers end-to-end integration builds, including the large NIST CTC fixtures
# (minutes each), deselected by default. `smoke` is a curated, build-light subset
# for a quick local "did I break something obvious" check — run it with
# `uv run pytest -m smoke`. The default run is the full supported-behavior tier
# (`-m 'not slow and not scheduled'`; runtime depends on worker count). Ordinary PR
# CI selects fast modules by changed source, with a bounded real-part canary; the
# scheduled tier runs after merge, and the full-matrix label widens the PR sweep.
markers = [
"slow: end-to-end integration builds, including CTC fixtures (deselected by default)",
"ctc04: scheduled tests that construct the CPU-heavy NIST CTC-04 drawing",
"scheduled: compatibility and broad-corpus contracts selected by the scheduled tier",
"real_part_canary: bounded real STEP semantic/export gate, selected once in PR CI",
"smoke: curated build-light subset for a quick local check",
"unit: pure-logic inner-loop tier — constructs NO OCC geometry (enforced by conftest, #656)",
]
# `SoftDeprecationWarning` marks a surface that is discouraged but SUPPORTED and not going
# away (#1043). The suite exercises `Sheet.auto_dimensions()` in ~170 places, deliberately —
# it is still a supported path and its behaviour must keep being tested. Migrating those to
# authored dimensions would be churn that tests less, so the category is silenced here rather
# than at ~170 call sites.
#
# This does NOT weaken the guard: `tests/test_soft_deprecation.py` asserts the warning with
# `pytest.warns`, which fires regardless of this filter. Real `DeprecationWarning`s are
# untouched and still carry removal dates (`tests/test_deprecation_dates.py`).
filterwarnings = [
"ignore::draftwright.SoftDeprecationWarning",
]
# Coverage is a CI concern (it adds ~13% locally and instruments every line); the
# CI workflow passes the --cov flags explicitly. Keep the local default lean.
addopts = "--tb=short -m 'not slow and not scheduled'"
[tool.coverage.run]
source = ["src/draftwright"]
omit = ["src/draftwright/__init__.py"]
# Keep XML paths anchored at the repository root so local diff coverage and Codecov
# measure the same changed source lines rather than relying on runner-specific paths.
relative_files = true
# Branch coverage makes the regression gate sensitive to untested decision paths,
# which matter more than raw statement execution in the recognition/layout code.
branch = true
[tool.coverage.report]
# Baseline measured on the full fast tier on Linux/Python 3.13 (#825):
# 92.05% combined line+branch coverage (93.90% statements, 86.89% branches).
# Keep two points of headroom; ratchet upward only after the canonical coverage job
# has stayed above the proposed floor.
fail_under = 90
precision = 1
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
# `@overload` stubs are typing declarations: Python discards the bodies, so they can
# never execute and counting them as missed coverage measures nothing (#963).
"@overload",
]
[tool.mypy]
python_version = "3.10"
ignore_missing_imports = true
check_untyped_defs = true
warn_unused_ignores = true
# Tightened on the settled module contracts (#138 / ADR 0005 P7). disallow_untyped_defs
# stays off (geometry helpers lean on untyped build123d returns); these flags catch
# real gaps without demanding annotations everywhere.
no_implicit_optional = true
warn_redundant_casts = true
strict_equality = true
warn_return_any = true
extra_checks = true
[tool.ruff]
line-length = 99
target-version = "py310"
[tool.ruff.lint]
select = ["E", "F", "I", "UP"]
extend-select = ["B"]
ignore = ["E501"]
[tool.ruff.lint.flake8-bugbear]
extend-immutable-calls = ["typer.Option"]
[dependency-groups]
docs = [
"mkdocs>=1.6,<2",
"mkdocstrings[python]>=0.30,<1",
]
dev = [
"codespell>=2.3.0",
"hypothesis>=6",
"jsonschema>=4,<5",
"mypy>=2.1.0",
"pytest>=8",
# `coverage` is invoked directly by the CI `coverage-report` job (combine/xml/html/
# report); it arrives transitively via pytest-cov, but the job depends on the console
# script, so declare it.
"coverage>=7",
"pytest-cov>=5",
"pytest-split>=0.8",
"pytest-timeout>=2",
"pytest-xdist>=3",
# Offline layout-cost workers need peak working-set and host RAM on Windows.
"psutil>=5.9",
"ruff>=0.4",
"tomli>=2; python_version < '3.11'",
]
[tool.codespell]
# Spelling enforcement for the ADR 0013 contract (epic #584 WP3). Skips binary /
# generated / vendored assets: STEP fixtures, the lockfile, fonts, git internals.
skip = "*.stp,*.step,*.svg,*.dxf,*.pdf,uv.lock,.git,*.ttf,*.otf,src/draftwright/fonts/*"
# Valid words/identifiers codespell's dictionary misflags (calibrated from a clean run):
# `nd` a Dijkstra distance var, `tread` a real word (stair-tread faces), `accreting`
# a real word, `testof` the `TestOf` class name, `leaded` a material designation,
# and the valid hyphenated re-* forms.
ignore-words-list = "nd,tread,accreting,testof,leaded,re-using,re-declare,re-declared,re-declaring"