diff --git a/pkgs/development/python-modules/moyopy/default.nix b/pkgs/development/python-modules/moyopy/default.nix new file mode 100644 index 000000000000..34cf7e73d9c0 --- /dev/null +++ b/pkgs/development/python-modules/moyopy/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/development/python-modules/pymatgen/default.nix b/pkgs/development/python-modules/pymatgen/default.nix index 36e22e559e1a..4497c333346a 100644 --- a/pkgs/development/python-modules/pymatgen/default.nix +++ b/pkgs/development/python-modules/pymatgen/default.nix @@ -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" diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 989f26ad914b..a5bcbbba1dda 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -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 { };