1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6 hatchling,
7 pytestCheckHook,
8 pytest-cov-stub,
9 huggingface-hub,
10 matplotlib,
11 pandas,
12 scikit-learn,
13 stdenv,
14 streamlit,
15 tabulate,
16}:
17
18buildPythonPackage rec {
19 pname = "skops";
20 version = "0.11.0";
21 pyproject = true;
22
23 disabled = pythonOlder "3.9";
24
25 src = fetchFromGitHub {
26 owner = "skops-dev";
27 repo = "skops";
28 tag = "v${version}";
29 hash = "sha256-23Wy/VSd/CvpqT/zDX4ApplfsUwbjOj9q+T8YCKs8X4=";
30 };
31
32 build-system = [ hatchling ];
33
34 dependencies = [
35 huggingface-hub
36 scikit-learn
37 tabulate
38 ];
39
40 nativeCheckInputs = [
41 matplotlib
42 pandas
43 pytestCheckHook
44 pytest-cov-stub
45 streamlit
46 ];
47 pytestFlagsArray = [ "skops" ];
48 disabledTests = [
49 # flaky
50 "test_base_case_works_as_expected"
51 ];
52 disabledTestPaths =
53 [
54 # try to download data from Huggingface Hub:
55 "skops/hub_utils/tests"
56 "skops/card/tests"
57 # minor output formatting issue
58 "skops/card/_model_card.py"
59 ]
60 ++ lib.optionals stdenv.hostPlatform.isDarwin [
61 # Segfaults on darwin
62 "skops/io/tests/test_persist.py"
63 ];
64
65 pythonImportsCheck = [ "skops" ];
66
67 meta = {
68 description = "Library for saving/loading, sharing, and deploying scikit-learn based models";
69 mainProgram = "skops";
70 homepage = "https://skops.readthedocs.io/en/stable";
71 changelog = "https://github.com/skops-dev/skops/releases/tag/${src.tag}";
72 license = lib.licenses.mit;
73 maintainers = [ lib.maintainers.bcdarwin ];
74 };
75}