1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 pythonOlder, 6 7 # build-system 8 hatch-vcs, 9 hatchling, 10 cmake, 11 ninja, 12 13 # dependencies 14 packaging, 15 pathspec, 16 exceptiongroup, 17 18 # tests 19 build, 20 cattrs, 21 numpy, 22 pybind11, 23 pytest-subprocess, 24 pytestCheckHook, 25 setuptools, 26 tomli, 27 virtualenv, 28 wheel, 29}: 30 31buildPythonPackage rec { 32 pname = "scikit-build-core"; 33 version = "0.11.5"; 34 pyproject = true; 35 36 src = fetchFromGitHub { 37 owner = "scikit-build"; 38 repo = "scikit-build-core"; 39 tag = "v${version}"; 40 hash = "sha256-4DwODJw1U/0+K/d7znYtDO2va71lzp1gDm4Bg9OBjQY="; 41 }; 42 43 postPatch = lib.optionalString (pythonOlder "3.11") '' 44 substituteInPlace pyproject.toml \ 45 --replace-fail '"error",' '"error", "ignore::UserWarning",' 46 ''; 47 48 build-system = [ 49 hatch-vcs 50 hatchling 51 ]; 52 53 dependencies = [ 54 packaging 55 pathspec 56 ] 57 ++ lib.optionals (pythonOlder "3.11") [ 58 exceptiongroup 59 tomli 60 ]; 61 62 nativeCheckInputs = [ 63 build 64 cattrs 65 cmake 66 ninja 67 numpy 68 pybind11 69 pytest-subprocess 70 pytestCheckHook 71 setuptools 72 virtualenv 73 wheel 74 ]; 75 76 # cmake is only used for tests 77 dontUseCmakeConfigure = true; 78 setupHooks = [ 79 ./append-cmakeFlags.sh 80 ]; 81 82 disabledTestMarks = [ 83 "isolated" 84 "network" 85 ]; 86 87 disabledTestPaths = [ 88 # store permissions issue in Nix: 89 "tests/test_editable.py" 90 ]; 91 92 pythonImportsCheck = [ "scikit_build_core" ]; 93 94 meta = with lib; { 95 description = "Next generation Python CMake adaptor and Python API for plugins"; 96 homepage = "https://github.com/scikit-build/scikit-build-core"; 97 changelog = "https://github.com/scikit-build/scikit-build-core/blob/${src.tag}/docs/about/changelog.md"; 98 license = with licenses; [ asl20 ]; 99 maintainers = with maintainers; [ veprbl ]; 100 }; 101}