Merge pull request #291386 from risicle/ris-pymatgen-2024.2.23

python3Packages.pymatgen: 2022.3.29 -> 2024.2.23, enable tests

authored by Martin Weinelt and committed by GitHub 98ecb2ae 2c53d572

+33 -4
+33 -4
pkgs/development/python-modules/pymatgen/default.nix
··· 1 1 { lib 2 + , stdenv 2 3 , buildPythonPackage 3 4 , fetchFromGitHub 5 + , ase 4 6 , cython 5 7 , glibcLocales 8 + , joblib 6 9 , matplotlib 7 10 , monty 8 11 , networkx ··· 12 15 , plotly 13 16 , pybtex 14 17 , pydispatcher 18 + , pytestCheckHook 19 + , pytest-xdist 15 20 , pythonOlder 16 21 , requests 17 22 , ruamel-yaml 18 23 , scipy 24 + , seekpath 19 25 , spglib 20 26 , sympy 21 27 , tabulate ··· 24 30 25 31 buildPythonPackage rec { 26 32 pname = "pymatgen"; 27 - version = "2022.3.29"; 33 + version = "2024.2.23"; 28 34 format = "setuptools"; 29 35 30 36 disabled = pythonOlder "3.8"; ··· 33 39 owner = "materialsproject"; 34 40 repo = "pymatgen"; 35 41 rev= "v${version}"; 36 - hash = "sha256-B2piRWx9TfKlGTPOAAGsq2GxyfHIRBVFpk6dxES0WF0="; 42 + hash = "sha256-eswoup9ACj/PHVW3obcnZjD4tWemsmROZFtwGGigEYE="; 37 43 }; 38 44 39 45 nativeBuildInputs = [ ··· 60 66 uncertainties 61 67 ]; 62 68 63 - # Tests are not detected by pytest 64 - doCheck = false; 69 + nativeCheckInputs = [ 70 + pytestCheckHook 71 + pytest-xdist 72 + ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies); 73 + preCheck = '' 74 + # hide from tests 75 + mv pymatgen _pymatgen 76 + # ensure tests can find these 77 + export PMG_TEST_FILES_DIR="$(realpath ./tests/files)" 78 + # some tests cover the command-line scripts 79 + export PATH=$out/bin:$PATH 80 + ''; 81 + disabledTests = [ 82 + # presumably won't work with our dir layouts 83 + "test_egg_sources_txt_is_complete" 84 + # borderline precision failure 85 + "test_thermal_conductivity" 86 + ]; 87 + 88 + passthru.optional-dependencies = { 89 + ase = [ ase ]; 90 + joblib = [ joblib ]; 91 + seekpath = [ seekpath ]; 92 + }; 65 93 66 94 pythonImportsCheck = [ 67 95 "pymatgen" 68 96 ]; 69 97 70 98 meta = with lib; { 99 + broken = stdenv.isDarwin; # tests segfault. that's bad. 71 100 description = "A robust materials analysis code that defines core object representations for structures and molecules"; 72 101 homepage = "https://pymatgen.org/"; 73 102 license = licenses.mit;