1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 rustPlatform,
8
9 # dependencies
10 typing-extensions,
11
12 # tests
13 numpy,
14 pytestCheckHook,
15}:
16
17buildPythonPackage rec {
18 pname = "moyopy";
19 version = "0.5.0";
20 pyproject = true;
21
22 src = fetchFromGitHub {
23 owner = "spglib";
24 repo = "moyo";
25 tag = "v${version}";
26 hash = "sha256-mOXg/BtXCg2ob5rRl9fVcJ1oNuVqOWUcjkAexW9KUfI=";
27 };
28
29 sourceRoot = "${src.name}/moyopy";
30 cargoRoot = "..";
31
32 nativeBuildInputs = with rustPlatform; [
33 cargoSetupHook
34 maturinBuildHook
35 ];
36
37 env = {
38 CARGO_TARGET_DIR = "./target";
39 };
40
41 cargoDeps = rustPlatform.fetchCargoVendor {
42 inherit
43 pname
44 version
45 src
46 sourceRoot
47 cargoRoot
48 ;
49 hash = "sha256-yaW1nI1BWG8vvbTKc8pIkQXeCqBoJmqyqr1ra8YO6xM=";
50 };
51
52 build-system = [
53 rustPlatform.cargoSetupHook
54 rustPlatform.maturinBuildHook
55 ];
56
57 dependencies = [
58 typing-extensions
59 ];
60
61 pythonImportsCheck = [ "moyopy" ];
62
63 nativeCheckInputs = [
64 numpy
65 pytestCheckHook
66 ];
67
68 disabledTestPaths = [
69 # Circular dependency with pymatgen
70 "python/tests/test_interface.py"
71 ];
72
73 meta = {
74 description = "Python interface of moyo, a fast and robust crystal symmetry finder";
75 homepage = "https://spglib.github.io/moyo/python/";
76 changelog = "https://github.com/spglib/moyo/releases/tag/v${version}";
77 license = lib.licenses.asl20;
78 maintainers = with lib.maintainers; [ GaetanLepage ];
79 };
80}