-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpyproject.toml
More file actions
150 lines (134 loc) · 5.76 KB
/
Copy pathpyproject.toml
File metadata and controls
150 lines (134 loc) · 5.76 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
[project]
name = "warpkit"
description = "A python library for neuroimaging transformations"
readme = "README.md"
requires-python = ">=3.11"
authors = [{ name = "Andrew Van", email = "vanandrew77@gmail.com" }]
keywords = ["neuroimaging"]
classifiers = ["Programming Language :: Python :: 3"]
urls = { github = "https://github.com/vanandrew/warpkit", paper = "https://doi.org/10.1162/IMAG.a.1262" }
# include/romeo/LICENSE is the upstream MIT notice for the ROMEO C++ port; it
# travels with the headers in source distributions and (via PEP 639
# license-files) gets bundled into wheels under *.dist-info/licenses/.
license-files = ["LICENSE", "include/romeo/LICENSE"]
dynamic = ["version"]
dependencies = [
"nibabel >= 4.0.2",
"numpy >= 1.23.3",
"scikit-image >= 0.20.0",
"scipy >= 1.8.1",
"transforms3d >= 0.4.1",
"indexed-gzip >= 1.7.0",
]
[project.scripts]
"wk-medic" = "warpkit.scripts.medic:main"
"wk-unwrap-phase" = "warpkit.scripts.unwrap_phase:main"
"wk-compute-fieldmap" = "warpkit.scripts.compute_fieldmap:main"
"wk-apply-warp" = "warpkit.scripts.apply_warp:main"
"wk-convert-warp" = "warpkit.scripts.convert_warp:main"
"wk-convert-fieldmap" = "warpkit.scripts.convert_fieldmap:main"
"wk-compute-jacobian" = "warpkit.scripts.compute_jacobian:main"
[dependency-groups]
dev = [
"coverage[toml] >= 5.5",
"pre-commit >= 3.6.0",
"pybids >= 0.15.1",
"pybind11-stubgen>=2.5.5",
"pytest >= 7.2.2",
]
[build-system]
requires = ["scikit-build-core >= 0.10", "setuptools-scm >= 8.0"]
build-backend = "scikit_build_core.build"
[tool.scikit-build]
# Cap CMake at <4 — scikit-build-core picks up the cmake PyPI wheel, and
# 4.2.3 (latest at time of pin) abort()s with glibc heap corruption
# (`free(): invalid next size (fast)` / `corrupted size vs. prev_size`)
# on manylinux during configure teardown. The crash is reproducible on
# the cibuildwheel matrix across Python 3.11–3.14 and unrelated to our
# CMakeLists. CMake 3.31.x is the most recent 3.x release and works fine.
cmake.version = ">=3.24,<4"
ninja.version = ">=1.11"
# Persistent CMake build dir keyed on wheel tag — survives across `uv sync`
# invocations so ITK FetchContent + object files cache properly. Without this
# scikit-build-core defaults to a per-build temp dir, the same problem the old
# setuptools+cmake-build-extension setup had.
build-dir = "build/{wheel_tag}"
wheel.packages = ["warpkit"]
# Only install our extension component — skips ITK's install rules so we
# don't waste I/O copying static libs we never ship.
install.components = ["extension"]
# Editable installs use a redirect importer pointing at the persistent
# build-dir. rebuild = false because the per-import `cmake --build` path can't
# work here: uv provisions ninja and the build python in an ephemeral isolated
# env, CMake bakes those paths into CMakeCache.txt, then uv tears the env
# down — leaving the cache pointing at a dead ninja. Rebuilds go through
# `uv sync --reinstall-package warpkit`, which gets a fresh build env each
# time and hits the persistent build/{wheel_tag}/ cache for ITK + objects.
editable.mode = "redirect"
editable.rebuild = false
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
[tool.setuptools_scm]
fallback_version = "0.0.0"
# ── Ruff (linter + formatter) ────────────────────────────────────────
[tool.ruff]
target-version = "py311" # minimum supported Python version
line-length = 88 # matches Black's default
src = ["warpkit"] # treat warpkit/ as the source root for import sorting
extend-exclude = ["warpkit/build-tmp*"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort (import ordering)
"N", # pep8-naming
"UP", # pyupgrade (modernize syntax)
"B", # flake8-bugbear (common pitfalls)
"SIM", # flake8-simplify
"RUF", # Ruff-specific rules
]
ignore = [
"E501", # line too long (handled by the formatter, not the linter)
]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
docstring-code-format = true # format code blocks inside docstrings
[tool.pyright]
include = ["warpkit"]
exclude = ["**/__pycache__", "warpkit/build-tmp*", "tests/data", ".venv", "**/node_modules", "**/.*"]
venvPath = "."
venv = ".venv"
pythonVersion = "3.11"
# Stubs for the CMake extension live at warpkit/warpkit_cpp.pyi (regenerate with
# `uv run pybind11-stubgen warpkit.warpkit_cpp --output-dir .` after binding changes).
[tool.pytest.ini_options]
testpaths = ["tests"]
[tool.coverage.run]
command_line = "-m pytest"
[tool.coverage.report]
omit = ["tests/*"]
[tool.cibuildwheel]
# Skip musllinux (we ship manylinux only). Free-threaded (cp31Xt-*) builds
# are kept: warps.h guards PyErr_CheckSignals() behind WARPKIT_CHECK_SIGNALS,
# which is a no-op under Py_GIL_DISABLED.
skip = "*musllinux*"
build-frontend = "build"
build-verbosity = 3
[tool.cibuildwheel.linux]
archs = ["auto"]
[tool.cibuildwheel.macos]
archs = ["universal2"]
repair-wheel-command = "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}"
before-build = ["pip install delocate>=0.13.0"]
[tool.codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = './.git*,*/.git-meta/*,*.pdf,*.lock,*include/romeo/*,*include/itk/*,*/build/*,*/.venv/*'
check-hidden = true
# ignore-words-list rationale:
# te,tes - MR-physics abbreviations (echo time / echo times); see CLAUDE.md
# nd - DICOM ImageType flag in BIDS test fixtures
# datas - PyInstaller Analysis() parameter name (packaging/pyinstaller/)
# framei - loop variable "frame i" in tests/test_distortion.py
# thirdparty - refers to ITK's ThirdParty/Eigen3 module in CMakeLists.txt comment
ignore-words-list = 'te,tes,nd,datas,framei,thirdparty'