1{ lib
2, stdenv
3, buildPythonPackage
4, fetchFromGitHub
5, matplotlib
6, numpy
7, pytestCheckHook
8, pythonOlder
9, scipy
10, seaborn
11, requests
12}:
13
14buildPythonPackage rec {
15 pname = "simpful";
16 version = "2.11.0";
17 format = "setuptools";
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchFromGitHub {
22 owner = "aresio";
23 repo = pname;
24 rev = "refs/tags/${version}";
25 hash = "sha256-1CU/Iz83CKRx7dsOTGfdJm98TUfc2kxCHKIEUXP36HQ=";
26 };
27
28 # patch dated use of private matplotlib interface
29 # https://github.com/aresio/simpful/issues/22
30 postPatch = ''
31 substituteInPlace simpful/simpful.py \
32 --replace \
33 "next(ax._get_lines.prop_cycler)['color']" \
34 "ax._get_lines.get_next_color()"
35 '';
36
37 propagatedBuildInputs = [
38 numpy
39 scipy
40 requests
41 ];
42
43 passthru.optional-dependencies = {
44 plotting = [
45 matplotlib
46 seaborn
47 ];
48 };
49
50 nativeCheckInputs = [
51 pytestCheckHook
52 ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
53
54 pythonImportsCheck = [
55 "simpful"
56 ];
57
58 meta = with lib; {
59 broken = stdenv.isDarwin;
60 description = "Library for fuzzy logic";
61 homepage = "https://github.com/aresio/simpful";
62 changelog = "https://github.com/aresio/simpful/releases/tag/${version}";
63 license = with licenses; [ lgpl3Only ];
64 maintainers = with maintainers; [ fab ];
65 };
66}