python3Packages.pymatgen: add moyopy dependency (#439861)

This commit is contained in:
Gaétan Lepage
2025-09-03 21:59:47 +02:00
committed by GitHub
3 changed files with 85 additions and 5 deletions
@@ -0,0 +1,80 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
# build-system
rustPlatform,
# dependencies
typing-extensions,
# tests
numpy,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "moyopy";
version = "0.4.4";
pyproject = true;
src = fetchFromGitHub {
owner = "spglib";
repo = "moyo";
tag = "v${version}";
hash = "sha256-TWZAqvtPeJqKXUFiNxD8H/aqjiDSWaTkMEQW0cuhEMY=";
};
sourceRoot = "${src.name}/moyopy";
cargoRoot = "..";
nativeBuildInputs = with rustPlatform; [
cargoSetupHook
maturinBuildHook
];
env = {
CARGO_TARGET_DIR = "./target";
};
cargoDeps = rustPlatform.fetchCargoVendor {
inherit
pname
version
src
sourceRoot
cargoRoot
;
hash = "sha256-L4SAX4HWx+TSPQm7K6C5IEpFkx/AlscmKRs2wPEQun4=";
};
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/v${version}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ GaetanLepage ];
};
}
@@ -46,6 +46,7 @@
# tests
addBinToPathHook,
moyopy,
pytest-xdist,
pytestCheckHook,
}:
@@ -122,6 +123,7 @@ buildPythonPackage rec {
nativeCheckInputs = [
addBinToPathHook
moyopy
pytestCheckHook
pytest-xdist
]
@@ -169,11 +171,7 @@ buildPythonPackage rec {
"test_timer"
];
disabledTestPaths = [
# We have not packaged moyopy yet.
"tests/analysis/test_prototypes.py::test_get_protostructure_label_from_moyopy"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [
# Crash when running the pmg command
# Critical error: required built-in appearance SystemAppearance not found
"tests/cli/test_pmg_plot.py"
+2
View File
@@ -9615,6 +9615,8 @@ self: super: with self; {
moviepy = callPackage ../development/python-modules/moviepy { };
moyopy = callPackage ../development/python-modules/moyopy { };
mozart-api = callPackage ../development/python-modules/mozart-api { };
mozilla-django-oidc = callPackage ../development/python-modules/mozilla-django-oidc { };