1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 distlib,
6 pythonOlder,
7 exceptiongroup,
8 hatch-vcs,
9 hatchling,
10 cattrs,
11 cmake,
12 ninja,
13 packaging,
14 pathspec,
15 pyproject-metadata,
16 pytest-subprocess,
17 pytestCheckHook,
18 setuptools,
19 tomli,
20 virtualenv,
21 wheel,
22}:
23
24buildPythonPackage rec {
25 pname = "scikit-build-core";
26 version = "0.9.6";
27 pyproject = true;
28
29 src = fetchPypi {
30 pname = "scikit_build_core";
31 inherit version;
32 hash = "sha256-e+r5M89zSsvrttlsApNlQQIkcJvN5o87C08MsD4FSTk=";
33 };
34
35 postPatch = lib.optionalString (pythonOlder "3.11") ''
36 substituteInPlace pyproject.toml \
37 --replace '"error",' '"error", "ignore::UserWarning",'
38 '';
39
40 nativeBuildInputs = [
41 hatch-vcs
42 hatchling
43 ];
44
45 propagatedBuildInputs =
46 [ packaging ]
47 ++ lib.optionals (pythonOlder "3.11") [
48 exceptiongroup
49 tomli
50 ];
51
52 passthru.optional-dependencies = {
53 pyproject = [
54 distlib
55 pathspec
56 pyproject-metadata
57 ];
58 };
59
60 dontUseCmakeConfigure = true;
61
62 nativeCheckInputs = [
63 cattrs
64 cmake
65 ninja
66 pytest-subprocess
67 pytestCheckHook
68 setuptools
69 virtualenv
70 wheel
71 ] ++ passthru.optional-dependencies.pyproject;
72
73 disabledTestPaths = [
74 # runs pip, requires network access
75 "tests/test_custom_modules.py"
76 "tests/test_hatchling.py"
77 "tests/test_pyproject_pep517.py"
78 "tests/test_pyproject_pep518.py"
79 "tests/test_pyproject_pep660.py"
80 "tests/test_setuptools_pep517.py"
81 "tests/test_setuptools_pep518.py"
82 # store permissions issue in Nix:
83 "tests/test_editable.py"
84 ];
85
86 pythonImportsCheck = [ "scikit_build_core" ];
87
88 meta = with lib; {
89 description = "Next generation Python CMake adaptor and Python API for plugins";
90 homepage = "https://github.com/scikit-build/scikit-build-core";
91 changelog = "https://github.com/scikit-build/scikit-build-core/releases/tag/v${version}";
92 license = with licenses; [ asl20 ];
93 maintainers = with maintainers; [ veprbl ];
94 };
95}