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

python3Packages.pymatgen: 2022.3.29 -> 2024.2.23, enable tests
This commit is contained in:
Martin Weinelt 2024-03-02 14:57:31 +01:00 committed by GitHub
commit 98ecb2aed7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,8 +1,11 @@
{ lib { lib
, stdenv
, buildPythonPackage , buildPythonPackage
, fetchFromGitHub , fetchFromGitHub
, ase
, cython , cython
, glibcLocales , glibcLocales
, joblib
, matplotlib , matplotlib
, monty , monty
, networkx , networkx
@ -12,10 +15,13 @@
, plotly , plotly
, pybtex , pybtex
, pydispatcher , pydispatcher
, pytestCheckHook
, pytest-xdist
, pythonOlder , pythonOlder
, requests , requests
, ruamel-yaml , ruamel-yaml
, scipy , scipy
, seekpath
, spglib , spglib
, sympy , sympy
, tabulate , tabulate
@ -24,7 +30,7 @@
buildPythonPackage rec { buildPythonPackage rec {
pname = "pymatgen"; pname = "pymatgen";
version = "2022.3.29"; version = "2024.2.23";
format = "setuptools"; format = "setuptools";
disabled = pythonOlder "3.8"; disabled = pythonOlder "3.8";
@ -33,7 +39,7 @@ buildPythonPackage rec {
owner = "materialsproject"; owner = "materialsproject";
repo = "pymatgen"; repo = "pymatgen";
rev= "v${version}"; rev= "v${version}";
hash = "sha256-B2piRWx9TfKlGTPOAAGsq2GxyfHIRBVFpk6dxES0WF0="; hash = "sha256-eswoup9ACj/PHVW3obcnZjD4tWemsmROZFtwGGigEYE=";
}; };
nativeBuildInputs = [ nativeBuildInputs = [
@ -60,14 +66,37 @@ buildPythonPackage rec {
uncertainties uncertainties
]; ];
# Tests are not detected by pytest nativeCheckInputs = [
doCheck = false; pytestCheckHook
pytest-xdist
] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
preCheck = ''
# hide from tests
mv pymatgen _pymatgen
# ensure tests can find these
export PMG_TEST_FILES_DIR="$(realpath ./tests/files)"
# some tests cover the command-line scripts
export PATH=$out/bin:$PATH
'';
disabledTests = [
# presumably won't work with our dir layouts
"test_egg_sources_txt_is_complete"
# borderline precision failure
"test_thermal_conductivity"
];
passthru.optional-dependencies = {
ase = [ ase ];
joblib = [ joblib ];
seekpath = [ seekpath ];
};
pythonImportsCheck = [ pythonImportsCheck = [
"pymatgen" "pymatgen"
]; ];
meta = with lib; { meta = with lib; {
broken = stdenv.isDarwin; # tests segfault. that's bad.
description = "A robust materials analysis code that defines core object representations for structures and molecules"; description = "A robust materials analysis code that defines core object representations for structures and molecules";
homepage = "https://pymatgen.org/"; homepage = "https://pymatgen.org/";
license = licenses.mit; license = licenses.mit;