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 numpy
46 ]
47 ++ lib.optionals (pythonOlder "3.13") [
48 typing-extensions
49 ];
50
51 nativeCheckInputs = [
52 pytestCheckHook
53 pyyaml
54 ];
55
56 pythonImportsCheck = [ "spglib" ];
57
58 meta = {
59 description = "Python bindings for C library for finding and handling crystal symmetries";
60 homepage = "https://spglib.github.io/spglib/";
61 changelog = "https://github.com/spglib/spglib/raw/v${version}/ChangeLog";
62 license = lib.licenses.bsd3;
63 maintainers = with lib.maintainers; [ psyanticy ];
64 };
65}