Files
2026-06-10 06:30:05 +00:00

82 lines
1.5 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
# build-system
rustPlatform,
# dependencies
typing-extensions,
# tests
numpy,
pytestCheckHook,
}:
buildPythonPackage (finalAttrs: {
pname = "moyopy";
version = "0.11.0";
pyproject = true;
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "spglib";
repo = "moyo";
tag = "v${finalAttrs.version}";
hash = "sha256-PxKY/dhYKdvl2dfrDfsqg46TJ2EFx6Px27u8OddQjiI=";
};
sourceRoot = "${finalAttrs.src.name}/moyopy";
cargoRoot = "..";
nativeBuildInputs = with rustPlatform; [
cargoSetupHook
maturinBuildHook
];
env = {
CARGO_TARGET_DIR = "./target";
};
cargoDeps = rustPlatform.fetchCargoVendor {
inherit (finalAttrs)
pname
version
src
sourceRoot
cargoRoot
;
hash = "sha256-8GNHuRv3neE0xhfLyxw92DvZRUJFrYm7JCi0Bd2KROs=";
};
build-system = [
rustPlatform.cargoSetupHook
rustPlatform.maturinBuildHook
];
dependencies = [
typing-extensions
];
pythonImportsCheck = [ "moyopy" ];
nativeCheckInputs = [
numpy
pytestCheckHook
];
disabledTestPaths = [
# Circular dependency with pymatgen
"python/tests/test_interface.py"
];
meta = {
description = "Python interface of moyo, a fast and robust crystal symmetry finder";
homepage = "https://spglib.github.io/moyo/python/";
changelog = "https://github.com/spglib/moyo/releases/tag/${finalAttrs.src.tag}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ GaetanLepage ];
};
})