Merge pull request #326081 from doronbehar/pkg/freud

python312Packages.freud: fix build

authored by Doron Behar and committed by GitHub bfe1416e 6af55cb9

+50 -37
+50 -37
pkgs/development/python-modules/freud/default.nix
··· 1 - { lib 2 - , stdenv 3 - , buildPythonPackage 4 - , fetchFromGitHub 5 - , cmake 6 - , cython 7 - , oldest-supported-numpy 8 - , scikit-build 9 - , setuptools 10 - , tbb 11 - , numpy 12 - , rowan 13 - , scipy 14 - , pytest 15 - , gsd 16 - , matplotlib 17 - , sympy 18 }: 19 20 buildPythonPackage rec { ··· 29 hash = "sha256-jlscEHQ1q4oqxE06NhVWCOlPRcjDcJVrvy4h6iYrkz0="; 30 fetchSubmodules = true; 31 }; 32 # Because we prefer to not `leaveDotGit`, we need to fool upstream into 33 # thinking we left the .git files in the submodules, so cmake won't think we 34 # didn't initialize them. Upstream doesn't support using the system wide ··· 39 touch extern/{voro++,fsph,Eigen}/.git 40 ''; 41 42 nativeBuildInputs = [ 43 cmake 44 cython ··· 47 setuptools 48 ]; 49 dontUseCmakeConfigure = true; 50 - buildInputs = [ 51 - tbb 52 - ]; 53 54 propagatedBuildInputs = [ 55 numpy ··· 58 ]; 59 60 nativeCheckInputs = [ 61 - # Encountering circular ImportError issues with pytestCheckHook, see also: 62 - # https://github.com/NixOS/nixpkgs/issues/255262 63 - pytest 64 gsd 65 matplotlib 66 sympy 67 ]; 68 - checkPhase = '' 69 - runHook preCheck 70 - 71 - pytest 72 - 73 - runHook postCheck 74 ''; 75 - # Some tests fail on aarch64. If we could have used pytestCheckHook, we would 76 - # have disabled only the tests that fail with the disabledTests attribute. 77 - # But that is not possible unfortunately. See upstream report for the 78 - # failure: https://github.com/glotzerlab/freud/issues/961 79 - doCheck = !stdenv.isAarch64; 80 81 pythonImportsCheck = [ "freud" ]; 82 83 - meta = with lib; { 84 description = "Powerful, efficient particle trajectory analysis in scientific Python"; 85 homepage = "https://github.com/glotzerlab/freud"; 86 changelog = "https://github.com/glotzerlab/freud/blob/${src.rev}/ChangeLog.md"; 87 - license = licenses.bsd3; 88 - maintainers = with maintainers; [ doronbehar ]; 89 }; 90 }
··· 1 + { 2 + lib, 3 + stdenv, 4 + buildPythonPackage, 5 + fetchFromGitHub, 6 + fetchpatch, 7 + cmake, 8 + cython, 9 + oldest-supported-numpy, 10 + scikit-build, 11 + setuptools, 12 + tbb, 13 + numpy, 14 + rowan, 15 + scipy, 16 + pytestCheckHook, 17 + python, 18 + gsd, 19 + matplotlib, 20 + sympy, 21 }: 22 23 buildPythonPackage rec { ··· 32 hash = "sha256-jlscEHQ1q4oqxE06NhVWCOlPRcjDcJVrvy4h6iYrkz0="; 33 fetchSubmodules = true; 34 }; 35 + 36 + patches = [ 37 + # https://github.com/glotzerlab/freud/issues/1269 38 + (fetchpatch { 39 + url = "https://github.com/glotzerlab/freud/commit/8f636e3815737945e45da5b9996b5f69df07c9a5.patch"; 40 + hash = "sha256-PLorRrYj16oBWHYzXDq62kECzVTtyr+1Z20DJqTkXxg="; 41 + }) 42 + ]; 43 + 44 # Because we prefer to not `leaveDotGit`, we need to fool upstream into 45 # thinking we left the .git files in the submodules, so cmake won't think we 46 # didn't initialize them. Upstream doesn't support using the system wide ··· 51 touch extern/{voro++,fsph,Eigen}/.git 52 ''; 53 54 + # Scipy still depends on numpy 1, and so we'd get 'package duplicates in 55 + # closure' error if we'd use numpy_2 56 + postPatch = '' 57 + substituteInPlace pyproject.toml \ 58 + --replace-fail 'numpy>=2.0.0rc1' 'numpy' \ 59 + ''; 60 + 61 nativeBuildInputs = [ 62 cmake 63 cython ··· 66 setuptools 67 ]; 68 dontUseCmakeConfigure = true; 69 + buildInputs = [ tbb ]; 70 71 propagatedBuildInputs = [ 72 numpy ··· 75 ]; 76 77 nativeCheckInputs = [ 78 + pytestCheckHook 79 gsd 80 matplotlib 81 sympy 82 ]; 83 + disabledTests = lib.optionals stdenv.isAarch64 [ 84 + # https://github.com/glotzerlab/freud/issues/961 85 + "test_docstring" 86 + ]; 87 + # On top of cd $out due to https://github.com/NixOS/nixpkgs/issues/255262 , 88 + # we need to also copy the tests because otherwise pytest won't find them. 89 + preCheck = '' 90 + cp -R tests $out/${python.sitePackages}/freud/tests 91 + cd $out 92 ''; 93 94 pythonImportsCheck = [ "freud" ]; 95 96 + meta = { 97 description = "Powerful, efficient particle trajectory analysis in scientific Python"; 98 homepage = "https://github.com/glotzerlab/freud"; 99 changelog = "https://github.com/glotzerlab/freud/blob/${src.rev}/ChangeLog.md"; 100 + license = lib.licenses.bsd3; 101 + maintainers = with lib.maintainers; [ doronbehar ]; 102 }; 103 }