From 71f5ffa84e539e420a35921bec2889d748c58cc7 Mon Sep 17 00:00:00 2001 From: natsukium Date: Sat, 28 Oct 2023 22:38:38 +0900 Subject: [PATCH] python311Packages.mdtraj: init at 1.9.9 --- .../python-modules/mdtraj/default.nix | 102 ++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 104 insertions(+) create mode 100644 pkgs/development/python-modules/mdtraj/default.nix diff --git a/pkgs/development/python-modules/mdtraj/default.nix b/pkgs/development/python-modules/mdtraj/default.nix new file mode 100644 index 000000000000..ad20cdbf0671 --- /dev/null +++ b/pkgs/development/python-modules/mdtraj/default.nix @@ -0,0 +1,102 @@ +{ lib +, stdenv +, buildPythonPackage +, fetchFromGitHub +, fetchpatch +, llvmPackages +, zlib +, cython +, oldest-supported-numpy +, setuptools +, wheel +, astunparse +, numpy +, pyparsing +, scipy +, gsd +, networkx +, pandas +, pytest-xdist +, pytestCheckHook +, tables +}: + +buildPythonPackage rec { + pname = "mdtraj"; + version = "1.9.9"; + pyproject = true; + + src = fetchFromGitHub { + owner = "mdtraj"; + repo = "mdtraj"; + rev = "refs/tags/${version}"; + hash = "sha256-2Jg6DyVJlRBLD/6hMtcsrAdxKF5RkpUuhAQm/lqVGeE="; + }; + + patches = [ + (fetchpatch { + name = "gsd_3-compatibility.patch"; + url = "https://github.com/mdtraj/mdtraj/commit/81209d00817ab07cfc4668bf5ec88088d16904c0.patch"; + hash = "sha256-ttNmij7csxF0Z5wPPwhGumRX055W2IgFjRAe6nI6GNY="; + }) + ]; + + nativeBuildInputs = [ + cython + oldest-supported-numpy + setuptools + wheel + ]; + + buildInputs = [ + zlib + ] ++ lib.optionals stdenv.cc.isClang [ + llvmPackages.openmp + ]; + + propagatedBuildInputs = [ + astunparse + numpy + pyparsing + scipy + ]; + + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-incompatible-function-pointer-types"; + + nativeCheckInputs = [ + gsd + networkx + pandas + pytest-xdist + pytestCheckHook + tables + ]; + + preCheck = '' + cd tests + export PATH=$out/bin:$PATH + ''; + + disabledTests = [ + # require network access + "test_pdb_from_url" + "test_1vii_url_and_gz" + + # fail due to data race + "test_read_atomindices_1" + "test_read_atomindices_2" + + # flaky test + "test_distances_t" + ]; + + pythonImportsCheck = [ "mdtraj" ]; + + meta = with lib; { + description = "An open library for the analysis of molecular dynamics trajectories"; + homepage = "https://github.com/mdtraj/mdtraj"; + changelog = "https://github.com/mdtraj/mdtraj/releases/tag/${src.rev}"; + license = licenses.lgpl21Plus; + maintainers = with maintainers; [ natsukium ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a2a025742df9..cb8634b1b329 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6686,6 +6686,8 @@ self: super: with self; { mdit-py-plugins = callPackage ../development/python-modules/mdit-py-plugins { }; + mdtraj = callPackage ../development/python-modules/mdtraj { }; + mdurl = callPackage ../development/python-modules/mdurl { }; mdutils = callPackage ../development/python-modules/mdutils { };