forked from Zomojo/compiletools
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
210 lines (193 loc) · 7.66 KB
/
Copy pathpyproject.toml
File metadata and controls
210 lines (193 loc) · 7.66 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
[project]
name = "compiletools"
version = "10.3.0"
description = "Tools to make compiling C/C++ projects easy"
readme = "src/compiletools/README.ct-doc.rst"
requires-python = ">=3.10"
license = "GPL-3.0-or-later"
keywords = ["c++", "make", "development"]
authors = [
{name = "DrGeoff", email = "drgeoffathome@gmail.com"},
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: Software Development :: Build Tools",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"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",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"configargparse>=1.5.3",
"appdirs>=1.4.4",
"rich>=12.0.0",
"rich_rst>=1.1.7",
"stringzilla>=3.0.0",
]
[project.optional-dependencies]
tui = [
"textual>=0.40.0",
]
dev = [
"bump-my-version>=0.26.0",
"pytest>=8.0",
"pytest-xdist>=3.5",
"pytest-forked>=1.6",
"ruff>=0.14.0",
"pyright>=1.1",
# ``prek`` is the Rust drop-in replacement for ``pre-commit``: same
# ``.pre-commit-config.yaml``, ~10× faster hook startup, single static
# binary distributed on PyPI. We standardise on prek here; a dev who
# specifically wants the reference ``pre-commit`` implementation can
# still install it ad-hoc (``uv tool install pre-commit``) since the
# config file is portable.
"prek>=0.3.13",
"pytest-cov>=6.0",
"textual>=0.40.0",
"tomli; python_version < '3.11'",
# Pull in the OTel SDK so the otel_exporter tests run (and pyright
# resolves their imports) in the standard dev/CI environment rather than
# skipping. The feature itself stays an opt-in extra for end users.
"compiletools[otel]",
]
release = [
"twine>=5.0.0",
]
docs = [
"sphinx>=7",
"furo",
"sphinx-copybutton",
"tomli; python_version < '3.11'",
]
otel = [
"opentelemetry-api>=1.27",
"opentelemetry-sdk>=1.27",
"opentelemetry-exporter-otlp-proto-grpc>=1.27",
"opentelemetry-exporter-otlp-proto-http>=1.27",
]
[project.urls]
Homepage = "http://drgeoff.github.io/compiletools/"
Download = "https://github.com/DrGeoff/compiletools/archive/v{version}.tar.gz"
[project.scripts]
# Python-based scripts (entry points to Python modules)
ct-cache-report = "compiletools.cache_report:main"
ct-cake = "compiletools.cake:main"
ct-cas-publish = "compiletools.cas_publish:main"
ct-check-venv = "compiletools.check_venv:main"
ct-config = "compiletools.config:main"
ct-cppdeps = "compiletools.cppdeps:main"
ct-create-makefile = "compiletools.makefile_backend:main"
ct-debug-pcm-hash-inputs = "compiletools.debug_pcm_hash_inputs:main"
ct-doc = "compiletools.doc:main"
ct-fetch = "compiletools.fetch:main"
ct-filelist = "compiletools.filelist:main"
ct-findtargets = "compiletools.findtargets:main"
ct-git-sha-report = "compiletools.git_sha_report:main"
ct-gitroot = "compiletools.git_utils:main"
ct-headertree = "compiletools.headertree:main"
ct-jobs = "compiletools.jobs:main"
ct-list-backends = "compiletools.listbackends:main"
ct-list-variants = "compiletools.listvariants:main"
ct-magicflags = "compiletools.magicflags:main"
ct-compilation-database = "compiletools.compilation_database:main"
ct-cleanup-locks = "compiletools.cleanup_locks_main:main"
ct-lock-helper = "compiletools.ct_lock_helper:main"
ct-timing-report = "compiletools.timing_report:main"
ct-trim-cache = "compiletools.trim_cache_main:main"
[tool.pytest.ini_options]
testpaths = ["src/compiletools"]
python_files = ["test_*.py"]
# --dist loadgroup: tests sharing an @pytest.mark.xdist_group run on one worker
# (serialised). Used to pin the heavy real-subprocess e2e cells (slurm/bazel) so
# they don't oversubscribe the box under -n auto and flake. Ungrouped tests are
# unaffected (each distributes normally); harmless without -n (serial run).
addopts = "-v --dist loadgroup"
[tool.coverage.run]
source = ["compiletools"]
omit = ["*/test_*.py", "*/testhelper.py", "*/conftest.py"]
[tool.coverage.report]
show_missing = true
[build-system]
requires = ["uv_build>=0.8.4,<0.9.0"]
build-backend = "uv_build"
[tool.uv.build-backend]
data = { scripts = "scripts" }
[tool.uv_build]
include = [
"benchmark_lock_implementations.sh",
]
[tool.bumpversion]
current_version = "10.3.0"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = ["{major}.{minor}.{patch}"]
search = "{current_version}"
replace = "{new_version}"
commit = true
tag = true
message = "Bump version: {current_version} → {new_version}"
[[tool.bumpversion.files]]
filename = "src/compiletools/version.py"
[[tool.bumpversion.files]]
filename = "pyproject.toml"
# Match every man-page README so newly-added docs are picked up automatically.
# Every matched file MUST contain a ``:Version: {current_version}`` line; a
# missing one is a release-blocker so stale or unstamped docs cannot ship.
[[tool.bumpversion.files]]
glob = "src/compiletools/README.*.rst"
[tool.ruff]
target-version = "py310"
line-length = 120
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"UP", # pyupgrade (modernize syntax for target Python version)
"B", # flake8-bugbear (common bug patterns)
"SIM", # flake8-simplify
"RUF", # ruff-specific rules
]
ignore = [
"UP007", # Union[X, Y] -> X | Y -- deferred to avoid a churn commit
"UP045", # Optional[X] -> X | None -- deferred with UP007 (single modernization pass)
"B905", # zip(strict=) -- deferred; adding strict= is a semantic decision per call-site
"B019", # cached-instance-method -- deliberate design choice in this codebase
"SIM102", # collapsible-if -- nested ifs are often clearer
"SIM103", # needless-bool -- explicit if/return can be clearer with comments
"SIM105", # contextlib.suppress -- often less readable than try/except/pass
"SIM108", # ternary operator -- can reduce readability for complex expressions
"SIM113", # enumerate-for-loop -- manual counter can be clearer in complex loops
"SIM117", # multiple-with-statements -- explicit nesting is clearer
"RUF005", # collection-literal-concatenation -- stylistic, existing code is clear
]
[tool.ruff.lint.per-file-ignores]
"src/compiletools/test_*.py" = [
"E501", # line too long (tests often have long descriptive names)
"B011", # assert False -- used deliberately in tests
"F823", # false positive: module-level `import compiletools.X` makes `compiletools` available
"SIM103", # returning condition directly can obscure test intent
]
# `×` (U+00D7) is the intentional rendering of the parallelism factor in build-timer
# output (e.g. "15.1× cores busy") and the TUI category labels. The symbol is paired
# across production output and the tests asserting it.
"src/compiletools/build_timer.py" = ["RUF001", "RUF002"]
"src/compiletools/timing_tui.py" = ["RUF001"]
"src/compiletools/test_build_timer.py" = ["RUF001"]
"src/compiletools/test_timing_tui.py" = ["RUF001", "RUF002"]
[tool.pyright]
# Pre-commit runs pyright in its own isolated env via pyright-python, which
# would shadow the project deps installed into the worktree venv. Point at the
# worktree's mandatory ``.venv/`` (see CLAUDE.md "Worktree-Based Development")
# so the pre-commit run sees the same imports a developer ``pyright`` invocation
# from inside the activated venv would.
venvPath = "."
venv = ".venv"
include = ["src/compiletools"]
pythonVersion = "3.10"