diff options
author | Timo Kaufmann <timokau@zoho.com> | 2020-07-06 19:24:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-06 19:24:01 +0200 |
commit | ed720586580914a64c6175c98d0ea7d0f674d9fb (patch) | |
tree | cef329cad602de7b7fea4934e7851cb4efcfbb70 | |
parent | 78012a452c033c5bb93779f1c655087c793248e7 (diff) | |
parent | 2b0cfa48abe311e85785b94d8efa23d104e0e9b8 (diff) |
Merge pull request #85023 from symphorien/update-ihatemony
python3Packages.ihatemoney: 4.1 -> 4.2
-rw-r--r-- | nixos/tests/ihatemoney.nix | 13 | ||||
-rw-r--r-- | pkgs/development/python-modules/debts/default.nix | 42 | ||||
-rw-r--r-- | pkgs/development/python-modules/ihatemoney/default.nix | 48 | ||||
-rw-r--r-- | pkgs/development/python-modules/sqlalchemy-continuum/default.nix | 46 | ||||
-rw-r--r-- | pkgs/development/python-modules/sqlalchemy-i18n/default.nix | 32 | ||||
-rw-r--r-- | pkgs/servers/uwsgi/default.nix | 4 | ||||
-rw-r--r-- | pkgs/top-level/python-packages.nix | 6 |
7 files changed, 179 insertions, 12 deletions
diff --git a/nixos/tests/ihatemoney.nix b/nixos/tests/ihatemoney.nix index 7df0ea0b691f..0451a4505808 100644 --- a/nixos/tests/ihatemoney.nix +++ b/nixos/tests/ihatemoney.nix @@ -1,5 +1,11 @@ +{ system ? builtins.currentSystem, + config ? {}, + pkgs ? import ../.. { inherit system config; } +}: + let - f = backend: import ./make-test-python.nix ({ pkgs, ... }: { + inherit (import ../lib/testing-python.nix { inherit system pkgs; }) makeTest; + f = backend: makeTest { name = "ihatemoney-${backend}"; machine = { lib, ... }: { services.ihatemoney = { @@ -24,9 +30,10 @@ let testScript = '' machine.wait_for_open_port(8000) machine.wait_for_unit("uwsgi.service") + machine.wait_until_succeeds("curl http://localhost:8000") assert '"yay"' in machine.succeed( - "curl -X POST http://localhost:8000/api/projects -d 'name=yay&id=yay&password=yay&contact_email=yay\@example.com'" + "curl -X POST http://localhost:8000/api/projects -d 'name=yay&id=yay&password=yay&contact_email=yay@example.com'" ) owner, timestamp = machine.succeed( "stat --printf %U:%G___%Y /var/lib/ihatemoney/secret_key" @@ -48,7 +55,7 @@ let assert "ihatemoney" in machine.succeed("curl http://localhost:8000") ''; - }); + }; in { ihatemoney-sqlite = f "sqlite"; ihatemoney-postgresql = f "postgresql"; diff --git a/pkgs/development/python-modules/debts/default.nix b/pkgs/development/python-modules/debts/default.nix new file mode 100644 index 000000000000..cc571f056314 --- /dev/null +++ b/pkgs/development/python-modules/debts/default.nix @@ -0,0 +1,42 @@ +{ lib +, python +, buildPythonPackage +, fetchFromGitLab +, isPy27 +, jinja2 +, pytest +}: + +buildPythonPackage rec { + pname = "debts"; + version = "0.5"; + + # pypi does not ship tests + src = fetchFromGitLab { + domain = "framagit.org"; + owner = "almet"; + repo = "debts"; + rev = "d887bd8b340172d1c9bbcca6426529b8d1c2a241"; # no tags + sha256 = "1d66nka81mv9c07mki78lp5hdajqv4cq6aq2k7bh3mhkc5hwnwlg"; + }; + + disabled = isPy27; + + propagatedBuildInputs = [ jinja2 ]; + + checkInputs = [ pytest ]; + + # for some reason tests only work if the module is properly installed + checkPhase = '' + rm -r debts + export PYTHONPATH=$out/${python.sitePackages}:$PYTHONPATH + py.test tests + ''; + + meta = with lib; { + inherit (src.meta) homepage; + description = "A simple library and cli-tool to help you solve some debts settlement scenarios"; + license = licenses.beerware; + maintainers = [ maintainers.symphorien ]; + }; +} diff --git a/pkgs/development/python-modules/ihatemoney/default.nix b/pkgs/development/python-modules/ihatemoney/default.nix index 5df5e6b18cd2..38d762ec3607 100644 --- a/pkgs/development/python-modules/ihatemoney/default.nix +++ b/pkgs/development/python-modules/ihatemoney/default.nix @@ -1,4 +1,4 @@ -{ buildPythonPackage, lib, fetchFromGitHub, isPy27, nixosTests +{ buildPythonPackage, lib, fetchFromGitHub, isPy27, nixosTests, fetchpatch, fetchPypi , alembic , aniso8601 , Babel @@ -15,33 +15,65 @@ , flask_script , flask_sqlalchemy , flask_wtf +, debts , idna , itsdangerous , jinja2 , Mako , markupsafe -, mock , python-dateutil , pytz , six , sqlalchemy +, sqlalchemy-continuum , werkzeug , wtforms , psycopg2 # optional, for postgresql support , flask_testing }: +# ihatemoney is not really a library. It will only ever be imported +# by the interpreter of uwsgi. So overrides for its depencies are fine. +let + # https://github.com/spiral-project/ihatemoney/issues/567 + pinned_wtforms = wtforms.overridePythonAttrs (old: rec { + pname = "WTForms"; + version = "2.2.1"; + src = fetchPypi { + inherit pname version; + sha256 = "0q9vkcq6jnnn618h27lx9sas6s9qlg2mv8ja6dn0hy38gwzarnqc"; + }; + }); + pinned_flask_wtf = flask_wtf.override { wtforms = pinned_wtforms; }; +in + buildPythonPackage rec { pname = "ihatemoney"; - version = "4.1"; + version = "4.2"; src = fetchFromGitHub { owner = "spiral-project"; repo = pname; rev = version; - sha256 = "1ai7v2i2rvswzv21nwyq51fvp8lr2x2cl3n34p11br06kc1pcmin"; + sha256 = "0d4vc6m0jkwlz9ly0hcjghccydvqbldh2jb8yzf94jrgkd5fd7k1"; }; + disabled = isPy27; + + patches = [ + # fix migration on postgresql + # remove on next release + (fetchpatch { + url = "https://github.com/spiral-project/ihatemoney/commit/6129191b26784b895e203fa3eafb89cee7d88b71.patch"; + sha256 = "0yc24gsih9x3pnh2mhj4v5i71x02dq93a9jd2r8b1limhcl4p1sw"; + }) + ]; + + postPatch = '' + # remove draconian pinning + sed -i 's/==.*$//' setup.cfg + ''; + propagatedBuildInputs = [ alembic aniso8601 @@ -58,7 +90,7 @@ buildPythonPackage rec { flask-restful flask_script flask_sqlalchemy - flask_wtf + pinned_flask_wtf idna itsdangerous jinja2 @@ -68,14 +100,16 @@ buildPythonPackage rec { pytz six sqlalchemy + sqlalchemy-continuum werkzeug - wtforms + pinned_wtforms psycopg2 + debts ]; checkInputs = [ flask_testing - ] ++ lib.optionals isPy27 [ mock ]; + ]; passthru.tests = { inherit (nixosTests) ihatemoney; diff --git a/pkgs/development/python-modules/sqlalchemy-continuum/default.nix b/pkgs/development/python-modules/sqlalchemy-continuum/default.nix new file mode 100644 index 000000000000..fb854c1809d4 --- /dev/null +++ b/pkgs/development/python-modules/sqlalchemy-continuum/default.nix @@ -0,0 +1,46 @@ +{ stdenv +, lib +, fetchPypi +, buildPythonPackage +, flask +, flask_login +, flask_sqlalchemy +, flexmock +, pytestCheckHook +, sqlalchemy +, sqlalchemy-utils +, sqlalchemy-i18n +}: + +buildPythonPackage rec { + pname = "SQLAlchemy-Continuum"; + version = "1.3.9"; + + src = fetchPypi { + inherit pname version; + sha256 = "0b7q0rqy5q7m9yw7yl7jzrk8p1jh1hqmqvzf45rwmwxs724kfkjg"; + }; + + propagatedBuildInputs = [ + sqlalchemy + sqlalchemy-utils + ]; + + # indicate tests that we don't have a database server at hand + DB = "sqlite"; + + checkInputs = [ + pytestCheckHook + sqlalchemy-i18n + flask + flask_login + flask_sqlalchemy + flexmock + ]; + + meta = with lib; { + homepage = "https://github.com/kvesteri/sqlalchemy-continuum/"; + description = "Versioning and auditing extension for SQLAlchemy"; + license = licenses.bsd3; + }; +} diff --git a/pkgs/development/python-modules/sqlalchemy-i18n/default.nix b/pkgs/development/python-modules/sqlalchemy-i18n/default.nix new file mode 100644 index 000000000000..4ef0adefe3e7 --- /dev/null +++ b/pkgs/development/python-modules/sqlalchemy-i18n/default.nix @@ -0,0 +1,32 @@ +{ stdenv +, lib +, fetchPypi +, buildPythonPackage +, sqlalchemy +, sqlalchemy-utils +, psycopg2 +}: + +buildPythonPackage rec { + pname = "SQLAlchemy-i18n"; + version = "1.0.3"; + + src = fetchPypi { + inherit pname version; + sha256 = "15xah8643p29kciz365ixs9pbsflj92pzr2d9anbdh2biyf4cka8"; + }; + + propagatedBuildInputs = [ + sqlalchemy + sqlalchemy-utils + ]; + + # tests require running a postgresql server + doCheck = false; + + meta = with lib; { + homepage = "https://github.com/kvesteri/sqlalchemy-i18n"; + description = "Internationalization extension for SQLAlchemy models"; + license = licenses.bsd3; + }; +} diff --git a/pkgs/servers/uwsgi/default.nix b/pkgs/servers/uwsgi/default.nix index 0f0d2c23e4c4..39a3113eb410 100644 --- a/pkgs/servers/uwsgi/default.nix +++ b/pkgs/servers/uwsgi/default.nix @@ -54,11 +54,11 @@ in stdenv.mkDerivation rec { pname = "uwsgi"; - version = "2.0.18"; + version = "2.0.19.1"; src = fetchurl { url = "https://projects.unbit.it/downloads/${pname}-${version}.tar.gz"; - sha256 = "10zmk4npknigmbqcq1wmhd461dk93159px172112vyq0i19sqwj9"; + sha256 = "0256v72b7zr6ds4srpaawk1px3bp0djdwm239w3wrxpw7dzk1gjn"; }; nativeBuildInputs = [ python3 pkgconfig ]; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f057e86b2557..44ca10c7d60a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -683,6 +683,8 @@ in { inherit (pkgs) dbus pkgconfig; }; + debts = callPackage ../development/python-modules/debts { }; + dftfit = callPackage ../development/python-modules/dftfit { }; dicom2nifti = callPackage ../development/python-modules/dicom2nifti { }; @@ -6025,6 +6027,10 @@ in { sqlalchemy-citext = callPackage ../development/python-modules/sqlalchemy-citext { }; + sqlalchemy-continuum = callPackage ../development/python-modules/sqlalchemy-continuum { }; + + sqlalchemy-i18n = callPackage ../development/python-modules/sqlalchemy-i18n { }; + sqlalchemy_migrate = callPackage ../development/python-modules/sqlalchemy-migrate { }; sqlalchemy-utils = callPackage ../development/python-modules/sqlalchemy-utils { }; |