nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, buildPythonPackage
3, pythonOlder
4, nixosTests
5, fetchPypi
6, alembic
7, aniso8601
8, babel
9, blinker
10, cachetools
11, click
12, dnspython
13, email_validator
14, flask
15, flask-babel
16, flask-cors
17, flask_mail
18, flask_migrate
19, flask-restful
20, flask_sqlalchemy
21, flask-talisman
22, flask_wtf
23, debts
24, idna
25, itsdangerous
26, jinja2
27, Mako
28, markupsafe
29, python-dateutil
30, pytz
31, requests
32, sqlalchemy
33, sqlalchemy-utils
34, sqlalchemy-continuum
35, sqlalchemy-i18n
36, werkzeug
37, wtforms
38, psycopg2 # optional, for postgresql support
39, flask-testing
40, pytestCheckHook
41}:
42
43buildPythonPackage rec {
44 pname = "ihatemoney";
45 version = "5.2.0";
46 format = "setuptools";
47
48 disabled = pythonOlder "3.7";
49
50 src = fetchPypi {
51 inherit pname version;
52 sha256 = "sha256-uQgZBbpqqbZYHpR+GwHWX0c7di2rVvEz0jPRY6+BkkQ=";
53 };
54
55 propagatedBuildInputs = [
56 aniso8601
57 babel
58 blinker
59 cachetools
60 click
61 debts
62 dnspython
63 email_validator
64 flask
65 flask_mail
66 flask_migrate
67 flask_wtf
68 flask-babel
69 flask-cors
70 flask-restful
71 flask-talisman
72 idna
73 itsdangerous
74 jinja2
75 Mako
76 markupsafe
77 psycopg2
78 python-dateutil
79 pytz
80 requests
81 sqlalchemy
82 sqlalchemy-continuum
83 werkzeug
84 wtforms
85 ];
86
87 postPatch = ''
88 substituteInPlace setup.cfg \
89 --replace "cachetools>=4.1,<5" "cachetools>=4.1" \
90 --replace "SQLAlchemy>=1.3.0,<1.4" "SQLAlchemy>=1.3.0,<1.5" \
91 --replace "WTForms>=2.3.1,<3.1" "WTForms"
92 '';
93
94 checkInputs = [
95 flask-testing
96 pytestCheckHook
97 ];
98
99 pythonImportsCheck = [
100 "ihatemoney"
101 ];
102
103 disabledTests = [
104 # Requires running service
105 "test_notifications"
106 "test_invite"
107 "test_access_other_projects"
108 "test_authentication"
109 "test_manage_bills"
110 "test_member_delete_method"
111 "test_membership"
112 "test_bill_add_remove_add"
113 "test_clear_ip_records"
114 "test_disable_clear_no_new_records"
115 "test_logs_for_common_actions"
116 # Requires DNS resolution
117 "test_invitation_email_failure"
118 ];
119
120 passthru.tests = {
121 inherit (nixosTests.ihatemoney) ihatemoney-postgresql ihatemoney-sqlite;
122 };
123
124 meta = with lib; {
125 description = "Shared budget manager web application";
126 homepage = "https://ihatemoney.org";
127 license = licenses.beerware;
128 maintainers = with maintainers; [ symphorien ];
129 };
130}