1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6
7 # build-system
8 scikit-build-core,
9 numpy,
10 cmake,
11 ninja,
12 setuptools-scm,
13
14 # dependencies
15 typing-extensions,
16
17 # tests
18 pytestCheckHook,
19 pyyaml,
20}:
21
22buildPythonPackage rec {
23 pname = "spglib";
24 version = "2.6.0";
25 pyproject = true;
26
27 src = fetchFromGitHub {
28 owner = "spglib";
29 repo = "spglib";
30 tag = "v${version}";
31 hash = "sha256-rmQYFFfpyUhT9pfQZk1fN5tZWTg40wwtszhPhiZpXs4=";
32 };
33
34 build-system = [
35 scikit-build-core
36 numpy
37 cmake
38 ninja
39 setuptools-scm
40 ];
41
42 dontUseCmakeConfigure = true;
43
44 dependencies =
45 [
46 numpy
47 ]
48 ++ lib.optionals (pythonOlder "3.13") [
49 typing-extensions
50 ];
51
52 nativeCheckInputs = [
53 pytestCheckHook
54 pyyaml
55 ];
56
57 pythonImportsCheck = [ "spglib" ];
58
59 meta = {
60 description = "Python bindings for C library for finding and handling crystal symmetries";
61 homepage = "https://spglib.github.io/spglib/";
62 changelog = "https://github.com/spglib/spglib/raw/v${version}/ChangeLog";
63 license = lib.licenses.bsd3;
64 maintainers = with lib.maintainers; [ psyanticy ];
65 };
66}