about summary refs log tree commit diff
path: root/pkgs/development/python-modules/ihatemoney/default.nix
blob: 4fe56c6161464f3337dc9b12a858633979ae6762 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
{ buildPythonPackage
, lib
, isPy27
, nixosTests
, fetchPypi
, alembic
, aniso8601
, Babel
, blinker
, cachetools
, click
, dnspython
, email_validator
, flask
, flask-babel
, flask-cors
, flask_mail
, flask_migrate
, flask-restful
, flask_sqlalchemy
, flask-talisman
, flask_wtf
, debts
, idna
, itsdangerous
, jinja2
, Mako
, markupsafe
, python-dateutil
, pytz
, requests
, six
, sqlalchemy
, sqlalchemy-utils
, sqlalchemy-continuum
, sqlalchemy-i18n
, werkzeug
, wtforms
, psycopg2 # optional, for postgresql support
, flask_testing
, pytestCheckHook
, fetchpatch
}:

buildPythonPackage rec {
  pname = "ihatemoney";
  version = "5.1.1";

  src = fetchPypi {
    inherit pname version;
    sha256 = "0gsqba9qbs1dpmfys8qpiahy4pbn4khcc6mgmdnhssmkjsb94sx6";
  };

  disabled = isPy27;

  propagatedBuildInputs = [
    aniso8601
    Babel
    blinker
    cachetools
    click
    dnspython
    email_validator
    flask
    flask-babel
    flask-cors
    flask_mail
    flask_migrate
    flask-restful
    flask-talisman
    flask_wtf
    idna
    itsdangerous
    jinja2
    Mako
    markupsafe
    python-dateutil
    pytz
    requests
    six
    sqlalchemy-continuum
    werkzeug
    wtforms
    psycopg2
    debts
  ];

  patches = [
    # fix build with wtforms 3. remove with next release
    (fetchpatch {
      url = "https://github.com/spiral-project/ihatemoney/commit/40ce32d9fa58a60d26a4d0df547b8deb709c330d.patch";
      sha256 = "sha256-2ewOu21qhq/AOZaE9qrF5J6HH0h6ohFgjDb+BYjJnuQ=";
      excludes = [ "setup.cfg" ];
    })
  ];

  postPatch = ''
    substituteInPlace setup.cfg \
      --replace "Flask-WTF>=0.14.3,<1" "Flask-WTF>=0.14.3,<2" \
      --replace "SQLAlchemy>=1.3.0,<1.4" "SQLAlchemy>=1.3.0,<1.5" \
      --replace "WTForms>=2.3.1,<2.4" "WTForms"
  '';

  checkInputs = [
    flask_testing
    pytestCheckHook
  ];

  pythonImportChecks = [ "ihatemoney" ];

  disabledTests = [
    "test_notifications"  # requires running service.
    "test_invite"         # requires running service.
    "test_invitation_email_failure" # requires dns resolution
  ];

  passthru.tests = {
    inherit (nixosTests.ihatemoney) ihatemoney-postgresql ihatemoney-sqlite;
  };

  meta = with lib; {
    homepage = "https://ihatemoney.org";
    description = "A simple shared budget manager web application";
    license = licenses.beerware;
    maintainers = [ maintainers.symphorien ];
  };
}