Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
170 lines (152 loc) · 6.13 KB
/
Copy pathpyproject.toml
File metadata and controls
170 lines (152 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
[build-system]
requires = ["scikit-build-core"]
build-backend = "scikit_build_core.build"
[project]
name = "plastimatch"
authors = [
{ name = "Andrey Fedorov", email = "fedorov@bwh.harvard.edu" },
]
description = "Python distribution of the plastimatch medical image processing tools."
readme = "README.md"
license.file = "LICENSE"
requires-python = ">=3.10"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
# MIT, matching LICENSE: this classifier describes the packaging code in this repository.
# The bundled plastimatch, ITK, DCMTK, dlib and zlib-ng binaries carry their own licenses,
# installed into plastimatch/share/licenses/ inside every wheel. Same arrangement as the
# sibling dcmqi and s5cmd distributions, which are MIT and bundle their own upstreams.
"License :: OSI Approved :: MIT License",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Medical Science Apps.",
"Typing :: Typed",
]
dynamic = ["version"]
dependencies = []
[project.optional-dependencies]
test = [
"pytest >=6",
"pytest-cov >=3",
]
dev = [
"pytest >=6",
"pytest-cov >=3",
]
docs = [
"sphinx>=7.0",
"myst_parser>=0.13",
"sphinx_copybutton",
"sphinx_autodoc_typehints",
"furo>=2023.08.17",
]
[project.urls]
Homepage = "https://github.com/ImagingDataCommons/plastimatch-python-distributions"
"Bug Tracker" = "https://github.com/ImagingDataCommons/plastimatch-python-distributions/issues"
Changelog = "https://github.com/ImagingDataCommons/plastimatch-python-distributions/releases"
Upstream = "https://gitlab.com/plastimatch/plastimatch"
[project.scripts]
plastimatch = "plastimatch:plastimatch"
dicom_uid = "plastimatch:dicom_uid"
[tool.scikit-build]
minimum-version = "0.4"
build-dir = "build/{wheel_tag}"
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
sdist.include = ["src/plastimatch/_version.py"]
# The wheels contain prebuilt executables and no compiled Python extension, so one wheel
# per platform serves every supported interpreter.
wheel.py-api = "py3"
[tool.setuptools_scm]
write_to = "src/plastimatch/_version.py"
# Releases are named after the upstream plastimatch version they package, with packaging-only
# revisions as PEP 440 post-releases (1.10.0, then 1.10.0.post1). The default version_scheme,
# guess-next-dev, does not fit that: it reports an untagged commit after 1.10.0 as
# "1.10.1.dev2", inventing a next *upstream* release this project does not control and may
# never package. post-release reports "1.10.0.post2" instead, which is what the next release
# from here would actually be called. See the Versioning section of the README.
version_scheme = "post-release"
# This repository has two independent tag namespaces and only one of them is a wheel version:
#
# v1.10.0 a release of *this package* -> wheel version 1.10.0
# binaries-1.10.0-1 a set of prebuilt plastimatch archives, referenced by
# plastimatchUrls.cmake and never published to PyPI
#
# Left at the defaults, setuptools_scm matches any tag containing a digit and its default
# tag_regex has an optional "[\w-]+-" prefix group, so it reads "binaries-1.10.0-1" as version
# 1.10.0 and a later commit then builds as "1.10.0.post1.post1". Restricting both the describe
# match and the regex to v-prefixed tags keeps the binaries releases invisible here.
tag_regex = "^v(?P<version>\\d+(?:\\.\\d+){0,2}[^\\+]*)(?:\\+.*)?$"
git_describe_command = ["git", "describe", "--dirty", "--tags", "--long", "--match", "v*"]
[tool.cibuildwheel]
build = "cp312-*"
test-command = "pytest {project}/tests"
test-extras = ["test"]
[tool.cibuildwheel.linux]
# auditwheel cannot do anything useful here: it repairs compiled extension modules, and
# this wheel has none -- just a statically linked executable in plastimatch/bin. Left to
# its default the wheel would inherit the build container's manylinux tag regardless of
# what glibc the bundled binary actually needs, which silently produces a wheel that pip
# happily installs and that then fails with a GLIBC version error at run time. Derive the
# tag from the binary instead.
repair-wheel-command = "bash {project}/scripts/retag_linux_wheel.sh {wheel} {dest_dir}"
[tool.cibuildwheel.macos]
# Same reasoning as the Linux repair step: delocate has no extension module to fix up, and
# the wheel tag would otherwise reflect the build environment rather than the minimum macOS
# version the bundled binary actually supports.
repair-wheel-command = "bash {project}/scripts/retag_macos_wheel.sh {wheel} {dest_dir}"
[tool.pytest.ini_options]
minversion = "6.0"
addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]
xfail_strict = true
filterwarnings = [
"error",
]
log_cli_level = "INFO"
testpaths = [
"tests",
]
[tool.ruff]
src = ["src"]
[tool.ruff.lint]
extend-select = [
"B", # flake8-bugbear
"I", # isort
"ARG", # flake8-unused-arguments
"C4", # flake8-comprehensions
"EM", # flake8-errmsg
"ICN", # flake8-import-conventions
"G", # flake8-logging-format
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"RET", # flake8-return
"RUF", # Ruff-specific
"SIM", # flake8-simplify
"T20", # flake8-print
"UP", # pyupgrade
"YTT", # flake8-2020
"EXE", # flake8-executable
]
ignore = [
"PLR09", # Too many <...>
"PLR2004", # Magic value used in comparison
"ISC001", # Conflicts with formatter
]
isort.required-imports = ["from __future__ import annotations"]
[tool.ruff.lint.per-file-ignores]
# These are command line utilities; printing is their interface.
"tests/**" = ["T20"]
"scripts/**" = ["T20"]
".github/scripts/**" = ["T20"]