Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 python3,
4 fetchFromGitHub,
5 fetchPypi,
6}:
7
8let
9 python3' = python3.override {
10 packageOverrides = self: super: {
11 scikit-learn =
12 let
13 version = "1.5.2";
14 in
15 super.scikit-learn.overridePythonAttrs (old: {
16 inherit version;
17
18 src = fetchPypi {
19 pname = "scikit_learn";
20 inherit version;
21 hash = "sha256-tCN+17P90KSIJ5LmjvJUXVuqUKyju0WqffRoE4rY+U0=";
22 };
23
24 # There are 2 tests that are failing, disabling the tests for now.
25 # - test_csr_polynomial_expansion_index_overflow[csr_array-False-True-2-65535]
26 # - test_csr_polynomial_expansion_index_overflow[csr_array-False-True-3-2344]
27 doCheck = false;
28 });
29 };
30 self = python3;
31 };
32
33 # Make sure to check for which version of scikit-learn this project was built
34 # Currently version 2.3.2 is made with scikit-learn 1.5.2
35 # Upgrading to newer versions of scikit-learn break the project
36 version = "2.3.2";
37in
38python3'.pkgs.buildPythonApplication {
39 pname = "rabbit";
40 inherit version;
41 pyproject = true;
42
43 src = fetchFromGitHub {
44 owner = "natarajan-chidambaram";
45 repo = "RABBIT";
46 tag = version;
47 hash = "sha256-icf42vqYPNH1v1wEv/MpqScqMUr/qDlcGoW9kPY2R6s=";
48 };
49
50 pythonRelaxDeps = [
51 "joblib"
52 "numpy"
53 "requests"
54 "scikit-learn"
55 "scipy"
56 "tqdm"
57 "urllib3"
58 ];
59
60 build-system = with python3'.pkgs; [
61 setuptools
62 ];
63
64 dependencies = with python3'.pkgs; [
65 joblib
66 numpy
67 pandas
68 python-dateutil
69 requests
70 scikit-learn
71 scipy
72 tqdm
73 urllib3
74 ];
75
76 pythonImportsCheck = [ "rabbit" ];
77
78 meta = {
79 description = "Tool for identifying bot accounts based on their recent GitHub event history";
80 homepage = "https://github.com/natarajan-chidambaram/RABBIT";
81 license = lib.licenses.asl20;
82 mainProgram = "rabbit";
83 maintainers = with lib.maintainers; [ drupol ];
84 };
85}