forked from scikit-build/scikit-build-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
321 lines (291 loc) · 11.4 KB
/
pyproject.toml
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
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "scikit_build_core"
authors = [
{ name = "Henry Schreiner", email = "henryfs@princeton.edu" },
]
description = "Build backend for CMake based projects"
readme = "README.md"
requires-python = ">=3.7"
classifiers = [
"Topic :: Scientific/Engineering",
"Topic :: Software Development :: Build Tools",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Development Status :: 4 - Beta",
"Typing :: Typed",
]
dynamic = ["version"]
dependencies = [
"exceptiongroup >=1.0; python_version<'3.11'",
"importlib-metadata >=4.13; python_version<'3.8'",
"importlib-resources >=1.3; python_version<'3.9'",
"packaging >=21.3",
"pathspec >=0.10.1",
"tomli >=1.2.2; python_version<'3.11'",
"typing-extensions >=3.10.0; python_version<'3.9'",
]
# Note: for building wheels and sdists, there are also additional dependencies
# in the pyproject extra. And cmake and possibly ninja if those are not already
# present (user controllable)
[project.optional-dependencies]
pyproject = [
]
test = [
"build >=0.8",
"cattrs >=22.2.0",
"pip>=23; python_version<'3.13'",
"pip>=24.1; python_version>='3.13'",
"pybind11 >=2.11",
"pytest >=7.0", # 7.2+ recommended for better tracebacks with ExceptionGroup
"pytest-subprocess >=1.5",
'setuptools >=43; python_version<"3.9"',
'setuptools >=45; python_version=="3.9"',
'setuptools >=49; python_version>="3.10" and python_version<"3.12"',
'setuptools >=66.1; python_version>="3.12"',
"virtualenv >=20.20",
"wheel >=0.40",
]
test-hatchling = [
"hatchling >=1.24.0",
]
test-meta = [
"hatch-fancy-pypi-readme>=22.3",
"setuptools-scm",
]
test-numpy = [
"numpy; python_version<'3.13' and platform_python_implementation!='PyPy'",
"numpy~=1.21.0; python_version=='3.7' and platform_python_implementation=='PyPy' and sys_platform == 'linux'",
"numpy~=1.24.0; python_version=='3.8' and platform_python_implementation=='PyPy'",
"numpy~=2.0.0; python_version=='3.9' and platform_python_implementation=='PyPy'",
]
test-schema = [
"fastjsonschema",
"validate-pyproject",
]
cov = [
"pytest-cov[toml]",
]
wheels = [
"cmake",
"ninja; sys_platform!='win32'",
]
dev = [
"rich",
]
docs = [
"furo",
"hatchling",
"myst-parser >=0.13",
"setuptools",
"sphinx >=7.0",
"sphinx-autodoc-typehints",
"sphinx-copybutton",
"sphinx-inline-tabs",
"sphinx-jsonschema",
]
wheel-free-setuptools = [
'setuptools>=70.1; python_version>="3.8"',
]
[project.urls]
Changelog = "https://scikit-build-core.readthedocs.io/en/latest/changelog.html"
Discussions = "https://github.com/orgs/scikit-build/discussions"
Documentation = "https://scikit-build-core.readthedocs.io"
Homepage = "https://github.com/scikit-build/scikit-build-core"
Issues = "https://github.com/scikit-build/scikit-build-core/issues"
[project.entry-points]
"distutils.commands".build_cmake = "scikit_build_core.setuptools.build_cmake:BuildCMake"
"distutils.setup_keywords".cmake_source_dir = "scikit_build_core.setuptools.build_cmake:cmake_source_dir"
"distutils.setup_keywords".cmake_args = "scikit_build_core.setuptools.build_cmake:cmake_args"
"setuptools.finalize_distribution_options".scikit_build_entry = "scikit_build_core.setuptools.build_cmake:finalize_distribution_options"
"validate_pyproject.tool_schema".scikit-build = "scikit_build_core.settings.skbuild_schema:get_skbuild_schema"
hatch.scikit-build = "scikit_build_core.hatch.hooks"
[tool.hatch]
version.source = "vcs"
build.hooks.vcs.version-file = "src/scikit_build_core/_version.py"
[tool.pytest.ini_options]
minversion = "7.0"
addopts = ["-rfEsX", "--strict-markers", "--strict-config"]
xfail_strict = true
filterwarnings = [
"error",
"ignore:Config variable '.*' is unset, Python ABI tag may be incorrect:RuntimeWarning",
"default:pkg_resources is deprecated as an API:DeprecationWarning:wheel", # Caused by wheel<0.41 in tests
"default:onerror argument is deprecated, use onexc instead:DeprecationWarning:wheel", # Caused by wheel<0.41 & Python 3.12
"default:The distutils package is deprecated and slated for removal:DeprecationWarning", # Caused by setuptools sometimes
"default:The distutils.sysconfig module is deprecated, use sysconfig instead:DeprecationWarning", # Caused by setuptools sometimes
"default:check_home argument is deprecated and ignored.:DeprecationWarning", # Caused by setuptools sometimes
]
log_cli_level = "info"
pythonpath = ["tests/utils"]
testpaths = ["tests"]
markers = [
"broken_on_urct: Broken for now due to lib not found",
"compile: Compiles code",
"configure: Configures CMake code",
"fortran: Fortran code",
"integration: Full package build",
"isolated: Needs an isolated virtualenv",
"network: Needs a network connection to setup or run",
"setuptools: Tests setuptools integration",
"virtualenv: Needs a virtualenv",
]
norecursedirs = ["tests/packages/**"]
[tool.mypy]
files = ["src", "tests", "noxfile.py"]
mypy_path = ["$MYPY_CONFIG_FILE_DIR/src", "$MYPY_CONFIG_FILE_DIR/tests/utils"]
python_version = "3.8"
warn_unused_configs = true
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
strict = true
disallow_untyped_defs = false
disallow_incomplete_defs = false
[[tool.mypy.overrides]]
module = ["scikit_build_core.*"]
disallow_untyped_defs = true
disallow_incomplete_defs = true
[[tool.mypy.overrides]]
module = ["numpy", "pathspec", "setuptools_scm", "hatch_fancy_pypi_readme", "virtualenv"]
ignore_missing_imports = true
[tool.pylint]
py-version = "3.7"
jobs = "0"
reports.output-format = "colorized"
good-names = ["f"]
messages_control.disable = [
"design",
"fixme",
"import-outside-toplevel",
"invalid-name",
"line-too-long",
"missing-class-docstring",
"missing-function-docstring",
"missing-function-docstring",
"missing-module-docstring",
"wrong-import-position",
"unnecessary-ellipsis", # Conflicts with Protocols
"broad-except",
"unused-argument", # Handled by Ruff
"redefined-builtin", # ExceptionGroup is a builtin
]
[tool.coverage]
run.source = ["scikit_build_core"]
run.omit = ["src/scikit_build_core/_vendor"]
report.exclude_lines = [
'pragma: no cover',
'\.\.\.',
'if typing.TYPE_CHECKING:',
'if TYPE_CHECKING:',
'def __repr__',
'if __name__ == "main":',
]
[tool.check-wheel-contents]
ignore = ["W002"] # Triggers on __init__.py's
[tool.ruff]
exclude = ["src/scikit_build_core/_vendor"] # Required due to "build" module
[tool.ruff.lint]
extend-select = [
"ANN", # flake8-annotations
"ARG", # flake8-unused-arguments
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"EM", # flake8-errmsg
"FBT", # flake8-boolean-trap
"FLY", # flynt
"I", # isort
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"N", # flake8-naming
"PERF", # perflint
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"PYI", # flake8-pyi
"RET", # flake8-return
"RUF", # Ruff-specific
"S", # eval -> literal_eval
"SIM", # flake8-simplify
"T20", # flake8-print
"TCH", # flake8-type-checking
"TID251", # flake8-tidy-imports.banned-api
"TRY", # tryceratops
"UP", # pyupgrade
"YTT", # flake8-2020
# (in preview till 0.2.0) "FURB", # refurb
]
ignore = [
"PLE1205", # Format check doesn't work with our custom logger
"PT004", # Incorrect, just usefixtures instead.
"PT013", # It's correct to import classes for typing!
"RUF009", # Too easy to get a false positive
"PYI025", # Wants Set to be renamed AbstractSet
"ISC001", # Conflicts with formatter
"PLR09", # Too many ...
"PLR2004", # Magic value used in comparison
"PLC0415", # Import should be at top of file
"ANN101", # Missing type annotation for `self` in method
"ANN102", # Missing type annotation for `cls` in classmethod
"ANN401", # Disallow dynamically typed expressions
"S101", # Use of assert detected
"S603", # subprocess untrusted input
"S607", # subprocess call
"S404", # subprocess module is possibly insecure
]
typing-modules = ["scikit_build_core._compat.typing"]
[tool.ruff.lint.isort]
known-local-folder = ["pathutils"]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"typing.Callable".msg = "Use collections.abc.Callable instead."
"typing.Iterator".msg = "Use collections.abc.Iterator instead."
"typing.Mapping".msg = "Use collections.abc.Mapping instead."
"typing.Sequence".msg = "Use collections.abc.Sequence instead."
"typing.Set".msg = "Use collections.abc.Set instead."
"typing.Literal".msg = "Use scikit_build_core._compat.typing.Literal instead."
"typing.Protocol".msg = "Use scikit_build_core._compat.typing.Protocol instead."
"typing.Self".msg = "Use scikit_build_core._compat.typing.Self instead."
"typing_extensions.Self".msg = "Use scikit_build_core._compat.typing.Self instead."
"typing.runtime_checkable".msg = "Add and use scikit_build_core._compat.typing.runtime_checkable instead."
"typing.Final".msg = "Add scikit_build_core._compat.typing.Final instead."
"typing.NotRequired".msg = "Add scikit_build_core._compat.typing.NotRequired instead."
"typing.OrderedDict".msg = "Add scikit_build_core._compat.typing.OrderedDict instead."
"typing.TypedDict".msg = "Add scikit_build_core._compat.typing.TypedDict instead."
"typing.assert_never".msg = "Add scikit_build_core._compat.typing.assert_never instead."
"tomli".msg = "Use scikit_build_core._compat.tomllib instead."
"tomllib".msg = "Use scikit_build_core._compat.tomllib instead."
"importlib.metadata".msg = "Use scikit_build_core._compat.importlib.metadata instead."
"importlib_metadata".msg = "Use scikit_build_core._compat.importlib.metadata instead."
"importlib.resources".msg = "Use scikit_build_core._compat.importlib.resources instead."
"importlib_resources".msg = "Use scikit_build_core._compat.importlib.resources instead."
"pyproject_metadata".msg = "Use scikit_build_core._vendor.pyproject_metadata instead."
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["T20", "ANN", "FBT001"]
"noxfile.py" = ["T20", "TID251"]
"src/scikit_build_core/resources/*.py" = ["PTH", "ARG002", "FBT", "TID251"]
"src/scikit_build_core/_compat/**.py" = ["TID251"]
"tests/conftest.py" = ["TID251"]
"tests/packages/**.py" = ["TID251"]
"docs/conf.py" = ["TID251"]
"docs/examples/**" = ["ANN"]
"src/scikit_build_core/file_api/model/*.py" = ["N"]
[tool.check-sdist]
sdist-only = ["src/scikit_build_core/_version.py"]
[tool.repo-review]
ignore = [
"MY103", # We don't set mypy's warn-unreachable due to issues with platform-specific checks
]