nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix

python3Packages.hdbscan: fix build error

Sarah Clark 4640bdd3 87d5e58a

+38 -12
+38 -12
pkgs/development/python-modules/hdbscan/default.nix
··· 1 1 { 2 2 lib, 3 3 buildPythonPackage, 4 + fetchFromGitHub, 5 + fetchpatch, 6 + 4 7 cython, 5 8 numpy, 6 - pytestCheckHook, 7 9 scipy, 8 10 scikit-learn, 9 - fetchPypi, 10 11 joblib, 11 12 six, 13 + 14 + # test 15 + pytestCheckHook, 12 16 }: 13 17 14 18 buildPythonPackage rec { ··· 20 16 version = "0.8.40"; 21 17 format = "setuptools"; 22 18 23 - src = fetchPypi { 24 - inherit pname version; 25 - hash = "sha256-yeOD/xe+7gWRB1/2XVJL2ltaNd+wHSGCRae6MMjUihc="; 19 + src = fetchFromGitHub { 20 + owner = "scikit-learn-contrib"; 21 + repo = "hdbscan"; 22 + tag = "release-${version}"; 23 + hash = "sha256-xsBlmSQU47e+M+nRqUXdWKS7Rtj2QZ1UWLAvjSQOJ0Q="; 26 24 }; 27 25 26 + patches = [ 27 + (fetchpatch { 28 + # Replace obsolete use of assert_raises with pytest.raises 29 + name = "replace-assert_raises"; 30 + url = "https://github.com/scikit-learn-contrib/hdbscan/pull/667/commits/04d6a4dcdcd2bb2597419b8aa981d7620765809f.patch"; 31 + hash = "sha256-z/u5b2rNPKOCe+3/GVE8rMB5ajeU5PrvLVesjEgj9TA="; 32 + }) 33 + ]; 34 + 28 35 pythonRemoveDeps = [ "cython" ]; 36 + 29 37 nativeBuildInputs = [ 30 38 cython 31 - ]; 32 - propagatedBuildInputs = [ 33 - numpy 34 - scipy 35 - scikit-learn 36 39 joblib 40 + numpy 41 + scikit-learn 42 + scipy 37 43 six 38 44 ]; 45 + 39 46 preCheck = '' 40 47 cd hdbscan/tests 41 48 rm __init__.py 42 49 ''; 50 + 43 51 nativeCheckInputs = [ pytestCheckHook ]; 52 + 44 53 disabledTests = [ 45 54 # known flaky tests: https://github.com/scikit-learn-contrib/hdbscan/issues/420 46 55 "test_mem_vec_diff_clusters" ··· 64 47 # more flaky tests https://github.com/scikit-learn-contrib/hdbscan/issues/570 65 48 "test_hdbscan_boruvka_balltree" 66 49 "test_hdbscan_best_balltree_metric" 50 + # "got an unexpected keyword argument" 51 + "test_hdbscan_badargs" 52 + ]; 53 + 54 + disabledTestPaths = [ 55 + # joblib.externals.loky.process_executor.BrokenProcessPool: 56 + "test_branches.py" 67 57 ]; 68 58 69 59 pythonImportsCheck = [ "hdbscan" ]; 70 60 71 - meta = with lib; { 61 + meta = { 72 62 description = "Hierarchical Density-Based Spatial Clustering of Applications with Noise, a clustering algorithm with a scikit-learn compatible API"; 73 63 homepage = "https://github.com/scikit-learn-contrib/hdbscan"; 74 - license = licenses.bsd3; 64 + changelog = "https://github.com/scikit-learn-contrib/hdbscan/releases/tag/release-${version}"; 65 + license = lib.licenses.bsd3; 66 + maintainers = [ ]; 75 67 }; 76 68 }