git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #85023 from symphorien/update-ihatemony

python3Packages.ihatemoney: 4.1 -> 4.2

commited720586580914a64c6175c98d0ea7d0f674d9fb authorTimo Kaufmann <timokau@zoho.com> dateMon 6 Jul 2020, 19:24 (6 years ago) parent78012a42b0cfa4
7 files changed+179−12
nixos/tests/ihatemoney.nix+10−3 pkgs/development/python-modules/debts/default.nix+42 pkgs/development/python-modules/ihatemoney/default.nix+41−7 pkgs/development/python-modules/sqlalchemy-continuum/default.nix+46 pkgs/development/python-modules/sqlalchemy-i18n/default.nix+32 pkgs/servers/uwsgi/default.nix+2−2 pkgs/top-level/python-packages.nix+6
nixos/tests/ihatemoney.nix+10−3
@@ -1,5 +1,11 @@
1+{ system ? builtins.currentSystem,
2+ config ? {},
3+ pkgs ? import ../.. { inherit system config; }
4+}:
5+
16let
2− f = backend: import ./make-test-python.nix ({ pkgs, ... }: {
7+ inherit (import ../lib/testing-python.nix { inherit system pkgs; }) makeTest;
8+ f = backend: makeTest {
39 name = "ihatemoney-${backend}";
410 machine = { lib, ... }: {
511 services.ihatemoney = {
@@ -24,9 +30,10 @@ let
2430 testScript = ''
2531 machine.wait_for_open_port(8000)
2632 machine.wait_for_unit("uwsgi.service")
33+ machine.wait_until_succeeds("curl http://localhost:8000")
2734
2835 assert '"yay"' in machine.succeed(
29− "curl -X POST http://localhost:8000/api/projects -d 'name=yay&id=yay&password=yay&contact_email=yay\@example.com'"
36+ "curl -X POST http://localhost:8000/api/projects -d 'name=yay&id=yay&password=yay&contact_email=yay@example.com'"
3037 )
3138 owner, timestamp = machine.succeed(
3239 "stat --printf %U:%G___%Y /var/lib/ihatemoney/secret_key"
@@ -48,7 +55,7 @@ let
4855
4956 assert "ihatemoney" in machine.succeed("curl http://localhost:8000")
5057 '';
51− });
58+ };
5259in {
5360 ihatemoney-sqlite = f "sqlite";
5461 ihatemoney-postgresql = f "postgresql";
pkgs/development/python-modules/debts/default.nixnew file+42
@@ -0,0 +1,42 @@
1+{ lib
2+, python
3+, buildPythonPackage
4+, fetchFromGitLab
5+, isPy27
6+, jinja2
7+, pytest
8+}:
9+
10+buildPythonPackage rec {
11+ pname = "debts";
12+ version = "0.5";
13+
14+ # pypi does not ship tests
15+ src = fetchFromGitLab {
16+ domain = "framagit.org";
17+ owner = "almet";
18+ repo = "debts";
19+ rev = "d887bd8b340172d1c9bbcca6426529b8d1c2a241"; # no tags
20+ sha256 = "1d66nka81mv9c07mki78lp5hdajqv4cq6aq2k7bh3mhkc5hwnwlg";
21+ };
22+
23+ disabled = isPy27;
24+
25+ propagatedBuildInputs = [ jinja2 ];
26+
27+ checkInputs = [ pytest ];
28+
29+ # for some reason tests only work if the module is properly installed
30+ checkPhase = ''
31+ rm -r debts
32+ export PYTHONPATH=$out/${python.sitePackages}:$PYTHONPATH
33+ py.test tests
34+ '';
35+
36+ meta = with lib; {
37+ inherit (src.meta) homepage;
38+ description = "A simple library and cli-tool to help you solve some debts settlement scenarios";
39+ license = licenses.beerware;
40+ maintainers = [ maintainers.symphorien ];
41+ };
42+}
pkgs/development/python-modules/ihatemoney/default.nix+41−7
@@ -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;
pkgs/development/python-modules/sqlalchemy-continuum/default.nixnew file+46
@@ -0,0 +1,46 @@
1+{ stdenv
2+, lib
3+, fetchPypi
4+, buildPythonPackage
5+, flask
6+, flask_login
7+, flask_sqlalchemy
8+, flexmock
9+, pytestCheckHook
10+, sqlalchemy
11+, sqlalchemy-utils
12+, sqlalchemy-i18n
13+}:
14+
15+buildPythonPackage rec {
16+ pname = "SQLAlchemy-Continuum";
17+ version = "1.3.9";
18+
19+ src = fetchPypi {
20+ inherit pname version;
21+ sha256 = "0b7q0rqy5q7m9yw7yl7jzrk8p1jh1hqmqvzf45rwmwxs724kfkjg";
22+ };
23+
24+ propagatedBuildInputs = [
25+ sqlalchemy
26+ sqlalchemy-utils
27+ ];
28+
29+ # indicate tests that we don't have a database server at hand
30+ DB = "sqlite";
31+
32+ checkInputs = [
33+ pytestCheckHook
34+ sqlalchemy-i18n
35+ flask
36+ flask_login
37+ flask_sqlalchemy
38+ flexmock
39+ ];
40+
41+ meta = with lib; {
42+ homepage = "https://github.com/kvesteri/sqlalchemy-continuum/";
43+ description = "Versioning and auditing extension for SQLAlchemy";
44+ license = licenses.bsd3;
45+ };
46+}
pkgs/development/python-modules/sqlalchemy-i18n/default.nixnew file+32
@@ -0,0 +1,32 @@
1+{ stdenv
2+, lib
3+, fetchPypi
4+, buildPythonPackage
5+, sqlalchemy
6+, sqlalchemy-utils
7+, psycopg2
8+}:
9+
10+buildPythonPackage rec {
11+ pname = "SQLAlchemy-i18n";
12+ version = "1.0.3";
13+
14+ src = fetchPypi {
15+ inherit pname version;
16+ sha256 = "15xah8643p29kciz365ixs9pbsflj92pzr2d9anbdh2biyf4cka8";
17+ };
18+
19+ propagatedBuildInputs = [
20+ sqlalchemy
21+ sqlalchemy-utils
22+ ];
23+
24+ # tests require running a postgresql server
25+ doCheck = false;
26+
27+ meta = with lib; {
28+ homepage = "https://github.com/kvesteri/sqlalchemy-i18n";
29+ description = "Internationalization extension for SQLAlchemy models";
30+ license = licenses.bsd3;
31+ };
32+}
pkgs/servers/uwsgi/default.nix+2−2
@@ -54,11 +54,11 @@ in
5454
5555stdenv.mkDerivation rec {
5656 pname = "uwsgi";
57− version = "2.0.18";
57+ version = "2.0.19.1";
5858
5959 src = fetchurl {
6060 url = "https://projects.unbit.it/downloads/${pname}-${version}.tar.gz";
61− sha256 = "10zmk4npknigmbqcq1wmhd461dk93159px172112vyq0i19sqwj9";
61+ sha256 = "0256v72b7zr6ds4srpaawk1px3bp0djdwm239w3wrxpw7dzk1gjn";
6262 };
6363
6464 nativeBuildInputs = [ python3 pkgconfig ];
pkgs/top-level/python-packages.nix+6
@@ -683,6 +683,8 @@ in {
683683 inherit (pkgs) dbus pkgconfig;
684684 };
685685
686+ debts = callPackage ../development/python-modules/debts { };
687+
686688 dftfit = callPackage ../development/python-modules/dftfit { };
687689
688690 dicom2nifti = callPackage ../development/python-modules/dicom2nifti { };
@@ -6025,6 +6027,10 @@ in {
60256027
60266028 sqlalchemy-citext = callPackage ../development/python-modules/sqlalchemy-citext { };
60276029
6030+ sqlalchemy-continuum = callPackage ../development/python-modules/sqlalchemy-continuum { };
6031+
6032+ sqlalchemy-i18n = callPackage ../development/python-modules/sqlalchemy-i18n { };
6033+
60286034 sqlalchemy_migrate = callPackage ../development/python-modules/sqlalchemy-migrate { };
60296035
60306036 sqlalchemy-utils = callPackage ../development/python-modules/sqlalchemy-utils { };