Files
nixpkgs/pkgs/development/python-modules/moyopy/default.nix
T
2026-03-08 17:48:01 +00:00

81 lines
1.5 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
# build-system
rustPlatform,
# dependencies
typing-extensions,
# tests
numpy,
pytestCheckHook,
}:
buildPythonPackage (finalAttrs: {
pname = "moyopy";
version = "0.7.9";
pyproject = true;
src = fetchFromGitHub {
owner = "spglib";
repo = "moyo";
tag = "v${finalAttrs.version}";
hash = "sha256-XPXLBEGDGX8MTaM91K0Y7Zjyafq6zscSVELRk3HWIYM=";
};
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-DB9hyf1z6tEt7ErswfyFtXCrhEG9z8DSlGqvRRho0xo=";
};
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 ];
};
})