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
|
[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.8"
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.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Development Status :: 4 - Beta",
"Typing :: Typed",
]
dynamic = ["version"]
dependencies = [
"exceptiongroup >=1.0; python_version<'3.11'",
"importlib-resources >=1.3; python_version<'3.9'",
"packaging >=23.2",
"pathspec >=0.10.1",
"tomli >=1.2.2; python_version<'3.11'",
"typing-extensions >=3.10.0; python_version<'3.9'",
]
# Note: cmake and possibly ninja are also required if those are not already
# present (user controllable) - but a system version is fine.
[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.2",
"pytest-subprocess >=1.5",
'pytest-xdist >=3.1',
'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.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",
]
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",
"sphinx-tippy",
]
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"
"distutils.setup_keywords".cmake_install_target = "scikit_build_core.setuptools.build_cmake:cmake_install_target"
"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.uv]
dev-dependencies = ["scikit-build-core[test,test-hatchling,test-meta,test-numpy,test-schema,cov,dev]"]
pip.reinstall-package = ["scikit-build-core"]
workspace.members = ["tmp/hello/hello"]
[tool.pytest.ini_options]
minversion = "7.2"
addopts = ["-ra", "--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:The 'wheel' package is no longer the canonical location:DeprecationWarning", # Caused by wheel also
"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
"ignore::scikit_build_core._vendor.pyproject_metadata.errors.ConfigurationWarning",
"ignore:'_UnionGenericAlias' is deprecated and slated for removal in Python 3.17:DeprecationWarning", # From cattrs 24.1.2 and other?
"ignore:The --no-wheel option is deprecated. It has no effect, wheel is no longer bundled in virtualenv. This option will be removed in pip 26.",
]
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
warn_unreachable = false
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.8"
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
"using-exception-groups-in-unsupported-version", # We are using a backport
]
[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/*"]
[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
"TC", # flake8-type-checking
"TID251", # flake8-tidy-imports.banned-api
"TRY", # tryceratops
"UP", # pyupgrade
"YTT", # flake8-2020
"FURB", # refurb
]
ignore = [
"PLE1205", # Format check doesn't work with our custom logger
"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
"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.format]
docstring-code-format = true
[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.Self".msg = "Use scikit_build_core._compat.typing.Self instead."
"typing_extensions.Self".msg = "Use scikit_build_core._compat.typing.Self 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 importlib.metadata directly instead."
"importlib.metadata.entry_points".msg = "Use scikit_build_core._compat.importlib.metadata.entry_points 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"]
|