@@ -1,4 +1,4 @@
1−{ buildPythonPackage, lib, fetchFromGitHub, isPy27, nixosTests
1+{ buildPythonPackage, lib, fetchFromGitHub, isPy27, nixosTests, fetchpatch, fetchPypi
22, alembic
33, aniso8601
44, Babel
@@ -15,33 +15,65 @@
1515, flask_script
1616, flask_sqlalchemy
1717, flask_wtf
18+, debts
1819, idna
1920, itsdangerous
2021, jinja2
2122, Mako
2223, markupsafe
23−, mock
2424, python-dateutil
2525, pytz
2626, six
2727, sqlalchemy
28+, sqlalchemy-continuum
2829, werkzeug
2930, wtforms
3031, psycopg2 # optional, for postgresql support
3132, flask_testing
3233}:
3334
35+# ihatemoney is not really a library. It will only ever be imported
36+# by the interpreter of uwsgi. So overrides for its depencies are fine.
37+let
38+ # https://github.com/spiral-project/ihatemoney/issues/567
39+ pinned_wtforms = wtforms.overridePythonAttrs (old: rec {
40+ pname = "WTForms";
41+ version = "2.2.1";
42+ src = fetchPypi {
43+ inherit pname version;
44+ sha256 = "0q9vkcq6jnnn618h27lx9sas6s9qlg2mv8ja6dn0hy38gwzarnqc";
45+ };
46+ });
47+ pinned_flask_wtf = flask_wtf.override { wtforms = pinned_wtforms; };
48+in
49+
3450buildPythonPackage rec {
3551 pname = "ihatemoney";
36− version = "4.1";
52+ version = "4.2";
3753
3854 src = fetchFromGitHub {
3955 owner = "spiral-project";
4056 repo = pname;
4157 rev = version;
42− sha256 = "1ai7v2i2rvswzv21nwyq51fvp8lr2x2cl3n34p11br06kc1pcmin";
58+ sha256 = "0d4vc6m0jkwlz9ly0hcjghccydvqbldh2jb8yzf94jrgkd5fd7k1";
4359 };
4460
61+ disabled = isPy27;
62+
63+ patches = [
64+ # fix migration on postgresql
65+ # remove on next release
66+ (fetchpatch {
67+ url = "https://github.com/spiral-project/ihatemoney/commit/6129191b26784b895e203fa3eafb89cee7d88b71.patch";
68+ sha256 = "0yc24gsih9x3pnh2mhj4v5i71x02dq93a9jd2r8b1limhcl4p1sw";
69+ })
70+ ];
71+
72+ postPatch = ''
73+ # remove draconian pinning
74+ sed -i 's/==.*$//' setup.cfg
75+ '';
76+
4577 propagatedBuildInputs = [
4678 alembic
4779 aniso8601
@@ -58,7 +90,7 @@ buildPythonPackage rec {
5890 flask-restful
5991 flask_script
6092 flask_sqlalchemy
61− flask_wtf
93+ pinned_flask_wtf
6294 idna
6395 itsdangerous
6496 jinja2
@@ -68,14 +100,16 @@ buildPythonPackage rec {
68100 pytz
69101 six
70102 sqlalchemy
103+ sqlalchemy-continuum
71104 werkzeug
72− wtforms
105+ pinned_wtforms
73106 psycopg2
107+ debts
74108 ];
75109
76110 checkInputs = [
77111 flask_testing
78− ] ++ lib.optionals isPy27 [ mock ];
112+ ];
79113
80114 passthru.tests = {
81115 inherit (nixosTests) ihatemoney;