Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / scikit-build-core / default.nix
blobbea510faa93afe02dd3f4573916cf9057866c164
1 { lib
2 , buildPythonPackage
3 , fetchPypi
4 , distlib
5 , pythonOlder
6 , exceptiongroup
7 , hatch-vcs
8 , hatchling
9 , cattrs
10 , cmake
11 , ninja
12 , packaging
13 , pathspec
14 , pyproject-metadata
15 , pytest-subprocess
16 , pytestCheckHook
17 , setuptools
18 , tomli
19 , wheel
22 buildPythonPackage rec {
23   pname = "scikit-build-core";
24   version = "0.5.1";
25   format = "pyproject";
27   src = fetchPypi {
28     pname = "scikit_build_core";
29     inherit version;
30     hash = "sha256-xtrVpRJ7Kr+qI8uR0jrCEFn9d83fcSKzP9B3kQJNz78=";
31   };
33   postPatch = ''
34     substituteInPlace pyproject.toml \
35       --replace 'minversion = "7.2"' "" \
36       --replace '"error",' '"error", "ignore::DeprecationWarning", "ignore::UserWarning",'
37   '';
39   nativeBuildInputs = [
40     hatch-vcs
41     hatchling
42   ];
44   propagatedBuildInputs = [
45     packaging
46   ] ++ lib.optionals (pythonOlder "3.11") [
47     exceptiongroup
48     tomli
49   ];
51   passthru.optional-dependencies = {
52     pyproject = [
53       distlib
54       pathspec
55       pyproject-metadata
56     ];
57   };
59   dontUseCmakeConfigure = true;
61   nativeCheckInputs = [
62     cattrs
63     cmake
64     ninja
65     pytest-subprocess
66     pytestCheckHook
67     setuptools
68     wheel
69   ] ++ passthru.optional-dependencies.pyproject;
71   disabledTestPaths = [
72     # runs pip, requires network access
73     "tests/test_custom_modules.py"
74     "tests/test_pyproject_pep517.py"
75     "tests/test_pyproject_pep518.py"
76     "tests/test_pyproject_pep660.py"
77     "tests/test_setuptools_pep517.py"
78     "tests/test_setuptools_pep518.py"
79   ];
81   pythonImportsCheck = [
82     "scikit_build_core"
83   ];
85   meta = with lib; {
86     description = "A next generation Python CMake adaptor and Python API for plugins";
87     homepage = "https://github.com/scikit-build/scikit-build-core";
88     changelog = "https://github.com/scikit-build/scikit-build-core/releases/tag/v${version}";
89     license = with licenses; [ asl20 ];
90     maintainers = with maintainers; [ veprbl ];
91   };