Merge pull request #85023 from symphorien/update-ihatemony

python3Packages.ihatemoney: 4.1 -> 4.2

Changed files
+179 -12
nixos
pkgs
development
python-modules
debts
ihatemoney
sqlalchemy-continuum
sqlalchemy-i18n
servers
uwsgi
top-level
+10 -3
nixos/tests/ihatemoney.nix
···
+
{ 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 = {
···
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"
···
assert "ihatemoney" in machine.succeed("curl http://localhost:8000")
'';
-
});
+
};
in {
ihatemoney-sqlite = f "sqlite";
ihatemoney-postgresql = f "postgresql";
+42
pkgs/development/python-modules/debts/default.nix
···
+
{ 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 ];
+
};
+
}
+41 -7
pkgs/development/python-modules/ihatemoney/default.nix
···
-
{ buildPythonPackage, lib, fetchFromGitHub, isPy27, nixosTests
+
{ buildPythonPackage, lib, fetchFromGitHub, isPy27, nixosTests, fetchpatch, fetchPypi
, alembic
, aniso8601
, Babel
···
, 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
···
flask-restful
flask_script
flask_sqlalchemy
-
flask_wtf
+
pinned_flask_wtf
idna
itsdangerous
jinja2
···
pytz
six
sqlalchemy
+
sqlalchemy-continuum
werkzeug
-
wtforms
+
pinned_wtforms
psycopg2
+
debts
];
checkInputs = [
flask_testing
-
] ++ lib.optionals isPy27 [ mock ];
+
];
passthru.tests = {
inherit (nixosTests) ihatemoney;
+46
pkgs/development/python-modules/sqlalchemy-continuum/default.nix
···
+
{ 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;
+
};
+
}
+32
pkgs/development/python-modules/sqlalchemy-i18n/default.nix
···
+
{ 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;
+
};
+
}
+2 -2
pkgs/servers/uwsgi/default.nix
···
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 ];
+6
pkgs/top-level/python-packages.nix
···
inherit (pkgs) dbus pkgconfig;
};
+
debts = callPackage ../development/python-modules/debts { };
+
dftfit = callPackage ../development/python-modules/dftfit { };
dicom2nifti = callPackage ../development/python-modules/dicom2nifti { };
···
sqlalchemy = callPackage ../development/python-modules/sqlalchemy { };
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 { };