1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 numpy,
6 pyyaml,
7 matplotlib,
8 h5py,
9 scipy,
10 spglib,
11 pytestCheckHook,
12 pythonOlder,
13 setuptools,
14 scikit-build-core,
15 cmake,
16 setuptools-scm,
17 ninja,
18 pkg-config,
19 nanobind,
20}:
21
22buildPythonPackage rec {
23 pname = "phonopy";
24 version = "2.29.1";
25 pyproject = true;
26
27 disabled = pythonOlder "3.7";
28
29 src = fetchPypi {
30 inherit pname version;
31 hash = "sha256-MabBtEOyM82R0NbdVaY+2f9GT8rT44xjOi/o38GSRp8=";
32 };
33
34 nativeBuildInputs = [
35 setuptools
36 scikit-build-core
37 nanobind
38 setuptools-scm
39 ninja
40 cmake
41 ];
42 dontUseCmakeConfigure = true;
43
44 propagatedBuildInputs = [
45 h5py
46 matplotlib
47 numpy
48 pyyaml
49 scipy
50 spglib
51 ];
52
53 nativeCheckInputs = [ pytestCheckHook ];
54
55 # prevent pytest from importing local directory
56 preCheck = ''
57 rm -r phonopy
58 '';
59
60 pythonImportsCheck = [ "phonopy" ];
61
62 meta = with lib; {
63 description = "Modulefor phonon calculations at harmonic and quasi-harmonic levels";
64 homepage = "https://phonopy.github.io/phonopy/";
65 changelog = "https://github.com/phonopy/phonopy/blob/v${version}/doc/changelog.md";
66 license = licenses.bsd0;
67 maintainers = with maintainers; [ psyanticy ];
68 };
69}